3 Installer and uninstaller initialization
\r
7 ;--------------------------------
\r
10 Function CommandLineParameter
\r
28 StrCpy $R0 ${FALSE}
\r
40 Banner::show /NOUNLOAD "Checking system"
\r
43 ;Check all dependencies
\r
46 Call CheckPrivileges
\r
58 Call un.CheckPrivileges
\r
59 Call un.LoadUnInstaller
\r
63 Function LoadInstaller
\r
65 ;Set the correct shell context depending on command line parameter
\r
71 Call CommandLineParameter
\r
72 Pop $CurrentUserInstall
\r
74 ${if} $CurrentUserInstall == ${TRUE}
\r
76 SetShellVarContext current
\r
80 ${if} $AdminOrPowerUser == ${TRUE}
\r
82 SetShellVarContext all
\r
86 ;Display an error when the /AllUsers command line parameter is used
\r
87 ;by a user without Administrator or Power User priviledges
\r
90 Call CommandLineParameter
\r
93 ${if} $R0 == ${TRUE}
\r
94 MessageBox MB_OK|MB_ICONSTOP "You need Administrator or Power User privileges to install ${APP_NAME} for all users."
\r
98 SetShellVarContext current
\r
99 StrCpy $CurrentUserInstall ${TRUE}
\r
113 Function un.LoadUnInstaller
\r
115 ;Set the correct shell context depending on whether LyX has been installed
\r
116 ;for the current user or all users
\r
118 ReadRegStr $R0 HKCU ${APP_REGKEY} ""
\r
120 ${if} $R0 == $INSTDIR
\r
121 StrCpy $CurrentUserInstall ${TRUE}
\r
124 ${if} $CurrentUserInstall == ${TRUE}
\r
126 SetShellVarContext current
\r
130 ${if} $AdminOrPowerUser == ${FALSE}
\r
131 MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} has been installed for all users. Therefore you need Administrator or Power User privileges to uninstall."
\r
134 SetShellVarContext all
\r