mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-3589 (Fix issues with All user installations) (#1456)
* SDA-3589 - Fix installer.nsh script * SDA-3589 - Fix import position * SDA-3589 - No UI installer * SDA-3589 - Remove abort for now * SDA-3589 - Disable abort script * SDA-3589 - Fix all user installation * SDA-3589 - sign nsis exe file * SDA-3589 - Remove cloud 9 extra dir
This commit is contained in:
@@ -1,26 +1,82 @@
|
||||
!include LogicLib.nsh
|
||||
|
||||
; Uninstall existing Symphony before installing a new version
|
||||
!macro uninstallSymphony
|
||||
StrCpy $0 0
|
||||
SetRegView 64
|
||||
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:
|
||||
Var PerUser
|
||||
Var AllUser
|
||||
|
||||
Function uninstallSymphony
|
||||
StrCpy $0 0
|
||||
SetRegView 64
|
||||
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
|
||||
|
||||
!macro bothM
|
||||
MessageBox MB_OK "Auto update not supported as there is two version installed"
|
||||
!macroend
|
||||
|
||||
; Preinstall script
|
||||
!macro preInit
|
||||
SetRegView 64
|
||||
!insertmacro uninstallSymphony
|
||||
!macro perUserM
|
||||
Call uninstallSymphony
|
||||
Sleep 10000
|
||||
SetRegView 64
|
||||
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}
|
||||
Call uninstallSymphony
|
||||
Sleep 10000
|
||||
SetRegView 64
|
||||
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$PROGRAMFILES64\Symphony\Symphony"
|
||||
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$PROGRAMFILES64\Symphony\Symphony"
|
||||
!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
|
||||
|
||||
!macro customUnInit
|
||||
!insertmacro validateInstallation
|
||||
${If} $AllUser == "exists"
|
||||
${IfNot} ${UAC_IsAdmin}
|
||||
ShowWindow $HWNDPARENT ${SW_HIDE}
|
||||
!insertmacro UAC_RunElevated
|
||||
Quit
|
||||
${endif}
|
||||
${EndIf}
|
||||
!macroend
|
||||
Reference in New Issue
Block a user