mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-14 17:39:58 +00:00
a7594d6ca8
* Installation for all users is the default for Power Users and Administrators * For silent installation, it is possible to use the /AllUsers or /CurrentUser command line parameter to choose for which users you want to install * Updated list of supported languages. The "red" languages from http://www.lyx.org/devel/i18n.php have been removed. * Language and dictionary names are no longer in English but are translated in the language itself * One single list with language names, ISO codes and identifiers * Both the installer and uninstaller automatically detect the user interface language * Added more space in the user interface for translated texts * Added all Python encoding files so there will be no problems with future Python scripts git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@15200 a592a061-630c-0410-9148-cb99ea01b6c8
185 lines
3.4 KiB
Plaintext
185 lines
3.4 KiB
Plaintext
/*
|
|
|
|
Checks for Windows version
|
|
|
|
*/
|
|
|
|
|
|
;--------------------------------
|
|
;Macros
|
|
|
|
!macro CheckPrivileges
|
|
|
|
Push $R0
|
|
|
|
UserInfo::GetAccountType
|
|
Pop $R0
|
|
|
|
${if} $R0 == "Admin"
|
|
StrCpy $AdminOrPowerUser ${TRUE}
|
|
${elseif} $R0 == "Power"
|
|
StrCpy $AdminOrPowerUser ${TRUE}
|
|
${else}
|
|
StrCpy $AdminOrPowerUser ${FALSE}
|
|
${endif}
|
|
|
|
Pop $R0
|
|
|
|
!macroend
|
|
|
|
!macro CommandLineParameter UNINSTALL
|
|
|
|
Exch $R0
|
|
Push $R1
|
|
Push $R2
|
|
|
|
StrLen $R1 $R0
|
|
|
|
Push $CMDLINE
|
|
Push $R0
|
|
Call ${UNINSTALL}StrStr
|
|
Pop $R2
|
|
|
|
StrCpy $R2 $R2 $R1
|
|
|
|
${if} $R2 == $R0
|
|
StrCpy $R0 ${TRUE}
|
|
${else}
|
|
StrCpy $R0 ${FALSE}
|
|
${endif}
|
|
|
|
Push $R2
|
|
Push $R1
|
|
Exch $R0
|
|
|
|
!macroend
|
|
|
|
;--------------------------------
|
|
;Functions
|
|
|
|
Function CheckPrivileges
|
|
!insertmacro CheckPrivileges
|
|
FunctionEnd
|
|
|
|
Function un.CheckPrivileges
|
|
!insertmacro CheckPrivileges
|
|
FunctionEnd
|
|
|
|
Function CommandLineParameter
|
|
!insertmacro CommandLineParameter ""
|
|
FunctionEnd
|
|
|
|
Function un.CommandLineParameter
|
|
!insertmacro CommandLineParameter un.
|
|
FunctionEnd
|
|
|
|
Function CheckWindows
|
|
|
|
Push $R0
|
|
Push $R1
|
|
|
|
;Check for Windows NT 5.0 or later (2000, XP, 2003 etc.)
|
|
|
|
ReadRegStr $R0 HKLM "Software\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"
|
|
${VersionCompare} $R0 "5.0" $R1
|
|
|
|
${if} $R1 == "2"
|
|
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} only supports Windows 2000, XP, 2003 and later."
|
|
Quit
|
|
${endif}
|
|
|
|
Pop $R1
|
|
Pop $R0
|
|
|
|
FunctionEnd
|
|
|
|
Function UpdatePathEnvironment
|
|
|
|
Push $R0
|
|
Push $R1
|
|
|
|
;Updates the path environment variable of the instaler process to the latest system value
|
|
|
|
ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path
|
|
ReadRegStr $R1 HKCU "Environment" Path
|
|
|
|
System::Call 'kernel32::SetEnvironmentVariableA(t, t) i("Path", "$R0;$R1").r0'
|
|
|
|
Pop $R1
|
|
Pop $R0
|
|
|
|
FunctionEnd
|
|
|
|
Function InitInstaller
|
|
|
|
Push $R0
|
|
|
|
Push "/CurrentUser"
|
|
Call CommandLineParameter
|
|
Pop $CurrentUserInstall
|
|
|
|
${if} $CurrentUserInstall == ${TRUE}
|
|
|
|
SetShellVarContext current
|
|
|
|
${else}
|
|
|
|
${if} $AdminOrPowerUser == ${TRUE}
|
|
|
|
SetShellVarContext all
|
|
|
|
${else}
|
|
|
|
;Display an error when the /AllUsers command line parameter is used
|
|
;by a user without Administrator or Power User priviledges
|
|
|
|
Push "/AllUsers"
|
|
Call CommandLineParameter
|
|
Pop $R0
|
|
|
|
${if} $R0 == ${TRUE}
|
|
MessageBox MB_OK|MB_ICONSTOP "You need Administrator or Power User privileges to install ${APP_NAME} for all users."
|
|
Quit
|
|
${endif}
|
|
|
|
SetShellVarContext current
|
|
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
${if} ${silent}
|
|
Call InitUser
|
|
${endif}
|
|
|
|
Pop $R0
|
|
|
|
FunctionEnd
|
|
|
|
Function un.InitUnInstaller
|
|
|
|
;Set the correct shell context depending on whether LyX has been installed
|
|
;for the current user or all users
|
|
|
|
Push "/CurrentUser"
|
|
Call un.CommandLineParameter
|
|
Pop $CurrentUserInstall
|
|
|
|
${if} $CurrentUserInstall == ${TRUE}
|
|
|
|
SetShellVarContext current
|
|
|
|
${else}
|
|
|
|
${if} $AdminOrPowerUser == ${FALSE}
|
|
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} has been installed for all users. Therefore you need Administrator or Power User privileges to uninstall."
|
|
Quit
|
|
${else}
|
|
SetShellVarContext all
|
|
${endif}
|
|
|
|
${endif}
|
|
|
|
FunctionEnd
|
|
|