From 41ace3a9e53b52b4271554d7aedd88d533ee5f5e Mon Sep 17 00:00:00 2001 From: rejbasket <39080670+rejbasket@users.noreply.github.com> Date: Wed, 8 Dec 2021 22:18:41 +0100 Subject: add macOS and windows installer (#1352) --- installer_scripts/electron-entitlements.plist | 10 ++++ installer_scripts/entitlements.plist | 12 ++++ installer_scripts/inkstitch.plist | 18 ++++++ installer_scripts/scripts/postinstall | 5 ++ installer_scripts/scripts/preinstall | 11 ++++ installer_scripts/template.iss | 84 +++++++++++++++++++++++++++ 6 files changed, 140 insertions(+) create mode 100644 installer_scripts/electron-entitlements.plist create mode 100644 installer_scripts/entitlements.plist create mode 100644 installer_scripts/inkstitch.plist create mode 100755 installer_scripts/scripts/postinstall create mode 100755 installer_scripts/scripts/preinstall create mode 100755 installer_scripts/template.iss (limited to 'installer_scripts') diff --git a/installer_scripts/electron-entitlements.plist b/installer_scripts/electron-entitlements.plist new file mode 100644 index 00000000..9b6c3eb6 --- /dev/null +++ b/installer_scripts/electron-entitlements.plist @@ -0,0 +1,10 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.debugger + + + diff --git a/installer_scripts/entitlements.plist b/installer_scripts/entitlements.plist new file mode 100644 index 00000000..f0b6f5b0 --- /dev/null +++ b/installer_scripts/entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-library-validation + + + diff --git a/installer_scripts/inkstitch.plist b/installer_scripts/inkstitch.plist new file mode 100644 index 00000000..8d102d1f --- /dev/null +++ b/installer_scripts/inkstitch.plist @@ -0,0 +1,18 @@ + + + + + + BundleHasStrictIdentifier + + BundleIsRelocatable + + BundleIsVersionChecked + + BundleOverwriteAction + install + RootRelativeBundlePath + Contents/MacOS/electron/inkstitch-gui.app + + + diff --git a/installer_scripts/scripts/postinstall b/installer_scripts/scripts/postinstall new file mode 100755 index 00000000..687f5149 --- /dev/null +++ b/installer_scripts/scripts/postinstall @@ -0,0 +1,5 @@ +#!/bin/bash +set -e +mv /tmp/inkstitch/ $HOME/Library/Application\ Support/org.inkscape.Inkscape/config/inkscape/extensions/ +echo "Inkstitch was moved!" +exit 0 diff --git a/installer_scripts/scripts/preinstall b/installer_scripts/scripts/preinstall new file mode 100755 index 00000000..40187fb3 --- /dev/null +++ b/installer_scripts/scripts/preinstall @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +inkstitch_folder=($HOME/Library/Application\ Support/org.inkscape.Inkscape/config/inkscape/extensions/inkstitch) +if [[ -L "${inkstitch_folder}" ]]; then + unlink "${inkstitch_folder}" + echo "Unlinking manual install, to avoid damaging user local repository." +else + rm -rf "${inkstitch_folder}" + echo "Removing previous Ink/Stitch installation." +fi +exit 0 diff --git a/installer_scripts/template.iss b/installer_scripts/template.iss new file mode 100755 index 00000000..a949a419 --- /dev/null +++ b/installer_scripts/template.iss @@ -0,0 +1,84 @@ +#define PROGRAMNAME "Ink/Stitch" +;inkstitch-version +#define AppId "org.inkstitch.app" +#define MyAppPublisher "Inkstitch Open Source Community" +#define URL "https://inkstitch.org/" +;inkstitch-year +#define PATHTODIST "..\dist" +#define INXPATH "..\inx" +[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.) + +LanguageDetectionMethod=uilanguage +;AppId={{C78E6C6F-C47E-4319-AF5A-E71387AE2D4E} +AppId={#AppId} +AppName={#PROGRAMNAME} +AppVersion={#VERSION} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisherURL={#URL} +AppSupportURL={#URL} +AppUpdatesURL={#URL} +DefaultDirName={userappdata}\inkscape\extensions\ +DefaultGroupName={#PROGRAMNAME} +; Remove the following line to run in administrative install mode (install for all users.) +ArchitecturesAllowed=x64 +PrivilegesRequired=lowest +OutputBaseFilename=inkstitch +OutputDir=. +Compression=lzma +SolidCompression=yes +VersionInfoCompany={#URL} +VersionInfoCopyright=Copyright (C) {#COPYRIGHT} +VersionInfoDescription=An open-source machine embroidery design platform based on Inkscape. +VersionInfoTextVersion={#VERSION} +WizardStyle=modern +ShowLanguageDialog=no + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl" +Name: "brazilian"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" +Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" +Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl" +Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" +Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" +Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" +Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl" +Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" +Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" +Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" +Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" +Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" +Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" +Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl" +Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" +Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" +Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" +Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" +Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" + +[Types] +Name: "English"; Description: "English"; + +[Files] +Source: "{#PATHTODIST}\inkstitch\*"; DestDir: "{app}\inkstitch\inkstitch"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files +[Code] + +function InitializeSetup(): Boolean; +begin + Result := True; + if RegKeyExists(HKEY_LOCAL_MACHINE, + 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppId}_is1') or + RegKeyExists(HKEY_CURRENT_USER, + 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppId}_is1') then + begin + MsgBox('The application is installed already.', mbInformation, MB_OK); + Result := False; + end; +end; + -- cgit v1.2.3