Feat: fix windows build script

This commit is contained in:
2026-03-18 13:39:45 +01:00
parent 712bd4e74e
commit 005155e486
2 changed files with 32 additions and 13 deletions

View File

@@ -39,8 +39,12 @@ Unicode True
Section "Cagire (required)" SecCore
SectionIn RO
SetOutPath "$INSTDIR"
File "/oname=cagire.exe" "${CLI_EXE}"
File "/oname=cagire-desktop.exe" "${DESKTOP_EXE}"
!ifdef CLI_EXE
File "/oname=cagire.exe" "${CLI_EXE}"
!endif
!ifdef DESKTOP_EXE
File "/oname=cagire-desktop.exe" "${DESKTOP_EXE}"
!endif
WriteUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Cagire" "InstallDir" "$INSTDIR"
@@ -50,7 +54,11 @@ Section "Cagire (required)" SecCore
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "Publisher" "Raphael Forment"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "DisplayIcon" '"$INSTDIR\cagire-desktop.exe"'
!ifdef DESKTOP_EXE
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "DisplayIcon" '"$INSTDIR\cagire-desktop.exe"'
!else
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "DisplayIcon" '"$INSTDIR\cagire.exe"'
!endif
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "URLInfoAbout" "https://git.raphaelforment.fr/BuboBubo/cagire"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "HelpLink" "https://cagire.raphaelforment.fr"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cagire" "NoModify" 1
@@ -64,21 +72,29 @@ Section "Add to PATH" SecPath
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
SectionEnd
!ifdef DESKTOP_EXE
Section "Start Menu Shortcut" SecStartMenu
CreateDirectory "$SMPROGRAMS\Cagire"
CreateShortCut "$SMPROGRAMS\Cagire\Cagire.lnk" "$INSTDIR\cagire-desktop.exe" "" "$INSTDIR\cagire-desktop.exe" 0
CreateShortCut "$SMPROGRAMS\Cagire\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
!endif
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Installs Cagire CLI and Desktop binaries."
!insertmacro MUI_DESCRIPTION_TEXT ${SecPath} "Add the install location to the PATH system environment variable."
!insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} "Add a Cagire shortcut to the Start Menu."
!ifdef DESKTOP_EXE
!insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} "Add a Cagire shortcut to the Start Menu."
!endif
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section "Uninstall"
Delete "$INSTDIR\cagire.exe"
Delete "$INSTDIR\cagire-desktop.exe"
!ifdef CLI_EXE
Delete "$INSTDIR\cagire.exe"
!endif
!ifdef DESKTOP_EXE
Delete "$INSTDIR\cagire-desktop.exe"
!endif
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"