summaryrefslogtreecommitdiff
path: root/installer_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'installer_scripts')
-rw-r--r--installer_scripts/electron-entitlements.plist10
-rw-r--r--installer_scripts/entitlements.plist12
-rwxr-xr-xinstaller_scripts/file_version_info.txt40
-rw-r--r--installer_scripts/inkstitch.plist18
-rwxr-xr-xinstaller_scripts/scripts/postinstall5
-rwxr-xr-xinstaller_scripts/scripts/preinstall35
-rwxr-xr-xinstaller_scripts/template.iss130
7 files changed, 250 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>com.apple.security.cs.allow-jit</key>
+ <true/>
+ <key>com.apple.security.cs.debugger</key>
+ <true/>
+ </dict>
+</plist>
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.security.cs.allow-jit</key>
+ <true/>
+ <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
+ <true/>
+ <key>com.apple.security.cs.disable-library-validation</key>
+ <true/>
+</dict>
+</plist>
diff --git a/installer_scripts/file_version_info.txt b/installer_scripts/file_version_info.txt
new file mode 100755
index 00000000..4b912e23
--- /dev/null
+++ b/installer_scripts/file_version_info.txt
@@ -0,0 +1,40 @@
+VSVersionInfo(
+ ffi=FixedFileInfo(
+ # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
+ # Set not needed items to zero 0.
+ filevers=(3, 2, 1, 0),
+ prodvers=(3, 2, 1, 0),
+ # Contains a bitmask that specifies the valid bits 'flags'r
+ mask=0x0,
+ # Contains a bitmask that specifies the Boolean attributes of the file.
+ flags=0x0,
+ # The operating system for which this file was designed.
+ # 0x4 - NT and there is no need to change it.
+ OS=0x40004,
+ # The general type of file.
+ # 0x1 - the file is an application.
+ fileType=0x1,
+ # The function of the file.
+ # 0x0 - the function is not defined for this fileType
+ subtype=0x0,
+ # Creation date and time stamp.
+ date=(0, 0)
+ ),
+ kids=[
+ StringFileInfo(
+ [
+ StringTable(
+ u'040904E4',
+ [StringStruct(u'Comments', u'Published under the GNU GPL'),
+ StringStruct(u'CompanyName', u'Ink/Stitch project'),
+ StringStruct(u'FileDescription', u'An open-source machine embroidery design platform based on Inkscape.'),
+ StringStruct(u'FileVersion', u'1.1.1'),
+ StringStruct(u'InternalName', u'Inkstitch '),
+ StringStruct(u'LegalCopyright', u'© 1234 Inkstitch Open Source Community'),
+ StringStruct(u'OriginalFilename', u'inkstitch.exe'),
+ StringStruct(u'ProductName', u'Inkstitch'),
+ StringStruct(u'ProductVersion', u'1.1.1')])
+ ]),
+ VarFileInfo([VarStruct(u'Translation', [1033, 1252])])
+ ]
+)
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<array>
+ <dict>
+ <key>BundleHasStrictIdentifier</key>
+ <false/>
+ <key>BundleIsRelocatable</key>
+ <false/>
+ <key>BundleIsVersionChecked</key>
+ <false/>
+ <key>BundleOverwriteAction</key>
+ <string>install</string>
+ <key>RootRelativeBundlePath</key>
+ <string>Contents/MacOS/electron/inkstitch-gui.app</string>
+ </dict>
+</array>
+</plist>
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..165128a7
--- /dev/null
+++ b/installer_scripts/scripts/preinstall
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -e
+inkstitch_folder=($HOME/Library/Application\ Support/org.inkscape.Inkscape/config/inkscape/extensions/inkstitch)
+location_inkscape=(/Applications/Inkscape.app)
+
+# Checking if Inkscape is installed
+if [[ -d "${location_inkscape}" ]]; then
+ echo "Inkscape is found and installed "${location_Inkscape}"."
+else
+ osascript <<-AppleScript
+ set theDialogText to "Ink/Stich is an Inkscape plugin. Please install and run Inkscape before installing Ink/Stitch."
+ display dialog theDialogText buttons {"Okay"} default button "Okay"
+ AppleScript
+ exit 1
+fi
+
+# Checking if Inkscape configuration folders are created
+if [[ -d "${inkstitch_folder%config*}" ]]; then
+ echo "Inkscape configs are found and installed "${inkstitch_folder%config*}"."
+else
+ osascript <<-AppleScript
+ set theDialogText to "Please run Inkscape before installing Ink/Stitch."
+ display dialog theDialogText buttons {"Okay"} default button "Okay"
+ AppleScript
+ exit 1
+fi
+
+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..a2654c36
--- /dev/null
+++ b/installer_scripts/template.iss
@@ -0,0 +1,130 @@
+#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 x86
+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}
+VersionInfoVersion=1.0
+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]
+// SOURCE: https://stackoverflow.com/questions/2000296/inno-setup-how-to-automatically-uninstall-previous-installed-version
+{ ///////////////////////////////////////////////////////////////////// }
+function GetUninstallString(): String;
+var
+ sUnInstPath: String;
+ sUnInstallString: String;
+begin
+ sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
+ sUnInstallString := '';
+ if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
+ RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
+ Result := sUnInstallString;
+end;
+
+
+{ ///////////////////////////////////////////////////////////////////// }
+function IsUpgrade(): Boolean;
+begin
+ Result := (GetUninstallString() <> '');
+end;
+
+
+{ ///////////////////////////////////////////////////////////////////// }
+function UnInstallOldVersion(): Integer;
+var
+ sUnInstallString: String;
+ iResultCode: Integer;
+begin
+{ Return Values: }
+{ 1 - uninstall string is empty }
+{ 2 - error executing the UnInstallString }
+{ 3 - successfully executed the UnInstallString }
+
+ { default return value }
+ Result := 0;
+
+ { get the uninstall string of the old app }
+ sUnInstallString := GetUninstallString();
+ if sUnInstallString <> '' then begin
+ sUnInstallString := RemoveQuotes(sUnInstallString);
+ if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
+ Result := 3
+ else
+ Result := 2;
+ end else
+ Result := 1;
+end;
+
+{ ///////////////////////////////////////////////////////////////////// }
+procedure CurStepChanged(CurStep: TSetupStep);
+begin
+ if (CurStep=ssInstall) then
+ begin
+ if (IsUpgrade()) then
+ begin
+ UnInstallOldVersion();
+ end;
+ end;
+end;