Skip to content

Commit 934199e

Browse files
committed
Put icon on .exe
1 parent 2dcb8bb commit 934199e

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

compileExe.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
pyinstaller.exe --onefile .\sourceSDK++.py -i .\lambda.ico
1+
cd /d %~dp0
2+
pyinstaller.exe --onefile .\sourceSDK++.py --icon .\lambda.ico --add-data icons/*;icons

sourceSDK++.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def list_vpk_files(vpk_path):
905905
repo_name = "SourceSDK-"
906906

907907
# Replace this with the version of your local software
908-
local_version = "0.1.2"
908+
local_version = "0.1.3"
909909

910910
github_version = get_latest_release_version(repo_owner, repo_name)
911911

@@ -960,14 +960,15 @@ def list_vpk_files(vpk_path):
960960
root.bind("<Control-n>", handle_shortcut)
961961
root.bind("<Control-o>", handle_shortcut)
962962

963-
iconHpp = tk.PhotoImage(file=os.getcwd() + "/icons/hpp.png")
964-
iconHammer = tk.PhotoImage(file=os.getcwd() + "/icons/hammer.png")
965-
iconSource = tk.PhotoImage(file=os.getcwd() + "/icons/source.png")
966-
iconHLMV = tk.PhotoImage(file=os.getcwd() + "/icons/hlmv.png")
967-
iconQc_eyes = tk.PhotoImage(file=os.getcwd() + "/icons/qc_eyes.png")
968-
iconHlposer = tk.PhotoImage(file=os.getcwd() + "/icons/hlposer.png")
969-
iconVisualStudio = tk.PhotoImage(file=os.getcwd() + "/icons/Visual_Studio.png")
970-
iconVTFEdit = tk.PhotoImage(file=os.getcwd() + "/icons/VTFEdit.png")
963+
base_path = os.path.dirname(os.path.abspath(__file__))
964+
iconHpp = tk.PhotoImage(file=os.path.join(base_path, "icons", "hpp.png"))
965+
iconHammer = tk.PhotoImage(file=os.path.join(base_path, "icons", "hammer.png"))
966+
iconSource = tk.PhotoImage(file=os.path.join(base_path, "icons", "source.png"))
967+
iconHLMV = tk.PhotoImage(file=os.path.join(base_path, "icons", "hlmv.png"))
968+
iconQc_eyes = tk.PhotoImage(file=os.path.join(base_path, "icons", "qc_eyes.png"))
969+
iconHlposer = tk.PhotoImage(file=os.path.join(base_path, "icons", "hlposer.png"))
970+
iconVisualStudio = tk.PhotoImage(file=os.path.join(base_path, "icons", "Visual_Studio.png"))
971+
iconVTFEdit = tk.PhotoImage(file=os.path.join(base_path, "icons", "VTFEdit.png"))
971972

972973
# Start the GUI event loop
973974
root.mainloop()

0 commit comments

Comments
 (0)