Skip to content

Commit b15513e

Browse files
committed
Fix App Icon and Keep CLI Args with UAC Elevation
1 parent ccc9a28 commit b15513e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

icon.ico

87.2 KB
Binary file not shown.

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from cx_Freeze import setup, Executable
33

44
# Dependencies are automatically detected, but it might need fine tuning.
5-
build_exe_options = {"excludes": ["PyQt5.QtWebEngine"], "optimize": 2}
5+
build_exe_options = {"excludes": ["PyQt5.QtWebEngine"], "optimize": 2, "include_files": "images/"}
66

77
# GUI applications require a different base on Windows (the default is for a
88
# console application).
@@ -15,4 +15,4 @@
1515
version = "0.1.1",
1616
description = "Manager for Context Menu commands in Windows",
1717
options = {"build_exe": build_exe_options},
18-
executables = [Executable("uac_wrapper.pyw", base=base, targetName="pyWinContext.exe")])
18+
executables = [Executable("uac_wrapper.pyw", base=base, targetName="pyWinContext.exe", icon="icon.ico")])

uac_wrapper.pyw

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def run():
1212
if is_admin():
1313
return True
1414
else:
15-
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, "", None, 1)
15+
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, ' '.join(sys.argv[1:]), None, 1)
1616
sys.exit()
1717

1818
def run_as_admin(file):

0 commit comments

Comments
 (0)