mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-15 19:52:19 +00:00
Preparing installer for mC2dm2. Option to remove old APPDATA/mC2 folder.
This commit is contained in:
parent
779b37aae5
commit
6395ed3694
@ -20,15 +20,19 @@ Name "${PROJECT_NAME} ${SUB_NAME}"
|
|||||||
|
|
||||||
ShowInstDetails show ;show/hide
|
ShowInstDetails show ;show/hide
|
||||||
|
|
||||||
|
Var RemoveOldDatabases
|
||||||
|
|
||||||
!include "LanguageStrings.nsh"
|
!include "LanguageStrings.nsh"
|
||||||
!insertmacro MUI_LANGUAGE "English"
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
InstallDir "$PROGRAMFILES\${INSTALL_DIR}"
|
InstallDir "$PROGRAMFILES\${INSTALL_DIR}"
|
||||||
InstallDirRegKey HKCU "Software\${INSTALL_DIR}" ""
|
InstallDirRegKey HKCU "Software\${INSTALL_DIR}" ""
|
||||||
|
|
||||||
|
; Installation pages order
|
||||||
!insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt"
|
!insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt"
|
||||||
!insertmacro MUI_PAGE_DIRECTORY
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
;!insertmacro MUI_PAGE_COMPONENTS
|
;!insertmacro MUI_PAGE_COMPONENTS
|
||||||
|
Page custom RemoveOldFilesPage RemoveOldFilesLeave ;Custom page
|
||||||
!insertmacro MUI_PAGE_INSTFILES
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
|
||||||
|
|
||||||
@ -47,11 +51,18 @@ Section "mC2installation" main
|
|||||||
File /r "..\bin\release\resources"
|
File /r "..\bin\release\resources"
|
||||||
|
|
||||||
SetOutPath "$INSTDIR\plugins"
|
SetOutPath "$INSTDIR\plugins"
|
||||||
|
Delete "*.dll"
|
||||||
File /r "..\bin\release\plugins\*.dll"
|
File /r "..\bin\release\plugins\*.dll"
|
||||||
|
|
||||||
SetAutoClose false
|
SetAutoClose false
|
||||||
|
|
||||||
|
|
||||||
|
IntCmpU $RemoveOldDatabases 0 DoNotRemoveDBFiles
|
||||||
|
; Remove the app data
|
||||||
|
RMDir /r $APPDATA\mC2
|
||||||
|
DoNotRemoveDBFiles:
|
||||||
|
|
||||||
|
|
||||||
CreateDirectory "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}"
|
CreateDirectory "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}"
|
||||||
CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\${PROJECT_NAME}.lnk" "$INSTDIR\mC2.exe"
|
CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\${PROJECT_NAME}.lnk" "$INSTDIR\mC2.exe"
|
||||||
CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\musikServer.lnk" "$INSTDIR\musikServer.exe"
|
CreateShortCut "$SMPROGRAMS\${PROJECT_NAME} ${SUB_NAME}\musikServer.lnk" "$INSTDIR\musikServer.exe"
|
||||||
@ -72,5 +83,15 @@ Section Uninstall
|
|||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "remove_old_db.ini"
|
||||||
FunctionEnd
|
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
|
||||||
|
29
installer/remove_old_db.ini
Normal file
29
installer/remove_old_db.ini
Normal 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user