2022-07-11 20:34:05 -05:00
|
|
|
!include LogicLib.nsh
|
|
|
|
|
2022-07-20 04:00:16 -05:00
|
|
|
Var PerUser
|
|
|
|
Var AllUser
|
2022-07-11 20:34:05 -05:00
|
|
|
|
2022-07-20 04:00:16 -05:00
|
|
|
Function uninstallSymphony
|
|
|
|
StrCpy $0 0
|
2022-07-11 20:34:05 -05:00
|
|
|
SetRegView 64
|
2022-07-20 04:00:16 -05:00
|
|
|
loop:
|
|
|
|
EnumRegKey $1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $0
|
|
|
|
StrCmp $1 "" done
|
|
|
|
ReadRegStr $2 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1" "DisplayName"
|
|
|
|
${If} $2 == "Symphony"
|
|
|
|
ReadRegStr $3 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$1" "UninstallString"
|
|
|
|
ExecWait '$3 /qn'
|
|
|
|
${EndIf}
|
|
|
|
IntOp $0 $0 + 1
|
|
|
|
Goto loop
|
|
|
|
done:
|
|
|
|
FunctionEnd
|
|
|
|
|
2022-08-09 20:02:52 -05:00
|
|
|
!macro copySystemGlobalConfig
|
|
|
|
IfFileExists $PROGRAMFILES64\Symphony\Symphony\config\Symphony.config 0 +2
|
|
|
|
CopyFiles /SILENT $PROGRAMFILES64\Symphony\Symphony\config\Symphony.config $WINDIR\Temp\temp-sys-Symphony.config
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro copyLocalGlobalConfig
|
2022-10-05 21:47:59 -05:00
|
|
|
IfFileExists $LOCALAPPDATA\Programs\Symphony\Symphony\config\Symphony.config 0 +2
|
2022-11-08 07:15:34 -06:00
|
|
|
CopyFiles /SILENT $LOCALAPPDATA\Programs\Symphony\Symphony\config\Symphony.config $LOCALAPPDATA\Temp\temp-local-Symphony.config
|
2022-08-09 20:02:52 -05:00
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro replaceSystemGlobalConfig
|
|
|
|
IfFileExists $WINDIR\Temp\temp-sys-Symphony.config 0 +2
|
|
|
|
CopyFiles /SILENT $WINDIR\Temp\temp-sys-Symphony.config $PROGRAMFILES64\Symphony\Symphony\config\Symphony.config
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro replaceLocalGlobalConfig
|
2022-11-08 07:15:34 -06:00
|
|
|
IfFileExists $LOCALAPPDATA\Temp\temp-local-Symphony.config 0 +2
|
|
|
|
CopyFiles /SILENT $LOCALAPPDATA\Temp\temp-local-Symphony.config $LOCALAPPDATA\Programs\Symphony\Symphony\config\Symphony.config
|
2022-08-09 20:02:52 -05:00
|
|
|
!macroend
|
|
|
|
|
2022-07-20 04:00:16 -05:00
|
|
|
!macro bothM
|
2023-04-05 07:11:57 -05:00
|
|
|
MessageBox MB_OK "Auto update not supported as there are two versions installed"
|
2022-07-20 04:00:16 -05:00
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro perUserM
|
2022-08-09 20:02:52 -05:00
|
|
|
!insertmacro copyLocalGlobalConfig
|
2022-07-20 04:00:16 -05:00
|
|
|
Call uninstallSymphony
|
|
|
|
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LOCALAPPDATA\Programs\Symphony\Symphony"
|
|
|
|
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LOCALAPPDATA\Programs\Symphony\Symphony"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro allUserM
|
|
|
|
${IfNot} ${UAC_IsAdmin}
|
|
|
|
ShowWindow $HWNDPARENT ${SW_HIDE}
|
|
|
|
!insertmacro UAC_RunElevated
|
|
|
|
Quit
|
|
|
|
${endif}
|
2022-08-09 20:02:52 -05:00
|
|
|
!insertmacro copySystemGlobalConfig
|
2022-07-20 04:00:16 -05:00
|
|
|
Call uninstallSymphony
|
2022-07-11 20:34:05 -05:00
|
|
|
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$PROGRAMFILES64\Symphony\Symphony"
|
|
|
|
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$PROGRAMFILES64\Symphony\Symphony"
|
2022-07-20 04:00:16 -05:00
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro abortM
|
|
|
|
; MessageBox MB_OK "Something went wrong!! Could not find existing SDA"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro validateInstallation
|
|
|
|
IfFileExists $PROGRAMFILES64\Symphony\Symphony\Symphony.exe 0 +2
|
|
|
|
StrCpy $AllUser "exists"
|
|
|
|
|
|
|
|
IfFileExists $LOCALAPPDATA\Programs\Symphony\Symphony\Symphony.exe 0 +2
|
|
|
|
StrCpy $PerUser "exists"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro preInit
|
|
|
|
!insertmacro validateInstallation
|
|
|
|
${If} $PerUser == "exists"
|
|
|
|
${AndIf} $AllUser == "exists"
|
|
|
|
!insertmacro bothM
|
|
|
|
${ElseIf} $PerUser == "exists"
|
|
|
|
!insertmacro perUserM
|
|
|
|
${ElseIf} $AllUser == "exists"
|
|
|
|
!insertmacro allUserM
|
|
|
|
${Else}
|
|
|
|
!insertmacro abortM
|
|
|
|
${EndIf}
|
|
|
|
!macroend
|
|
|
|
|
2022-08-09 20:02:52 -05:00
|
|
|
!macro customInstall
|
|
|
|
${If} $PerUser == "exists"
|
|
|
|
!insertmacro replaceLocalGlobalConfig
|
|
|
|
${ElseIf} $AllUser == "exists"
|
|
|
|
!insertmacro replaceSystemGlobalConfig
|
|
|
|
${Else}
|
|
|
|
!insertmacro abortM
|
|
|
|
${EndIf}
|
|
|
|
!macroend
|
|
|
|
|
2022-07-20 04:00:16 -05:00
|
|
|
!macro customUnInit
|
|
|
|
!insertmacro validateInstallation
|
|
|
|
${If} $AllUser == "exists"
|
|
|
|
${IfNot} ${UAC_IsAdmin}
|
|
|
|
ShowWindow $HWNDPARENT ${SW_HIDE}
|
|
|
|
!insertmacro UAC_RunElevated
|
|
|
|
Quit
|
|
|
|
${endif}
|
|
|
|
${EndIf}
|
2022-07-11 20:34:05 -05:00
|
|
|
!macroend
|