]> git.lyx.org Git - features.git/commitdiff
installer: fix http://bugzilla.lyx.org/show_bug.cgi?id=5506
authorUwe Stöhr <uwestoehr@web.de>
Sat, 15 Nov 2008 14:52:49 +0000 (14:52 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sat, 15 Nov 2008 14:52:49 +0000 (14:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27455 a592a061-630c-0410-9148-cb99ea01b6c8

development/Win32/packaging/AltInstaller/LyXInstaller-complete.nsi
development/Win32/packaging/AltInstaller/LyXInstaller-small.nsi
development/Win32/packaging/AltInstaller/LyXUtils.nsh

index de9c2079348feb45a08d18aacf06dd438e5f390c..8a9848cd40c1465b61eb758458080ca7d770cd08 100644 (file)
@@ -228,7 +228,7 @@ Function .onInit
   ${endif}
   
   # printer settings, needed to install the Metafile2eps printer
-  !insertmacro PrinterInit
+  !insertmacro PrinterInit # macro from InstallThirdPartyProgs.nsh
 
   # default settings
   # these can be reset to "all" in section SecAllUsers
index 4a1b84834c361fcb1361329c32367f117c4a7ff6..ee35e3210d050b9e7efca3c21981a535519dcb68 100644 (file)
@@ -223,7 +223,7 @@ Function .onInit
   ${endif}
   
   # printer settings, needed to install the Metafile2eps printer
-  !insertmacro PrinterInit
+  !insertmacro PrinterInit # macro from InstallThirdPartyProgs.nsh
 
   # default settings
   # these can be reset to "all" in section SecAllUsers
index 1bb951e2eba1aac4bce1e6bd026477318b48858d..eee2b1908b5a7c71800c32fa1aaa7153e87f3cd7 100644 (file)
@@ -112,12 +112,20 @@ FunctionEnd
 #--------------------------------
 
 !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
+ # for Win Vista the structure is:
+ # C:\Users\username\AppData\Roaming
  # this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
  # and the "Application Data" substring into the variable "AppSuff"
   
+  SetShellVarContext current # switch temoprarily to local user
   StrCpy $String "$APPDATA"
+  Var /GLOBAL APPDATemp
+  StrCpy $APPDATemp "$APPDATA"
+  ${if} $ProductRootKey == "HKLM"
+   SetShellVarContext all # move back to all users
+  ${endif}
   StrCpy $Search "\"
   Call StrPoint # search for the first "\"
   IntOp $Pointer $Pointer + 1 # jump after the "\"
@@ -125,7 +133,7 @@ FunctionEnd
   StrCpy $0 $Pointer
   Call StrPoint # search for the second "\"
   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 "\"
   StrCpy $String $String "" $Pointer # cut off the part before the second "\"
   Call StrPoint # search for the third "\"
@@ -257,12 +265,19 @@ FunctionEnd
 #--------------------------------
 
 !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
+ # for Win Vista the structure is:
+ # C:\Users\username\AppData\Roaming
  # this macro saves the "C:\Documents and Settings\" substring into the variable "AppPre"
  # and the "Application Data" substring into the variable "AppSuff"
   
+  SetShellVarContext current # switch temoprarily to local user
   StrCpy $String "$APPDATA"
+  StrCpy $APPDATemp "$APPDATA"
+  ${if} $Answer == "yes" # then user has admin priviledges
+   SetShellVarContext all # move back to all users
+  ${endif}
   StrCpy $Search "\"
   Call un.StrPoint # search for the first "\"
   IntOp $Pointer $Pointer + 1 # jump after the "\"
@@ -270,7 +285,7 @@ FunctionEnd
   StrCpy $0 $Pointer
   Call un.StrPoint # search for the second "\"
   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 "\"
   StrCpy $String $String "" $Pointer # cut off the part before the second "\"
   Call un.StrPoint # search for the third "\"