1
0
Fork 0

Fix windows NSIS client package

This commit is contained in:
Wilfried Goesgens 2016-08-30 10:57:41 +02:00
parent 84b164b985
commit 0601cc2661
1 changed files with 23 additions and 30 deletions

View File

@ -1,4 +1,5 @@
; CPack install script designed for a nmake build ; CPack install script designed for a nmake build
; TODO !addplugindir '@CPACK_PLUGIN_PATH@/AccessControl/Plugins'
;-------------------------------- ;--------------------------------
; Include LogicLib for more readable code ; Include LogicLib for more readable code
@ -484,14 +485,10 @@ FunctionEnd
;-------------------------------- ;--------------------------------
;Pages ;Pages
!define MUI_PAGE_CUSTOMFUNCTION_PRE skip_page
!insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_PRE skip_page
!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
Page custom InstallOptionsPage skip_page
!define MUI_PAGE_CUSTOMFUNCTION_PRE default_installation_directory !define MUI_PAGE_CUSTOMFUNCTION_PRE default_installation_directory
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE check_installation_directory !define MUI_PAGE_CUSTOMFUNCTION_LEAVE check_installation_directory
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
@ -709,7 +706,6 @@ displayAgain:
StrCmp $PASSWORD $PASSWORD_AGAIN +3 0 StrCmp $PASSWORD $PASSWORD_AGAIN +3 0
MessageBox MB_OK|MB_ICONSTOP "Passwords don't match, try again" MessageBox MB_OK|MB_ICONSTOP "Passwords don't match, try again"
Goto displayAgain Goto displayAgain
done:
Pop ${TEMP1} Pop ${TEMP1}
Return Return
@ -725,20 +721,17 @@ FunctionEnd
Function default_installation_directory Function default_installation_directory
; Read variables which defines if arango should be installed as Service ; Read variables which defines if arango should be installed as Service
!insertmacro MUI_INSTALLOPTIONS_READ $R2 "NSIS.InstallOptions.ini" "Field 2" "State" !insertmacro MUI_INSTALLOPTIONS_READ $R2 "NSIS.InstallOptions.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R3 "NSIS.InstallOptions.ini" "Field 3" "State" !insertmacro MUI_INSTALLOPTIONS_READ $R3 "NSIS.InstallOptions.ini" "Field 3" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R4 "NSIS.InstallOptions.ini" "Field 4" "State" !insertmacro MUI_INSTALLOPTIONS_READ $R4 "NSIS.InstallOptions.ini" "Field 4" "State"
${If} $R3 == '1' ${If} $R3 == '1'
StrCpy $TRI_INSTALL_TYPE 'AllUsers' StrCpy $TRI_INSTALL_TYPE 'AllUsers'
${EndIf}
${If} $R4 == '1'
StrCpy $TRI_INSTALL_TYPE 'SingleUser'
${EndIf}
Call read_options
${EndIf} ${EndIf}
${If} $R4 == '1'
StrCpy $TRI_INSTALL_TYPE 'SingleUser'
${EndIf}
${Switch} $TRI_INSTALL_TYPE ${Switch} $TRI_INSTALL_TYPE
${Case} 'SingleUser' ${Case} 'SingleUser'
@ -750,25 +743,25 @@ Function default_installation_directory
Return Return
FunctionEnd FunctionEnd
Function assign_proper_access_rigths ; TODO Function assign_proper_access_rights
StrCpy $0 "0" ; TODO StrCpy $0 "0"
AccessControl::GrantOnFile \ ; TODO AccessControl::GrantOnFile \
"$INSTDIR" "(BU)" "GenericRead + GenericWrite + GenericExecute" ; TODO "$INSTDIR" "(BU)" "GenericRead + GenericWrite + GenericExecute"
Pop $R0 ; TODO Pop $R0
${If} $R0 == error ; TODO ${If} $R0 == error
Pop $R0 ; TODO Pop $R0
StrCpy $0 "1" ; TODO StrCpy $0 "1"
DetailPrint `AccessControl error: $R0` ; TODO DetailPrint `AccessControl error: $R0`
; MessageBox MB_OK "target directory $INSTDIR can not get cannot get correct access rigths" ; TODO ; MessageBox MB_OK "target directory $INSTDIR can not get cannot get correct access rigths"
${EndIf} ; TODO ${EndIf}
FunctionEnd ; TODO FunctionEnd
Function is_writable Function is_writable
; is does not matter if we do some errors here ; is does not matter if we do some errors here
${If} $TRI_INSTALL_ALL_USERS == '1' ${If} $TRI_INSTALL_ALL_USERS == '1'
CreateDirectory $INSTDIR CreateDirectory $INSTDIR
Call assign_proper_access_rigths ; TODO Call assign_proper_access_rights
${EndIf} ${EndIf}
FunctionEnd FunctionEnd
Function check_installation_directory Function check_installation_directory