简体   繁体   English

Unicode NSIS安装程序和UAC插件:内部实例和外部实例之间如何交换数据

[英]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. 我想在用户级别下安装MSI软件包,并在HKLM下设置几个注册表项。 The second require admin level and I can done it by using NSIS::UAC plugin. 第二个需要管理员级别,我可以使用NSIS :: UAC插件来完成。 But I need a way to notify InnerInstance (with admin level privilegies) about what checkboxes user selected. 但是,我需要一种方法来通知InnerInstance(具有管理员级别的特权)有关用户选择了哪些复选框的信息。 There are the following possible ways to exchange such information (just 1 or 0) 有以下几种方式可以交换此类信息(仅1或0)

  • Ini file in folder which both instances can access 两个实例都可以访问的文件夹中的Ini文件

no success, APPDATA is different and COMMONAPPDATA require admin level, TMP is not also an option, because it depends on profile name 没有成功,APPDATA不同,COMMONAPPDATA需要管理员级别,TMP也不可选,因为它取决于配置文件名称

  • 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 SyncVariable宏

!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 !macro _SyncVariable _variable!define Lprefix L $ { LINE } push $ R0转到_SyncVariableInner $ {Lprefix} _SyncVariableOuter $ {Lprefix}:StrCpy $ R0 $ {_ variable}返回_SyncVariableInner $ {Lprefix}:__ Insertmacro UAC $ {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 获取新的UAC插件-没有看到我可以在哪里获得二进制文件,因为最新版本不支持NSIS unicode构建

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). 没有NSIS的正式Unicode构建,没有分叉的项目,但此配置不支持UAC插件,因此不为其提供编译的DLL(如果您在NSIS中提出要求,则可能可以获得编译的版本IRC频道)。

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. 如果使用访问控制插件为所有用户提供对$windir\\temp\\{yourguid}HKLM\\Software\\{yourguid}写访问权限,则您可以交换信息,但这也是潜在的安全漏洞。 The same problem exists with named global kernel objects (Semaphore, memory maps etc) 命名全局内核对象(信号量,内存映射等)也存在相同的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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