mirror of
https://github.com/Neo-Desktop/WindowsXPKg
synced 2025-12-10 04:05:13 +02:00
Update windows-x86-x64.yml
This commit is contained in:
30
.github/workflows/windows-x86-x64.yml
vendored
30
.github/workflows/windows-x86-x64.yml
vendored
@@ -210,8 +210,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Strip symbols
|
# Strip symbols
|
||||||
strip .\umskt.exe
|
strip .\umskt.exe
|
||||||
|
|
||||||
# Generate the Resource Hacker script
|
# Validate input EXE exists
|
||||||
|
if (!(Test-Path .\umskt.exe)) {
|
||||||
|
throw "Input file .\umskt.exe does not exist!"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Prepare ResHacker script (no indentation inside block!)
|
||||||
$resourceHackerScript = @"
|
$resourceHackerScript = @"
|
||||||
[FILENAMES]
|
[FILENAMES]
|
||||||
Exe=.\umskt.exe
|
Exe=.\umskt.exe
|
||||||
@@ -221,29 +226,34 @@ jobs:
|
|||||||
Icon=*
|
Icon=*
|
||||||
IconGroup=*
|
IconGroup=*
|
||||||
"@
|
"@
|
||||||
|
|
||||||
$iniPath = "$env:TEMP\remove_icons.ini"
|
|
||||||
$resourceHackerScript | Set-Content -Encoding ASCII $iniPath
|
|
||||||
|
|
||||||
# Run Resource Hacker and wait for result
|
$iniPath = "$env:TEMP\remove_icons.ini"
|
||||||
|
$logPath = "$env:TEMP\reshacker_log.txt"
|
||||||
|
$resourceHackerScript | Set-Content -Encoding ASCII $iniPath
|
||||||
|
|
||||||
|
# Validate ResHacker path
|
||||||
$resHacker = "C:\ResourceHacker\ResourceHacker.exe"
|
$resHacker = "C:\ResourceHacker\ResourceHacker.exe"
|
||||||
if (!(Test-Path $resHacker)) {
|
if (!(Test-Path $resHacker)) {
|
||||||
throw "Resource Hacker not found at $resHacker"
|
throw "Resource Hacker not found at $resHacker"
|
||||||
}
|
}
|
||||||
|
|
||||||
& "$resHacker" -script "$iniPath"
|
# Run Resource Hacker and capture output
|
||||||
|
& "$resHacker" -script "$iniPath" *> "$logPath"
|
||||||
# Verify output file was created
|
Get-Content "$logPath"
|
||||||
|
|
||||||
|
# Check if output file was created
|
||||||
if (!(Test-Path .\umskt_comp.exe)) {
|
if (!(Test-Path .\umskt_comp.exe)) {
|
||||||
throw "Resource Hacker failed to create umskt_comp.exe"
|
throw "Resource Hacker failed to create umskt_comp.exe"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compress with UPX
|
# Compress with UPX
|
||||||
& "C:\UPX\upx-5.0.2-win64\upx.exe" --best --ultra-brute .\umskt_comp.exe
|
& "C:\UPX\upx-5.0.2-win64\upx.exe" --best --ultra-brute .\umskt_comp.exe
|
||||||
|
|
||||||
# Replace original EXE
|
# Replace original EXE
|
||||||
Remove-Item .\umskt.exe
|
Remove-Item .\umskt.exe
|
||||||
Rename-Item -Path .\umskt_comp.exe -NewName umskt.exe
|
Rename-Item -Path .\umskt_comp.exe -NewName umskt.exe
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|||||||
Reference in New Issue
Block a user