使用 electron-packager 构建应用程序的 UAC 管理
UAC management for an app build with electron-packager
我为我的应用程序使用了 winreg npm 包,我需要提升权限才能使用。
我想将清单文件与使用 electron (atom-shell) 构建的应用程序相关联,并使用 electron-packager 在 windows 上打包,但我找不到任何方法来做到这一点很容易。
我的一个旧应用程序是用 cx_freeze 制作的,将名称为 app.exe.manifest 的文件放在同一目录中就足够了。
我不明白为什么这次不行。
我解决了这个问题。
所以首先要知道的是,如果嵌入式清单已经存在,则外部清单将不算数。 (参见 https://superuser.com/questions/905103/what-does-it-mean-to-enable-windows-to-prioritise-external-manifests 的回答)
结果 electron.exe 已经嵌入了清单
并且用 electron-package 完成的包主要是重命名
电子可执行文件。
因此,为了嵌入具有所需权限的新闻清单,我在电子仓库中获取了清单(参见 https://github.com/atom/electron/blob/master/atom/browser/resources/win/atom.manifest), edited the security section and used the mt.exe tool to add the new manifest (see https://msdn.microsoft.com/en-us/library/aa375649%28v=vs.85%29.aspx)
还有 tadaa !
我为我的应用程序使用了 winreg npm 包,我需要提升权限才能使用。
我想将清单文件与使用 electron (atom-shell) 构建的应用程序相关联,并使用 electron-packager 在 windows 上打包,但我找不到任何方法来做到这一点很容易。
我的一个旧应用程序是用 cx_freeze 制作的,将名称为 app.exe.manifest 的文件放在同一目录中就足够了。
我不明白为什么这次不行。
我解决了这个问题。
所以首先要知道的是,如果嵌入式清单已经存在,则外部清单将不算数。 (参见 https://superuser.com/questions/905103/what-does-it-mean-to-enable-windows-to-prioritise-external-manifests 的回答)
结果 electron.exe 已经嵌入了清单 并且用 electron-package 完成的包主要是重命名 电子可执行文件。
因此,为了嵌入具有所需权限的新闻清单,我在电子仓库中获取了清单(参见 https://github.com/atom/electron/blob/master/atom/browser/resources/win/atom.manifest), edited the security section and used the mt.exe tool to add the new manifest (see https://msdn.microsoft.com/en-us/library/aa375649%28v=vs.85%29.aspx)
还有 tadaa !