generate uninst when generating windows installer

This commit is contained in:
ConfiG 2024-06-25 14:26:04 +03:00
parent ac93a6c220
commit 78acebc9c0
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B
2 changed files with 23 additions and 2 deletions
.github/workflows
installer/windows

View file

@ -128,7 +128,9 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: geode-installer-win
path: './installer/windows/geode-installer-win.exe'
path: |
./installer/windows/geode-installer-win.exe
./installer/windows/GeodeUninstaller.exe
- name: Complete Build Debug Info
uses: ./.github/actions/build-debug-info-post
@ -335,7 +337,9 @@ jobs:
- name: Zip Windows Artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-win/XInput1_4.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb
files: >-
geode-win/XInput1_4.dll geode-win/Geode.dll geode-win/Geode.lib geode-win/Geode.pdb
geode-win/GeodeUpdater.exe geode-installer-win/GeodeUninstaller.exe
dest: geode-${{ steps.ref.outputs.hash }}-win.zip
- name: Zip Android32 Artifacts

View file

@ -491,6 +491,23 @@ Section "steam_appid.txt"
SectionEnd
Function .onInit
# huge thanks to Anders for the reference !!
# https://forums.winamp.com/forum/developer-center/nsis-discussion/4633037-creating-an-uninstaller-in-compile-time?p=4633073#post4633073
!ifdef GENERATE_UNINSTALLER
WriteUninstaller "${__FILEDIR__}\GeodeUninstaller.exe"
SetErrorLevel 0
Quit
!else
; get a temporary file path
!tempfile TMPINST
!delfile "${TMPINST}"
; create and run the installer that just uses WriteUninstaller
!makensis '-DGENERATE_UNINSTALLER "${__FILE__}" "-XOutFile `${TMPINST}.exe`"'
!system '"${TMPINST}.exe" /S'
!delfile "${TMPINST}.exe"
!endif
!insertmacro MUI_LANGDLL_DISPLAY
IntOp $0 ${SF_SELECTED} | ${SF_RO}