Skip to content

Commit 7d0613f

Browse files
authored
HDL Batch Installer 3.7.0.0 (#101)
* modify project to build 32bit version on a wxwidgets DLL * fix conditions for disabling PFS filebrowser > when feature is disabled compile time and run time (eg: dll init fail) * [install] implement progress gauge on toolbar icon * [PFS Browser]: fix non initialized error counter * add release DLLs * push missing files * implement win32 API drive listing * push files * Delete PR_Labeler.yml * remove 32 bits release * push final changes * ignore layout file * QOL: tag update shouldnt run out of master branch * Update Repack-and-release.yml * update translation template and spanish lang * move init code to constructor > Silly mistakes that I made years ago. back when I was still learning the basics * push remaining files for release
1 parent 7fcfe6f commit 7d0613f

36 files changed

Lines changed: 1527 additions & 946 deletions

.github/workflows/PR_Labeler.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/Repack-and-release.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
steps:
2020

2121
- name: checkout code for release
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323

2424
- name: "Check file existence"
25-
uses: andstor/file-existence-action@v1
25+
uses: andstor/file-existence-action@v3
2626
with:
27-
files: "Release/HDL-Batch-installer.exe, Release32/HDL-Batch-installer.exe, Release/HDL.EXE, Release/boot.kelf, Release/Common/config.INI"
28-
allow_failure: "true"
27+
files: "Release/HDL-Batch-installer.exe, Release/HDL.EXE, Release/boot.kelf, Release/Common/config.INI"
28+
fail: true
2929

3030
- name: Install dependencies
3131
run: |
@@ -85,14 +85,11 @@ jobs:
8585
8686
- name: delete previous tag/release
8787
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
88-
uses: dev-drprasad/delete-tag-and-release@v0.2.1
89-
with:
90-
delete_release: true
91-
tag_name: Latest
88+
run: gh release delete Latest -y --cleanup-tag
9289
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9491

95-
- name: Repack latest x64 build
92+
- name: Repack latest build
9693
run: |
9794
SCH=${GITHUB_SHA::7}
9895
REF=${{ env.VERSION_TAG }}
@@ -108,22 +105,6 @@ jobs:
108105
cp -r Release "HDLBInst[${{ env.VERSION }}-x64]"
109106
7z a -t7z -r HDLBInst-x64-$REF.7z HDLBInst*x64*/*
110107
111-
- name: Repack latest x86 build
112-
run: |
113-
SCH=${GITHUB_SHA::7}
114-
REF=${{ env.VERSION_TAG }}
115-
cd Release
116-
cd Common
117-
echo 32bits build >>commit.sys
118-
cd ..
119-
cd ..
120-
rm Release/HDL-Batch-installer.exe
121-
rm Release/libps2hdd.dll
122-
cp -r Release32/* Release/
123-
mv Release "HDLBInst[${{ env.VERSION }}-x86]"
124-
7z a -t7z -r HDLBInst-x86-$REF.7z HDLBInst*x86*/*
125-
126-
127108
- name: Upload artifacts
128109
if: ${{ success() }}
129110
uses: actions/upload-artifact@v4
@@ -134,14 +115,13 @@ jobs:
134115
Translation-template.7z
135116
136117
- name: Deploy pre-release
137-
uses: softprops/action-gh-release@v1
118+
uses: softprops/action-gh-release@v2
138119
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
139120
with:
140121
token: "${{ secrets.GITHUB_TOKEN }}"
141122
fail_on_unmatched_files: true
142123
files: |
143124
HDLBInst*x64*.7z
144-
HDLBInst*x86*.7z
145125
Translation-template.7z
146126
name: "${{ env.VERSION }}"
147127
tag_name: "Latest"
@@ -155,7 +135,7 @@ jobs:
155135
steps:
156136

157137
- name: checkout code for release
158-
uses: actions/checkout@v1
138+
uses: actions/checkout@v4
159139

160140
- name: get version from changelog
161141
shell: bash

.github/workflows/Update_version_tag.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Update version tag
22
on:
33
workflow_dispatch:
44
push:
5+
branches:
6+
- 'main'
57
paths:
68
- 'Release**'
79
- 'Release32**'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ HDL-Batch-installer-SRC/_bin/playground/Downloads
3232
HDL-Batch-installer-SRC/HDL-Batch-installer.depend
3333
HDL-Batch-installer-SRC/gamename/gamename.csv
3434
HDL-Batch-installer-SRC/_bin/playground/errdump.txt
35+
HDL-Batch-installer-SRC/_bin/playground/wx*.dll
36+
HDL-Batch-installer-SRC/HDL-Batch-installer.layout

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files.associations": {
3+
"*.make": "makefile",
4+
"new": "cpp"
5+
}
6+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#include "GetPhysicalDrives.h"
2+
#include <winioctl.h>
3+
4+
5+
#if !(_WIN32_WINNT >= 0x0601)
6+
#define BusTypeiScsi 0x9
7+
#define BusTypeSas 0xA
8+
#define BusTypeSata 0xB
9+
#define BusTypeSd 0xC
10+
#define BusTypeMmc 0xD
11+
#endif
12+
13+
#if !(_WIN32_WINNT >= 0x0601)
14+
#define BusTypeVirtual 0xE
15+
#define BusTypeFileBackedVirtual 0xF
16+
#endif
17+
18+
#ifndef BusTypeNVMe
19+
#define BusTypeNVMe 17
20+
#endif
21+
#ifndef BusTypeSCM
22+
#define BusTypeSCM 18
23+
#endif
24+
#pragma GCC diagnostic push
25+
#pragma GCC diagnostic ignored "-Wswitch"
26+
std::string GetBusTypeString(STORAGE_BUS_TYPE busType) {
27+
switch (busType) {
28+
case BusTypeScsi: return "SCSI";
29+
case BusTypeAtapi: return "ATAPI";
30+
case BusTypeAta: return "ATA";
31+
case BusType1394: return "FireWire";
32+
case BusTypeSsa: return "SSA";
33+
case BusTypeFibre: return "Fibre Channel";
34+
case BusTypeUsb: return "USB";
35+
case BusTypeRAID: return "RAID";
36+
case BusTypeiScsi: return "iSCSI";
37+
case BusTypeSas: return "SAS";
38+
case BusTypeSata: return "SATA";
39+
case BusTypeSd: return "SD";
40+
case BusTypeMmc: return "MMC";
41+
case BusTypeVirtual: return "Virtual";
42+
case BusTypeNVMe: return "NVMe";
43+
case BusTypeSCM: return "SCM";
44+
case BusTypeUnknown:
45+
default: return "Unknown";
46+
}
47+
}
48+
#pragma GCC diagnostic pop
49+
50+
51+
std::vector<DiskInfo> GetPhysicalDrives() {
52+
std::vector<DiskInfo> drives;
53+
54+
for (int i = 0; i < 25; i++) { // Máximo 10 discos físicos
55+
std::string devicePath = "\\\\.\\PhysicalDrive" + std::to_string(i);
56+
HANDLE hDevice = CreateFileA(devicePath.c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE,
57+
NULL, OPEN_EXISTING, 0, NULL);
58+
59+
if (hDevice == INVALID_HANDLE_VALUE) {
60+
continue; // NotExist
61+
}
62+
63+
char buffer[512] = {0};
64+
STORAGE_PROPERTY_QUERY query = {StorageDeviceProperty, PropertyStandardQuery};
65+
DWORD bytesReturned = 0;
66+
67+
if (DeviceIoControl(hDevice, IOCTL_STORAGE_QUERY_PROPERTY, &query, sizeof(query),
68+
buffer, sizeof(buffer), &bytesReturned, NULL)) {
69+
STORAGE_DEVICE_DESCRIPTOR *desc = (STORAGE_DEVICE_DESCRIPTOR *)buffer;
70+
std::string siz(std::to_string(desc->Size));
71+
std::string caption = "Unknown";
72+
std::string bus = GetBusTypeString(desc->BusType);
73+
if (desc->ProductIdOffset) {
74+
caption = (buffer + desc->ProductIdOffset);
75+
}
76+
drives.push_back({devicePath, caption, bus});
77+
}
78+
79+
CloseHandle(hDevice);
80+
}
81+
82+
return drives;
83+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifndef GETPHYSICALDRIVES_H
2+
#define GETPHYSICALDRIVES_H
3+
#include <windows.h>
4+
#include <iostream>
5+
#include <vector>
6+
#include <string>
7+
8+
struct DiskInfo {
9+
std::string deviceID;
10+
std::string caption;
11+
std::string bustype;
12+
};
13+
std::vector<DiskInfo> GetPhysicalDrives();
14+
15+
#endif // GETPHYSICALDRIVES_H

0 commit comments

Comments
 (0)