From 9a508a53dd0f5356a5abbdf52024c193a3f90031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BERTHO?= Date: Sun, 18 Nov 2018 16:03:54 +0100 Subject: [PATCH] Add windows packaging --- generate.ps1 | 20 +++++++++++++++++++ win-setup.iss | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 generate.ps1 create mode 100644 win-setup.iss diff --git a/generate.ps1 b/generate.ps1 new file mode 100644 index 0000000..72ed305 --- /dev/null +++ b/generate.ps1 @@ -0,0 +1,20 @@ +$version="1.0" + +if (Test-Path dist\"SimplePanoramaViewer-$version-win64.exe") +{ + Remove-Item dist\"SimplePanoramaViewer-$version-win64.exe" -Force -Recurse +} +if (Test-Path dist\SimplePanoramaViewer) +{ + Remove-Item dist\SimplePanoramaViewer -Force -Recurse +} + +pandoc -i LICENSE.md -s -o LICENSE.rtf +pyinstaller SimplePanoramaViewer_folder.spec +Start-Process -FilePath "C:\Program Files (x86)\Inno Setup 5\compil32.exe" -ArgumentList "/cc", "win-setup.iss" -Wait +Remove-Item dist\SimplePanoramaViewer -Force -Recurse +Get-FileHash "dist/SimplePanoramaViewer-$version-win64-setup.exe" -Algorithm SHA512 | Select-Object -ExpandProperty Hash | Out-File "dist/SimplePanoramaViewer-$version-win64-setup.exe.sha512sum" + +pyinstaller SimplePanoramaViewer_file.spec +Rename-Item -Path "dist\SimplePanoramaViewer.exe" -NewName "SimplePanoramaViewer-$version-win64.exe" +Get-FileHash "dist/SimplePanoramaViewer-$version-win64.exe" -Algorithm SHA512 | Select-Object -ExpandProperty Hash | Out-File "dist/SimplePanoramaViewer-$version-win64.exe.sha512sum" diff --git a/win-setup.iss b/win-setup.iss new file mode 100644 index 0000000..116deac --- /dev/null +++ b/win-setup.iss @@ -0,0 +1,54 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "SimplePanoramaViewer" +#define MyAppVersion "1.0" +#define MyAppPublisher "Dalan" +#define MyAppURL "https://www.dalan.fr" +#define MyAppExeName "SimplePanoramaViewer.exe" + +[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={{FD4C50E2-6C08-4782-BC4E-77D5A575AF4C} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={pf}\{#MyAppName} +DisableProgramGroupPage=yes +LicenseFile=LICENSE.rtf +OutputBaseFilename={#MyAppName}-{#MyAppVersion}-win64-setup +OutputDir=dist +Compression=lzma +SolidCompression=yes +ArchitecturesAllowed=x64 +ArchitecturesInstallIn64BitMode=x64 + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "dist\SimplePanoramaViewer\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs + +[Icons] +Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + +[Registry] +Root: HKCR; Subkey: ".pjpg"; ValueType: string; ValueName: ""; ValueData: "PANORAMIC_IMAGE"; Flags: uninsdeletevalue +Root: HKCR; Subkey: ".pjpeg"; ValueType: string; ValueName: ""; ValueData: "PANORAMIC_IMAGE"; Flags: uninsdeletevalue +Root: HKCR; Subkey: "PANORAMIC_IMAGE"; ValueType: string; ValueName: ""; ValueData: "Panoramic image"; Flags: uninsdeletekey +Root: HKCR; Subkey: "PANORAMIC_IMAGE\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0" +Root: HKCR; Subkey: "PANORAMIC_IMAGE\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""