Commit cf9dd786 by Csók Tamás

Added install directory support

parent c3deebfc
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
!define IconName "cloud" !define IconName "cloud"
!define Show_output "True" !define Show_output "True"
!define Install_selenium "False" !define Install_selenium "False"
!define DefaulLocation "$LOCALAPPDATA\CIRCLE"
;-------------------------------- ;--------------------------------
;General ;General
...@@ -36,10 +37,10 @@ ...@@ -36,10 +37,10 @@
SetOverwrite try SetOverwrite try
;Default installation folder ;Default installation folder
InstallDir "$LOCALAPPDATA\CIRCLE" InstallDir "${DefaulLocation}"
;Get installation folder from registry if available ;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\${Company} ${AppName}" "" InstallDirRegKey HKCU "Software\${Company} ${AppName}" "install_directory"
;Request application privileges ;Request application privileges
RequestExecutionLevel admin RequestExecutionLevel admin
...@@ -66,6 +67,7 @@ ...@@ -66,6 +67,7 @@
;-------------------------------- ;--------------------------------
;Pages ;Pages
!insertmacro MUI_PAGE_LICENSE "gpl-3.0.txt" !insertmacro MUI_PAGE_LICENSE "gpl-3.0.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
;Done fuction to launch install.bat ;Done fuction to launch install.bat
!define MUI_PAGE_CUSTOMFUNCTION_PRE Done !define MUI_PAGE_CUSTOMFUNCTION_PRE Done
...@@ -153,7 +155,7 @@ Section "Install Section" SecInstall ...@@ -153,7 +155,7 @@ Section "Install Section" SecInstall
File /r uninstaller File /r uninstaller
;Store installation folder ;Store installation folder
WriteRegStr HKCU "Software\${Company} ${AppName}" "" $INSTDIR WriteRegStr HKCU "Software\${Company} ${AppName}" "install_directory" $INSTDIR
;Create uninstaller ;Create uninstaller
WriteUninstaller "$INSTDIR\${AppUninstaller}" WriteUninstaller "$INSTDIR\${AppUninstaller}"
...@@ -180,7 +182,7 @@ Function .onInit ...@@ -180,7 +182,7 @@ Function .onInit
FunctionEnd FunctionEnd
Function Done 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" RMDir /r "$INSTDIR\installer"
FunctionEnd FunctionEnd
...@@ -201,32 +203,71 @@ FunctionEnd ...@@ -201,32 +203,71 @@ FunctionEnd
;-------------------------------- ;--------------------------------
;Uninstaller Section ;Uninstaller Section
Section "Uninstall" Section "Uninstall"
ExecWait '"$INSTDIR\uninstaller\uninstall.cmd" ${Show_output}' StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +4
IfFileExists "$SMPROGRAMS\${Company}\Ltogasd meg a ${AppUrlName}-t.url" 0 +2
Delete "$INSTDIR\${AppUninstaller}"
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +3
Delete "$SMPROGRAMS\${Company}\Ltogasd meg a ${AppUrlName}-t.url" 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" Delete "$SMPROGRAMS\${Company}\Visit the ${AppUrlName}.url"
RMDir /r "$INSTDIR" IfFileExists "$SMPROGRAMS\${Company}\${AppName}\*.*" 0 +2
RMDir /r "$SMPROGRAMS\${Company}\${AppName}" 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 SectionEnd
;-------------------------------- ;--------------------------------
;Uninstaller Functions ;Uninstaller Functions
Function un.onInit 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} ${If} ${RunningX64}
${DisableX64FSRedirection} ${DisableX64FSRedirection}
SetRegView 64 SetRegView 64
${EndIf} ${EndIf}
!insertmacro MUI_UNGETLANGUAGE !insertmacro MUI_UNGETLANGUAGE
FunctionEnd 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