开发者

NSIS: Problem reading installdir by InstallDirRegKey

开发者 https://www.devze.com 2023-01-11 15:43 出处:网络
I have a nsi script which starts as following: Name \"myprog\" OutFile \"myprog.exe\" InstallDir $PROGRAMFILES32\\xx

I have a nsi script which starts as following:

Name "myprog"

OutFile "myprog.exe"

InstallDir $PROGRAMFILES32\xx

InstallDirRegKey HKLM "Software\yy\xx" "InstallDir"

RequestExecutionLevel admin

AutoCloseWindow true

BrandingText /TRIMCENTER "me"

LoadLanguageFile "${NSISDIR}\Contrib\Language files\German.nlf"

Caption "Updateprogramm"

It works fine on my dev machine, but not on production (e.g. the us开发者_StackOverflower has only readonly permissions for the registry path). It is a Win 2003 server os. Even when the registry key exists, the program tries to install in $PROGRAMFILES32\xx.


InstallDirRegKey only needs read access.

The thing troubling thing for me is that you are talking about read only, but you have "RequestExecutionLevel admin" in your script. This says to me that you require admin rights and when you have "RequestExecutionLevel admin" you also need to use UserInfo::GetAccountType (To handle < NT6 systems and Vista+ when UAC is off)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号