]> git.lyx.org Git - features.git/commitdiff
installer: fix a permission right issue
authorUwe Stöhr <uwestoehr@lyx.org>
Mon, 2 Jul 2012 21:37:15 +0000 (23:37 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Mon, 2 Jul 2012 21:37:15 +0000 (23:37 +0200)
We must prevent that LyX is installed as admin and then afterwards the same LyX version also without admin privileges.

development/Win32/packaging/installer/include/init.nsh

index fe090e156eb92141895f7e2a4bec9e59af686f75..f4cf09bf1c61d9be9af7883619ac8a6bb706e58e 100644 (file)
@@ -42,7 +42,16 @@ Function .onInit
   ${endif}
 
   # check if LyX is already installed
-  ReadRegStr $0 SHCTX "${APP_UNINST_KEY}" "Publisher"
+  ${if} $MultiUser.Privileges == "Admin"
+  ${orif} $MultiUser.Privileges == "Power"
+   ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
+  ${else}
+   ReadRegStr $0 HKCU "${APP_UNINST_KEY}" "Publisher"
+   # handle also the case that LyX is already installed in HKLM
+   ${if} $0 == ""
+    ReadRegStr $0 HKLM "${APP_UNINST_KEY}" "Publisher"
+   ${endif}
+  ${endif}
   ${if} $0 != ""
    MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
    Abort