UAC with an app build with electron-packager


#1

Hi

I used the winreg package for my app and I need elevated privileges.

I would like to associate a manifest file with an app build with electron (atom-shell) and packaged on windows with electron-packager but I can not find any way to do it easily.

An old app of mine was made with cx_freeze and and it sufficed to put the file with the name app.exe.manifest in the same directory.

I can’t understand why it doesn’t work this time.


#2

Hi,

I solved this problem.

So first thing to know is that an external manifest won’t count if an embedded manifest is already present. (see answer to http://superuser.com/questions/905103/what-does-it-mean-to-enable-windows-to-prioritise-external-manifests)

And it turns out that the electron.exe has already a manifest embedded
and the package done with electron-package is mostly a rename of the
electron executable.

So in order to embed a news manifest with the right privileges needed, I took the manifest in the electron repo (see 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 ttps://msdn.microsoft.com/en-us/library/aa375649%28v=vs.85%29.aspx)

And tadaa !


#3

Hi Guys!
I’m developing a Remote Desktop using Electron and so i need my EXE run with System privileges.

Could you take a moment to help me!?!?! :blush:

I try to use mt.exe in order to export my manifest.xml from exe but i have this error:

cmd

My second test: try using electron packager new property :
–win32metadata.application-manifest=manifest.xml
that permits to include a new manifest.xml inside Electron App exe like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
          <requestedExecutionLevel level="requireAdministrator" uiAccess="true"/>
      </requestedPrivileges>
    </security>
  </trustInfo>    

Next, i try to run my exe using psexec but i have ths exception!

cmd2

I use Administrator privileges to run this….i need something else?

Thanks in advance!