简体   繁体   中英

Unicode NSIS Installer and UAC plugin: how exchange data between Inner and Outer Instances

I want to install MSI package under user level and set several registry keys under HKLM. The second require admin level and I can done it by using NSIS::UAC plugin. But I need a way to notify InnerInstance (with admin level privilegies) about what checkboxes user selected. There are the following possible ways to exchange such information (just 1 or 0)

  • Ini file in folder which both instances can access

no success, APPDATA is different and COMMONAPPDATA require admin level, TMP is not also an option, because it depends on profile name

  • Global application variable

no success, variables didn't exists. BTW even if I run simple console, set variable and run other console - I didn't see variable

  • Write a plugin which set and get semaphore

Suppose that it is too complex for simple installation issue, but will choose it if no other option will be available

  • SyncVariable macros

!macro _SyncVariable _variable !define Lprefix L${ LINE } push $R0 goto _SyncVariableInner${Lprefix} _SyncVariableOuter${Lprefix}: StrCpy $R0 ${_variable} return _SyncVariableInner${Lprefix}: !insertmacro UAC_AsUser_Call Label _SyncVariableOuter${Lprefix} ${UAC_SYNCREGISTERS} StrCpy ${_variable} $R0 !undef Lprefix pop $R0 !macroend !define SyncVariable !insertmacro _SyncVariable

it suppose to work, but didn't

  • Get new UAC plugin - didn't see where I can get binary file, because latest version didn't support NSIS unicode build

So, can someone help me with links, thoughts?

There is no official Unicode build of NSIS, there is a forked project but the UAC plugin is not supported in this configuration and therefore does not provide a compiled DLL for it (You might be able to get a compiled version if you ask in the NSIS IRC channel).

This kind of hybrid installer is hard to get right and should not be done IMHO. If you use the Access Control plugin to give all users write access to $windir\\temp\\{yourguid} or HKLM\\Software\\{yourguid} you might be able to exchange the information but this is also a potential security hole. The same problem exists with named global kernel objects (Semaphore, memory maps etc)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM