Commit 66a152dd by Csók Tamás

Added install directory support

parent 7ce02b7a
......@@ -18,6 +18,7 @@
!define IconName "cloud"
!define Show_output "True"
!define Install_selenium "False"
!define DefaulLocation "$LOCALAPPDATA\CIRCLE"
;--------------------------------
;General
......@@ -36,10 +37,10 @@
SetOverwrite try
;Default installation folder
InstallDir "$LOCALAPPDATA\CIRCLE"
InstallDir "${DefaulLocation}"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\${Company} ${AppName}" ""
InstallDirRegKey HKCU "Software\${Company} ${AppName}" "install_directory"
;Request application privileges
RequestExecutionLevel admin
......@@ -66,6 +67,7 @@
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "gpl-3.0.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
;Done fuction to launch install.bat
!define MUI_PAGE_CUSTOMFUNCTION_PRE Done
......@@ -153,7 +155,7 @@ Section "Install Section" SecInstall
File /r uninstaller
;Store installation folder
WriteRegStr HKCU "Software\${Company} ${AppName}" "" $INSTDIR
WriteRegStr HKCU "Software\${Company} ${AppName}" "install_directory" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\${AppUninstaller}"
......@@ -180,7 +182,7 @@ Function .onInit
FunctionEnd
Function Done
ExecWait '"$INSTDIR\installer\install.cmd" ${Show_output} ${Install_selenium} "${AppUrl}"'
ExecWait '"$INSTDIR\installer\install.cmd" "$INSTDIR" ${Show_output} ${Install_selenium} "${AppUrl}" >"$INSTDIR\install.log" 2>"$INSTDIR\install_error.log"'
RMDir /r "$INSTDIR\installer"
FunctionEnd
......@@ -201,32 +203,71 @@ FunctionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
ExecWait '"$INSTDIR\uninstaller\uninstall.cmd" ${Show_output}'
Delete "$INSTDIR\${AppUninstaller}"
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +3
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +4
IfFileExists "$SMPROGRAMS\${Company}\Ltogasd meg a ${AppUrlName}-t.url" 0 +2
Delete "$SMPROGRAMS\${Company}\Ltogasd meg a ${AppUrlName}-t.url"
Goto +2
Goto +3
IfFileExists "$SMPROGRAMS\${Company}\Visit the ${AppUrlName}.url" 0 +2
Delete "$SMPROGRAMS\${Company}\Visit the ${AppUrlName}.url"
RMDir /r "$INSTDIR"
IfFileExists "$SMPROGRAMS\${Company}\${AppName}\*.*" 0 +2
RMDir /r "$SMPROGRAMS\${Company}\${AppName}"
DeleteRegKey /ifempty HKCU "Software\${Company} ${AppName}"
IfFileExists "$SMPROGRAMS\${Company}\*.*" +2 0
RMDir /r "$SMPROGRAMS\${Company}"
ExecWait '"$INSTDIR\uninstaller\uninstall.cmd" "$INSTDIR" ${Show_output} >"$INSTDIR\uninstall.log" 2>"$INSTDIR\uninstall_error.log"'
IfFileExists "$INSTDIR\uninstaller\*.*" 0 +2
RMDir /r "$INSTDIR\uninstaller"
IfFileExists "$INSTDIR\.rdp\*.*" 0 +2
RMDir /r "$INSTDIR\.rdp"
IfFileExists "$INSTDIR\client.log" 0 +2
Delete "$INSTDIR\client.log"
IfFileExists "$INSTDIR\cloud.py" 0 +2
Delete "$INSTDIR\cloud.py"
IfFileExists "$INSTDIR\cloud_connect_from_windows.py" 0 +2
Delete "$INSTDIR\cloud_connect_from_windows.py"
IfFileExists "$INSTDIR\nxkey.py" 0 +2
Delete "$INSTDIR\nxkey.py"
IfFileExists "$INSTDIR\OrderedDict.py" 0 +2
Delete "$INSTDIR\OrderedDict.py"
IfFileExists "$INSTDIR\putty.exe" 0 +2
Delete "$INSTDIR\putty.exe"
IfFileExists "$INSTDIR\win_install.py" 0 +2
Delete "$INSTDIR\win_install.py"
IfFileExists "$INSTDIR\windowsclasses.py" 0 +2
Delete "$INSTDIR\windowsclasses.py"
IfFileExists "$INSTDIR\windowsclasses.pyc" 0 +2
Delete "$INSTDIR\windowsclasses.pyc"
IfFileExists "$INSTDIR\${AppUninstaller}" 0 +2
Delete "$INSTDIR\${AppUninstaller}"
StrCmp $INSTDIR "${DefaulLocation}" 0 +2
RMDir /r "$INSTDIR"
SectionEnd
;--------------------------------
;Uninstaller Functions
Function un.onInit
ClearErrors
ReadRegStr $0 HKCU "Software\${Company} ${AppName}" "install_directory"
${If} ${Errors}
${IF} $INSTDIR == ""
StrCpy $INSTDIR "$LOCALAPPDATA\CIRCLE"
${ENDIF}
${Else}
${IF} $0 == ""
StrCpy $INSTDIR "$LOCALAPPDATA\CIRCLE"
${ELSE}
StrCpy $INSTDIR $0
${ENDIF}
${EndIf}
${If} ${RunningX64}
${DisableX64FSRedirection}
SetRegView 64
${EndIf}
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment