I suppose that you use "runas" in order to get run in real administrator mode.

There are several ways to get an installer run automatically in real admin mode :

#1 : the name of the .exe must contain "setup" or "install" keyword. This make the UAC detect it as an installer and asks the user for a elevation confirmation.

#2 : the .exe must have a manifest that contains :
"""
... (I use the "python.exe.manifest" in which I add the following)
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 <security>
  <requestedPrivileges>
   <requestedExecutionLevel
    level="requireAdministrator"
    uiAccess="false"/>
  </requestedPrivileges>
 </security>
</trustInfo>
"""


I've put the manifest directly in the .exe using py2exe and :
'other_resources': [(24, 1, mymanifest)],
"24" is where the manifest should be.


#3 Maybe someone could complete here ...?


Hope this helps.



Mark Hammond a écrit :
I encounter a problem when trying to install it. I get prompted by a
secure window (a window with some keys icons) asking me if I want to
run
it with my account with(out) security against virus or with another
account.
None of the 3 possibilities works for me. Any idea ?

When you say none of the possibilities work, how exactly do they fail?

I'm sure I could extend the OS check to only attempt elevation on XP with
SP1, but it would be nice to have a better understanding of the failure
before doing that (eg, while testing this, I found Win2k also seems to
support the 'runas' ShellExecute API - but it behaves slightly differently,
and IsUserAnAdmin() isn't available.  So if it (basically) works on Win2k,
I'd be surprised it fails worse on XP without SP1.

Cheers,

Mark



_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to