Preparing installer for mC2dm2. Option to remove old APPDATA/mC2 folder.

This commit is contained in:
Daniel Önnerby 2008-11-03 10:35:46 +00:00
parent 779b37aae5
commit 6395ed3694
2 changed files with 50 additions and 0 deletions

View File

@ -20,15 +20,19 @@ Name "${PROJECT_NAME} ${SUB_NAME}"
ShowInstDetails show ;show/hide
Var RemoveOldDatabases
!include "LanguageStrings.nsh"
!insertmacro MUI_LANGUAGE "English"
InstallDir "$PROGRAMFILES\${INSTALL_DIR}"
InstallDirRegKey HKCU "Software\${INSTALL_DIR}" ""
; Installation pages order
!insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt"
!insertmacro MUI_PAGE_DIRECTORY
;!insertmacro MUI_PAGE_COMPONENTS
Page custom RemoveOldFilesPage RemoveOldFilesLeave ;Custom page
!insertmacro MUI_PAGE_INSTFILES
@ -47,11 +51,18 @@ Section "mC2installation" main
File /r "..\bin\release\resources"
SetOutPath "$INSTDIR\plugins"
Delete "*.dll"
File /r "..\bin\release\plugins\*.dll"
SetAutoClose false
IntCmpU $RemoveOldDatabases 0 DoNotRemoveDBFiles
; Remove the app data
RMDir /r $APPDATA\mC2
DoNotRemoveDBFiles:
CreateDirectory "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}"
CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\${PROJECT_NAME}.lnk" "$INSTDIR\mC2.exe"
CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\musikServer.lnk" "$INSTDIR\musikServer.exe"
@ -72,5 +83,15 @@ Section Uninstall
SectionEnd
Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "remove_old_db.ini"
FunctionEnd
Function RemoveOldFilesPage
!insertmacro MUI_HEADER_TEXT "mC2 installation" "Removing old database files"
!insertmacro MUI_INSTALLOPTIONS_WRITE "remove_old_db.ini" "Field 2" "Text" "Remove old mC2 databases in $APPDATA\mC2"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "remove_old_db.ini"
FunctionEnd
Function RemoveOldFilesLeave
!insertmacro MUI_INSTALLOPTIONS_READ $RemoveOldDatabases "remove_old_db.ini" "Field 2" "State"
FunctionEnd

View File

@ -0,0 +1,29 @@
; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=3
[Field 1]
Type=Groupbox
Text=Remove old files
Left=10
Right=258
Top=7
Bottom=83
[Field 2]
Type=Checkbox
Text=Remove old mC2 databases
Left=29
Right=242
Top=52
Bottom=83
State=1
[Field 3]
Type=Label
Text=If you have run an old version of mC2, you need to remove the old databases since they are incompatible with the latest version of mC2.
Left=22
Right=248
Top=23
Bottom=52