Allow to install both win32 and sdl versions

This commit is contained in:
Thomas Bernard 2018-12-04 00:27:56 +01:00 committed by Adrien Destugues
parent bb25913053
commit f768dc357b

View File

@ -131,32 +131,32 @@ Section "Grafx2" SecProgram
File ..\share\grafx2\fonts\PF_Westa_7__.png File ..\share\grafx2\fonts\PF_Westa_7__.png
; Register in Add/Remove programs ; Register in Add/Remove programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"DisplayName" "GrafX2 (GNU GPL)" "DisplayName" "GrafX2-${API} (GNU GPL)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"Publisher" "GrafX2 Project Team" "Publisher" "GrafX2 Project Team"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"UninstallString" "$INSTDIR\uninstall.exe" "UninstallString" "$INSTDIR\uninstall-${API}.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"InstalledProductName" "GrafX2" "InstalledProductName" "GrafX2"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"InstalledLocation" $INSTDIR "InstalledLocation" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"DisplayIcon" "$INSTDIR\gfx2.ico" "DisplayIcon" "$INSTDIR\gfx2.ico"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"URLInfoAbout" "http://grafx2.tk" "URLInfoAbout" "http://grafx2.tk"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"DisplayVersion" "${VERSION}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"NoModify" 1 "NoModify" 1
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
"NoRepair" 1 "NoRepair" 1
;Store installation folder ;Store installation folder
WriteRegStr HKLM "Software\Grafx2" "" $INSTDIR WriteRegStr HKLM "Software\Grafx2" "" $INSTDIR
;Create uninstaller ;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall-${API}.exe"
SectionEnd SectionEnd
@ -210,20 +210,25 @@ Section "un.SecProgram"
RMDir "$INSTDIR\share\grafx2\scripts" RMDir "$INSTDIR\share\grafx2\scripts"
RMDir "$INSTDIR\share\grafx2" RMDir "$INSTDIR\share\grafx2"
RMDir "$INSTDIR\share" RMDir "$INSTDIR\share"
Delete "$INSTDIR\Uninstall.exe" Delete "$INSTDIR\Uninstall-${API}.exe"
MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION "Do you wish to keep your configuration settings ?" IDYES keepconfig IDNO deleteconfig MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION "Do you wish to keep your configuration settings ?" IDYES keepconfig IDNO deleteconfig
deleteconfig: deleteconfig:
Delete "$INSTDIR\gfx2.cfg" !if ${API} == "win32"
Delete "$INSTDIR\gfx2-win32.cfg"
Delete "$APPDATA\Grafx2\gfx2-win32.cfg"
!else
Delete "$INSTDIR\gfx2.cfg"
Delete "$APPDATA\Grafx2\gfx2.cfg"
!endif
Delete "$INSTDIR\gfx2.ini" Delete "$INSTDIR\gfx2.ini"
Delete "$APPDATA\Grafx2\gfx2.cfg"
Delete "$APPDATA\Grafx2\gfx2.ini" Delete "$APPDATA\Grafx2\gfx2.ini"
RMDir "$APPDATA\Grafx2" RMDir "$APPDATA\Grafx2"
keepconfig: keepconfig:
RMDir "$INSTDIR" RMDir "$INSTDIR"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}"
DeleteRegKey /ifempty HKLM "Software\Grafx2" DeleteRegKey /ifempty HKLM "Software\Grafx2"