[Pkg-privacy-commits] [tails-installer] 170/210: Request Administrator privileges on Windows

Intrigeri intrigeri at moszumanska.debian.org
Wed May 24 15:26:42 UTC 2017


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to tag 3.90.0
in repository tails-installer.

commit ce27631b79798ca83a59eb2b0e3f209c329c8a44
Author: Martin Briza <mbriza at redhat.com>
Date:   Thu Sep 10 15:20:53 2015 +0200

    Request Administrator privileges on Windows
    
    This time it actually works
---
 liveusb-creator              | 10 +---------
 liveusb-creator.exe.manifest | 23 +++++++++++++++++++++++
 liveusb-creator.pyi.spec     |  3 ++-
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/liveusb-creator b/liveusb-creator
index 4085639..f1a67e3 100755
--- a/liveusb-creator
+++ b/liveusb-creator
@@ -75,6 +75,7 @@ def parse_args():
 
 def main():
     opts, args = parse_args()
+
     if sys.platform != 'win32':
         if os.getuid() != 0:
             print >> sys.stderr, _("You must run this application as root")
@@ -102,13 +103,4 @@ def main():
 
 if __name__ == '__main__':
 
-    if sys.platform == 'win32':
-        import win32com.shell.shell as shell
-        ASADMIN = 'asadmin'
-        if sys.argv[-1] != ASADMIN:
-            script = os.path.abspath(sys.argv[0])
-            params = ' '.join([script] + sys.argv[1:] + [ASADMIN])
-            shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.executable, lpParameters=params)
-            sys.exit(0)
-
     main()
diff --git a/liveusb-creator.exe.manifest b/liveusb-creator.exe.manifest
new file mode 100644
index 0000000..a94735e
--- /dev/null
+++ b/liveusb-creator.exe.manifest
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity name="liveusb-creator" processorArchitecture="x86" type="win32" version="1.0.0.0"/>
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity name="Microsoft.VC90.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" type="win32" version="9.0.21022.8"/>
+    </dependentAssembly>
+  </dependency>
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity name="Microsoft.VC90.MFC" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" type="win32" version="9.0.21022.8"/>
+    </dependentAssembly>
+  </dependency>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel
+          level="requireAdministrator"
+          uiAccess="false"/>
+        </requestedPrivileges>
+       </security>
+  </trustInfo>
+</assembly>
diff --git a/liveusb-creator.pyi.spec b/liveusb-creator.pyi.spec
index db7b51f..5f777c0 100644
--- a/liveusb-creator.pyi.spec
+++ b/liveusb-creator.pyi.spec
@@ -49,7 +49,8 @@ exe = EXE(pyz,
           debug=False,
           strip=False,
           upx=True,
-          console=True )
+          console=False,
+          manifest='liveusb-creator.exe.manifest')
 coll = COLLECT(exe,
                a.binaries,
                newqml,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git



More information about the Pkg-privacy-commits mailing list