Skip to content

Commit

Permalink
Replaced rcedit because it seems unsupported
Browse files Browse the repository at this point in the history
- Last release from 1 Oct 2018
- Serious bug: electron/rcedit#101
- Using Resource Hacker (http://www.angusj.com/resourcehacker/) instead
  • Loading branch information
kaikramer committed Dec 26, 2021
1 parent 1749c8e commit 49d52ad
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
steps:
- name: Disable automatic EOL conversions
run: git config --global core.autocrlf false
- name: Install required software packages
run: choco install reshack
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
Expand Down Expand Up @@ -62,6 +64,8 @@ jobs:
steps:
- name: Disable automatic EOL conversions
run: git config --global core.autocrlf false
- name: Install required software packages
run: choco install reshack
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
Expand All @@ -70,7 +74,7 @@ jobs:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
run: .\gradlew.bat innosetup
run: .\gradlew.bat test innosetup
working-directory: kse
- name: Store artifacts for release
uses: actions/upload-artifact@v2
Expand Down
64 changes: 54 additions & 10 deletions kse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Notes:
======
- Task 'innosetup' requires an installation of InnoSetup 6 and ISCC.exe added to the PATH.
- Tasks 'signapp' and 'dmg' work only under macOS.
- Tasks 'prepareExe', 'zip' and 'innosetup' require an installation of Resource Hacker (http://www.angusj.com/resourcehacker/)
*/

plugins {
Expand Down Expand Up @@ -67,6 +68,9 @@ ext {
appBundle = "${appName}.app"
dmgFile = "${appSimpleName}-${appSimpleVersion}.dmg"

// Resource Hacker for setting the version info and icon of kse.exe
rh = "c:\\Program Files (x86)\\Resource Hacker\\ResourceHacker.exe"

// Directories
resDir = "$projectDir/res"
iconsDir = "$projectDir/icons"
Expand Down Expand Up @@ -151,18 +155,58 @@ task prepareExe() {
rename("kse-launcher.exe", "$appExe")
into("$launcherOutDir")
}
def verInfo = appVersion.toString().replaceAll("\\.", ",") + ",0"
delete "$launcherOutDir/kse.rc"
new File(launcherOutDir, 'kse.rc') << """
1 VERSIONINFO
FILEVERSION $verInfo
PRODUCTVERSION $verInfo
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "FileDescription", "$appName"
VALUE "FileVersion", "$appVersion.0"
VALUE "InternalName", "$appSimpleName"
VALUE "LegalCopyright", "$copyright"
VALUE "OriginalFilename", "$appExe"
VALUE "ProductName", "$appName"
VALUE "ProductVersion", "$appVersion"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04B0
END
END
"""
exec {
workingDir projectDir
commandLine "${rh}",
'-open', "${launcherOutDir}\\kse.rc",
'-save', "${launcherOutDir}\\kse.res",
'-action', 'compile'
}
exec {
workingDir projectDir
commandLine "${rh}",
'-open', "${launcherOutDir}\\${appExe}",
'-save', "${launcherOutDir}\\${appExe}",
'-action', 'addoverwrite',
'-mask', ' VersionInfo,,',
'-res', "${launcherOutDir}\\kse.res"
}
exec {
workingDir projectDir
commandLine "${resDir}\\rcedit-x64.exe",
"${launcherOutDir}\\${appExe}",
'--set-version-string', 'FileDescription', "$appName",
'--set-version-string', 'ProductName', "$appName",
'--set-version-string', 'LegalCopyright', "$copyright",
'--set-version-string', 'OriginalFilename', "$appExe",
'--set-version-string', 'InternalName', "$appSimpleName",
'--set-file-version', "$appVersion.0",
'--set-product-version', "$appVersion",
'--set-icon', "$kseIco"
commandLine "${rh}",
'-open', "${launcherOutDir}\\${appExe}",
'-save', "${launcherOutDir}\\${appExe}",
'-action', 'addoverwrite',
'-mask', 'ICONGROUP,MAINICON,0',
'-res', "$kseIco"
}
}
}
Expand Down
Binary file removed kse/res/rcedit-x64.exe
Binary file not shown.

0 comments on commit 49d52ad

Please sign in to comment.