mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-06 18:08:53 +02:00
Added option for clean install
This commit is contained in:
parent
d346b1c68f
commit
d6ac67d221
1 changed files with 54 additions and 26 deletions
|
@ -49,7 +49,7 @@
|
||||||
Var STR_CONTAINS_VAR_3
|
Var STR_CONTAINS_VAR_3
|
||||||
Var STR_CONTAINS_VAR_4
|
Var STR_CONTAINS_VAR_4
|
||||||
Var STR_RETURN_VAR
|
Var STR_RETURN_VAR
|
||||||
|
|
||||||
Function StrContains
|
Function StrContains
|
||||||
Exch $STR_NEEDLE
|
Exch $STR_NEEDLE
|
||||||
Exch 1
|
Exch 1
|
||||||
|
@ -267,6 +267,7 @@ Var substringResult
|
||||||
|
|
||||||
"${SecName}_unchanged:"
|
"${SecName}_unchanged:"
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
;--- End of Add/Remove macros ---
|
;--- End of Add/Remove macros ---
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
@ -438,6 +439,7 @@ Var DesktopServerCheckbox
|
||||||
Var ServerStartupCheckbox
|
Var ServerStartupCheckbox
|
||||||
Var LaunchServerNowCheckbox
|
Var LaunchServerNowCheckbox
|
||||||
Var LaunchClientNowCheckbox
|
Var LaunchClientNowCheckbox
|
||||||
|
Var CleanInstallCheckbox
|
||||||
Var CurrentOffset
|
Var CurrentOffset
|
||||||
Var OffsetUnits
|
Var OffsetUnits
|
||||||
Var CopyFromProductionCheckbox
|
Var CopyFromProductionCheckbox
|
||||||
|
@ -479,23 +481,14 @@ Function PostInstallOptionsPage
|
||||||
; set the checkbox state depending on what is present in the registry
|
; set the checkbox state depending on what is present in the registry
|
||||||
!insertmacro SetPostInstallOption $DesktopClientCheckbox @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ ${BST_CHECKED}
|
!insertmacro SetPostInstallOption $DesktopClientCheckbox @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ ${BST_CHECKED}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
||||||
${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@"
|
${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@"
|
||||||
Pop $DesktopServerCheckbox
|
Pop $DesktopServerCheckbox
|
||||||
|
IntOp $CurrentOffset $CurrentOffset + 15
|
||||||
|
|
||||||
; set the checkbox state depending on what is present in the registry
|
; set the checkbox state depending on what is present in the registry
|
||||||
!insertmacro SetPostInstallOption $DesktopServerCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED}
|
!insertmacro SetPostInstallOption $DesktopServerCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED}
|
||||||
|
|
||||||
IntOp $CurrentOffset $CurrentOffset + 15
|
|
||||||
|
|
||||||
${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup"
|
|
||||||
Pop $ServerStartupCheckbox
|
|
||||||
|
|
||||||
; set the checkbox state depending on what is present in the registry
|
|
||||||
!insertmacro SetPostInstallOption $ServerStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED}
|
|
||||||
|
|
||||||
IntOp $CurrentOffset $CurrentOffset + 15
|
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
||||||
|
@ -513,15 +506,34 @@ Function PostInstallOptionsPage
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
||||||
${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @INTERFACE_HF_SHORTCUT_NAME@ after install"
|
${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @INTERFACE_HF_SHORTCUT_NAME@ after install"
|
||||||
Pop $LaunchClientNowCheckbox
|
Pop $LaunchClientNowCheckbox
|
||||||
|
IntOp $CurrentOffset $CurrentOffset + 30
|
||||||
; set the checkbox state depending on what is present in the registry
|
|
||||||
!insertmacro SetPostInstallOption $LaunchClientNowCheckbox @CLIENT_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED}
|
; set the checkbox state depending on what is present in the registry
|
||||||
${StrContains} $substringResult "/forceNoLaunchClient" $CMDLINE
|
!insertmacro SetPostInstallOption $LaunchClientNowCheckbox @CLIENT_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED}
|
||||||
${IfNot} $substringResult == ""
|
${StrContains} $substringResult "/forceNoLaunchClient" $CMDLINE
|
||||||
${NSD_SetState} $LaunchClientNowCheckbox ${BST_UNCHECKED}
|
${IfNot} $substringResult == ""
|
||||||
${EndIf}
|
${NSD_SetState} $LaunchClientNowCheckbox ${BST_UNCHECKED}
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
||||||
|
${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup"
|
||||||
|
Pop $ServerStartupCheckbox
|
||||||
|
IntOp $CurrentOffset $CurrentOffset + 15
|
||||||
|
|
||||||
|
; set the checkbox state depending on what is present in the registry
|
||||||
|
!insertmacro SetPostInstallOption $ServerStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED}
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
||||||
|
${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)"
|
||||||
|
Pop $CleanInstallCheckbox
|
||||||
|
IntOp $CurrentOffset $CurrentOffset + 15
|
||||||
|
|
||||||
|
; not saving checkbox state in registry
|
||||||
|
!insertmacro SetPostInstallOption $CleanInstallCheckbox @@ ${BST_UNCHECKED}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} @PR_BUILD@ == 1
|
${If} @PR_BUILD@ == 1
|
||||||
|
@ -543,7 +555,7 @@ Function PostInstallOptionsPage
|
||||||
|
|
||||||
${NSD_SetState} $CopyFromProductionCheckbox ${BST_CHECKED}
|
${NSD_SetState} $CopyFromProductionCheckbox ${BST_CHECKED}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
nsDialogs::Show
|
nsDialogs::Show
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
@ -558,6 +570,7 @@ Var ServerStartupState
|
||||||
Var LaunchServerNowState
|
Var LaunchServerNowState
|
||||||
Var LaunchClientNowState
|
Var LaunchClientNowState
|
||||||
Var CopyFromProductionState
|
Var CopyFromProductionState
|
||||||
|
Var CleanInstallState
|
||||||
|
|
||||||
Function ReadPostInstallOptions
|
Function ReadPostInstallOptions
|
||||||
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
||||||
|
@ -579,13 +592,18 @@ Function ReadPostInstallOptions
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
${If} ${SectionIsSelected} ${@SERVER_COMPONENT_NAME@}
|
||||||
; check if we need to launch the server post-install
|
; check if we need to launch the server post-install
|
||||||
${NSD_GetState} $LaunchServerNowCheckbox $LaunchServerNowState
|
${NSD_GetState} $LaunchServerNowCheckbox $LaunchServerNowState
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
||||||
; check if we need to launch the client post-install
|
; check if we need to launch the client post-install
|
||||||
${NSD_GetState} $LaunchClientNowCheckbox $LaunchClientNowState
|
${NSD_GetState} $LaunchClientNowCheckbox $LaunchClientNowState
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
||||||
|
; check if the user asked for a clean install
|
||||||
|
${NSD_GetState} $CleanInstallCheckbox $CleanInstallState
|
||||||
${EndIf}
|
${EndIf}
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
@ -628,6 +646,15 @@ Function HandlePostInstallOptions
|
||||||
!insertmacro WritePostInstallOption @CONSOLE_STARTUP_REG_KEY@ NO
|
!insertmacro WritePostInstallOption @CONSOLE_STARTUP_REG_KEY@ NO
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
|
${If} ${SectionIsSelected} ${@CLIENT_COMPONENT_NAME@}
|
||||||
|
; check if the user asked for a clean install
|
||||||
|
${If} $CleanInstallState == ${BST_CHECKED}
|
||||||
|
SetShellVarContext current
|
||||||
|
RMDir /r "$APPDATA\@BUILD_ORGANIZATION@"
|
||||||
|
RMDir /r "$LOCALAPPDATA\@BUILD_ORGANIZATION@"
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
${If} @PR_BUILD@ == 1
|
${If} @PR_BUILD@ == 1
|
||||||
|
|
||||||
|
@ -683,6 +710,7 @@ Function HandlePostInstallOptions
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|
Loading…
Reference in a new issue