git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27455 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2008-11-15 14:52:49 +00:00
parent fa3ea10057
commit 42fded69af
3 changed files with 21 additions and 6 deletions

View File

@ -228,7 +228,7 @@ Function .onInit
${endif} ${endif}
# printer settings, needed to install the Metafile2eps printer # printer settings, needed to install the Metafile2eps printer
!insertmacro PrinterInit !insertmacro PrinterInit # macro from InstallThirdPartyProgs.nsh
# default settings # default settings
# these can be reset to "all" in section SecAllUsers # these can be reset to "all" in section SecAllUsers

View File

@ -223,7 +223,7 @@ Function .onInit
${endif} ${endif}
# printer settings, needed to install the Metafile2eps printer # printer settings, needed to install the Metafile2eps printer
!insertmacro PrinterInit !insertmacro PrinterInit # macro from InstallThirdPartyProgs.nsh
# default settings # default settings
# these can be reset to "all" in section SecAllUsers # these can be reset to "all" in section SecAllUsers

View File

@ -112,12 +112,20 @@ FunctionEnd
#-------------------------------- #--------------------------------
!macro AppPreSuff AppPre AppSuff !macro AppPreSuff AppPre AppSuff
# the APPDATA path has always the following structure: # the APPDATA path for a local user has for WinXP and 2000 the following structure:
# C:\Documents and Settings\username\Application Data # C:\Documents and Settings\username\Application Data
# for Win Vista the structure is:
# C:\Users\username\AppData\Roaming
# this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre" # this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
# and the "Application Data" substring into the variable "AppSuff" # and the "Application Data" substring into the variable "AppSuff"
SetShellVarContext current # switch temoprarily to local user
StrCpy $String "$APPDATA" StrCpy $String "$APPDATA"
Var /GLOBAL APPDATemp
StrCpy $APPDATemp "$APPDATA"
${if} $ProductRootKey == "HKLM"
SetShellVarContext all # move back to all users
${endif}
StrCpy $Search "\" StrCpy $Search "\"
Call StrPoint # search for the first "\" Call StrPoint # search for the first "\"
IntOp $Pointer $Pointer + 1 # jump after the "\" IntOp $Pointer $Pointer + 1 # jump after the "\"
@ -125,7 +133,7 @@ FunctionEnd
StrCpy $0 $Pointer StrCpy $0 $Pointer
Call StrPoint # search for the second "\" Call StrPoint # search for the second "\"
IntOp $0 $0 + $Pointer # $0 is now the pointer to the second "\" in the APPDATA string IntOp $0 $0 + $Pointer # $0 is now the pointer to the second "\" in the APPDATA string
StrCpy ${AppPre} $APPDATA $0 # save the part before the second "\" StrCpy ${AppPre} $APPDATemp $0 # save the part before the second "\"
IntOp $Pointer $Pointer + 1 # jump after the "\" IntOp $Pointer $Pointer + 1 # jump after the "\"
StrCpy $String $String "" $Pointer # cut off the part before the second "\" StrCpy $String $String "" $Pointer # cut off the part before the second "\"
Call StrPoint # search for the third "\" Call StrPoint # search for the third "\"
@ -257,12 +265,19 @@ FunctionEnd
#-------------------------------- #--------------------------------
!macro UnAppPreSuff AppPre AppSuff !macro UnAppPreSuff AppPre AppSuff
# the APPDATA path has always the following structure: # the APPDATA path for a local user has for WinXP and 2000 the following structure:
# C:\Documents and Settings\username\Application Data # C:\Documents and Settings\username\Application Data
# for Win Vista the structure is:
# C:\Users\username\AppData\Roaming
# this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre" # this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
# and the "Application Data" substring into the variable "AppSuff" # and the "Application Data" substring into the variable "AppSuff"
SetShellVarContext current # switch temoprarily to local user
StrCpy $String "$APPDATA" StrCpy $String "$APPDATA"
StrCpy $APPDATemp "$APPDATA"
${if} $Answer == "yes" # then user has admin priviledges
SetShellVarContext all # move back to all users
${endif}
StrCpy $Search "\" StrCpy $Search "\"
Call un.StrPoint # search for the first "\" Call un.StrPoint # search for the first "\"
IntOp $Pointer $Pointer + 1 # jump after the "\" IntOp $Pointer $Pointer + 1 # jump after the "\"
@ -270,7 +285,7 @@ FunctionEnd
StrCpy $0 $Pointer StrCpy $0 $Pointer
Call un.StrPoint # search for the second "\" Call un.StrPoint # search for the second "\"
IntOp $0 $0 + $Pointer # $0 is now the pointer to the second "\" in the APPDATA string IntOp $0 $0 + $Pointer # $0 is now the pointer to the second "\" in the APPDATA string
StrCpy ${AppPre} $APPDATA $0 # save the part before the second "\" StrCpy ${AppPre} $APPDATemp $0 # save the part before the second "\"
IntOp $Pointer $Pointer + 1 # jump after the "\" IntOp $Pointer $Pointer + 1 # jump after the "\"
StrCpy $String $String "" $Pointer # cut off the part before the second "\" StrCpy $String $String "" $Pointer # cut off the part before the second "\"
Call un.StrPoint # search for the third "\" Call un.StrPoint # search for the third "\"