-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use PyInstaller and InnoSetup for Windows binaries (#618)
- Loading branch information
Showing
6 changed files
with
103 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[Setup] | ||
; NOTE: The value of AppId uniquely identifies this application. | ||
; Do not use the same AppId value in installers for other applications. | ||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) | ||
AppId={{8A0E36A6-DE56-46B8-BCC3-C16D1BC759CC} | ||
AppName=Universal Radio Hacker | ||
AppVersion={#MyAppVersion} | ||
VersionInfoVersion={#MyAppVersion} | ||
ArchitecturesInstallIn64BitMode=x64 | ||
UninstallDisplayName=Universal Radio Hacker | ||
AppPublisher=Johannes Pohl | ||
AppPublisherURL=https://github.com/jopohl/urh | ||
AppSupportURL=https://github.com/jopohl/urh | ||
AppUpdatesURL=https://github.com/jopohl/urh | ||
DefaultDirName={pf}\Universal Radio Hacker | ||
DisableProgramGroupPage=yes | ||
LicenseFile=..\LICENSE | ||
OutputDir=..\dist | ||
OutputBaseFilename=Universal.Radio.Hacker-{#Arch} | ||
Compression=lzma2/ultra | ||
SolidCompression=yes | ||
|
||
[Languages] | ||
Name: "english"; MessagesFile: "compiler:Default.isl" | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked | ||
|
||
[Files] | ||
Source: "..\pyinstaller\urh\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs | ||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
|
||
[Icons] | ||
Name: "{commonprograms}\Universal Radio Hacker"; Filename: "{app}\urh.exe" | ||
Name: "{commondesktop}\Universal Radio Hacker"; Filename: "{app}\urh.exe"; Tasks: desktopicon | ||
|
||
[Run] | ||
Filename: "{app}\urh.exe"; Description: "{cm:LaunchProgram,Universal Radio Hacker}"; Flags: nowait postinstall skipifsilent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
import shutil | ||
import sys | ||
from subprocess import call | ||
|
||
HIDDEN_IMPORTS = ["packaging.specifiers", "packaging.requirements", | ||
"numpy.core._methods", "numpy.core._dtype_ctypes"] | ||
DATA = [("src/urh/dev/native/lib/shared", "."), ("src/urh/plugins", "urh/plugins"), ] | ||
EXCLUDE = ["matplotlib"] | ||
|
||
cmd = ["pyinstaller"] | ||
if sys.platform == "darwin": | ||
cmd.append("--onefile") | ||
|
||
for hidden_import in HIDDEN_IMPORTS: | ||
cmd.append("--hidden-import={}".format(hidden_import)) | ||
|
||
for src, dst in DATA: | ||
cmd.append("--add-data") | ||
cmd.append('"{}{}{}"'.format(src, os.pathsep, dst)) | ||
|
||
for exclude in EXCLUDE: | ||
cmd.append("--exclude-module={}".format(exclude)) | ||
|
||
urh_path = os.path.realpath(os.path.join(os.path.dirname(__file__), "..")) | ||
cmd.append('--icon="{}"'.format(os.path.join(urh_path, "data/icons/appicon.ico"))) | ||
|
||
cmd.extend(["--distpath", "./pyinstaller"]) | ||
|
||
shutil.copy(os.path.join(urh_path, "src/urh/main.py"), os.path.join(urh_path, "src/urh/urh.py")) | ||
shutil.copy(os.path.join(urh_path, "src/urh/main.py"), os.path.join(urh_path, "src/urh/urh_debug.py")) | ||
urh_cmd = cmd + ["--windowed", os.path.join(urh_path, "src/urh/urh.py")] | ||
urh_debug_cmd = cmd + [os.path.join(urh_path, "src/urh/urh_debug.py")] | ||
cli_cmd = cmd + [os.path.join(urh_path, "src/urh/cli/urh_cli.py")] | ||
|
||
for cmd in (urh_cmd, cli_cmd, urh_debug_cmd): | ||
cmd = " ".join(cmd) | ||
print(cmd) | ||
sys.stdout.flush() | ||
call(cmd, shell=True) | ||
|
||
shutil.copy("./pyinstaller/urh_cli/urh_cli.exe", "./pyinstaller/urh/urh_cli.exe") | ||
shutil.copy("./pyinstaller/urh_debug/urh_debug.exe", "./pyinstaller/urh/urh_debug.exe") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
VERSION = "2.5.5" | ||
|
||
if __name__ == '__main__': | ||
# To read out version easy on command line for InnoSetup | ||
print(VERSION) |