|
|
|
|
#1 |
|
Member
Join Date: Sep 2005
Location: Sitting next to my desk
Posts: 56
|
UAC Plugin: Can not create example uac_dualmode.nsi
At the moment I'm playing this the UAC plugin. If I create the uac_dualmode.nsi example I get the followed error:
!system: returned 0 !system: ""C:\Users\xxx\AppData\Local\Temp\nst3384.tmp"" !system: returned 0 File: "C:\Users\xxx\AppData\Local\Temp\nst3384.tmp.un" -> no files found. The file nst3384.tmp.un really does not exist. I try to create the installer on a Win7 x64 system. What may be the problem? This signature is currently on vacation! |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2007
Posts: 672
|
|
|
|
|
|
|
#3 |
|
Member
Join Date: Sep 2005
Location: Sitting next to my desk
Posts: 56
|
Found out the problem, seems the tmp file has to be executed and per default a tmp file could not be executed, my problem is now fixed.
This signature is currently on vacation! |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jun 2015
Posts: 2
|
I'm trying to create a DualMode installer. I've been trying to hack the example script to work without running NSIS as administrator as I intend to use TeamCity as building platform.
Looks like I fail to grasp what happens when the DualMode uninstaller is built, as after hours of testing I am not closer at even running the example without admin, not to speak about using the UAC plugin with the current installer. The software can be run without administrator privileges, but there are some advantages in installing to program files, so if the user can upgrade his/her credentials this would be the proper thing to do. However I want to keep the possibility to install without admins, thus the attempt with the UAC_DualMode.nsi. Any help would be appreciated. A related sidenote (which may help some others): by checking at installation time if the user has administrator privileges (with UserInfo::GetAccountType), you can write the uninstall reg info to HKLM, which will cause Windows to run the uninstaller as Administrator by default. (and otherwise to HKCU) This helps in simplifying the uninstallation. (unfortunately there doesn't seem to be any way to check if you are admin before setting InstallDirRegKey , so there is extra work ahead.) |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
I don't have the energy to really deal with the UAC plugin anymore so you should probably consider it abandoned. Anyway, you don't really upgrade your credentials, the UAC plugin tries to keep your original credentials before using UAC to elevate to administrator and there are actually two instances of your installer running at the same time.
I would advise you to not use this plugin and simply create a custom page with two radio buttons, one for current user and one for all users. Disable the second radio button if UserInfo::GetAccountType is not admin. When the user clicks next you use SetShellVarContext to set the install type and the code that writes the uninstall information into the registry just uses the ShCtx root key. You should also set $InstDir to $ProgramFiles\YourApp or $LocalAppData\Programs\YourApp when leaving that page (it should come before the directory page). To properly uninstall you need to save the SetShellVarContext state somewhere so you can set the correct ShCtx in the uninstaller... IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jun 2015
Posts: 2
|
Thank you very much. I did finally end up using the UAC plugin after I realized that the only problem with the example was with building the uninstaller.
I guess I may end up with the problem once I'll try to generate a signed uninstaller, as Windows 8 does not seem to enjoy executing .tmp files in user mode. ( I tried to use http://www.compdigitec.com/labs/2011...s-executables/ but failed. Might try later with better debugging, as could have been a problem with incorrectly used variables. I did try to replace \s with \\s) Thanks also for the SetShellVarContext reminder, need to use it properly. However reading the previous install path is a bit problematic as the user might or might not have installed with admins, and apparently using variables is not an option with the InstallDirRegKey. I guess the most robust way would be to write the installpath to both HKLM and HKCU and check that some file (such as uninstaller) exists there.. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|