Skip to content

Commit

Permalink
fix installers
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Sep 2, 2024
1 parent 65b7e7c commit 3827452
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ MANIFEST
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
# *.spec
dist_pyinstaller/
build_pyinstaller/

# Installer logs
pip-log.txt
Expand Down
1 change: 1 addition & 0 deletions release/macos/build_gui_macos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e -u

# Build the GUI for MacOS.
# This script needs to be run from the root of the repository.
Expand Down
5 changes: 2 additions & 3 deletions release/macos/build_installer_macos.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash
set -e -u

# Build the installer for MacOS.
# This script needs to be run from the root of the repository.

pip install build
python -m build
pip install "dist/alphadia-1.7.2-py3-none-any.whl[stable]"

# Creating the stand-alone pyinstaller folder
pip install pyinstaller
pyinstaller release/pyinstaller/alphadia.spec -y
pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y
29 changes: 9 additions & 20 deletions release/macos/build_package_macos.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -e -u

# Build the install package for MacOS.
# This script must be run from the root of the repository after running build_installer_macos.sh and build_gui_macos.sh


# Set up package name and version
PACKAGE_NAME="alphadia"
APP_NAME="alphaDIA"
Expand All @@ -15,31 +15,23 @@ rm -rf ${BUILD_NAME}.pkg

# Cleanup the package folder
echo "Cleaning up the package folder"

rm -rf $PKG_FOLDER

# === Prepare structure ===
echo "Preparing package structure"

mkdir -p $PKG_FOLDER
mkdir -p $PKG_FOLDER/Contents/Resources
mkdir -p $PKG_FOLDER/Contents/MacOS
mkdir -p $PKG_FOLDER/Contents/Frameworks



# === Backend ===
echo "Copying backend"
BACKEND_BUILD="dist_pyinstaller/$PACKAGE_NAME"

BACKEND_BUILD="dist/$PACKAGE_NAME"

# Check if the backend build exists, otherwise exit with an error
if [ ! -d "$BACKEND_BUILD" ]; then
echo "Backend build not found at $BACKEND_BUILD"
exit 1
fi

# Copy the backend
cp -a ${BACKEND_BUILD}/. $PKG_FOLDER/Contents/Frameworks/


Expand All @@ -56,27 +48,24 @@ echo ARCH=${ARCH} KERNEL=${KERNEL}

ls ./gui/out

# Set the path to the GUI build
GUI_BUILD="./gui/out/${PACKAGE_NAME}-gui-${KERNEL}-${ARCH}"

# Check if the GUI build exists, otherwise exit with an error
if [ ! -d "$GUI_BUILD" ]; then
echo "GUI build not found at $GUI_BUILD"
exit 1
fi

# Copy the electron forge build
cp -a ${GUI_BUILD}/. $PKG_FOLDER/Contents/Frameworks/

# === Resources ===
echo "Copying resources"
cp release/logos/$PACKAGE_NAME.icns $PKG_FOLDER/Contents/Resources/
cp release/logos/$PACKAGE_NAME.png $PKG_FOLDER/Contents/Resources/
cp release/macos/$APP_NAME $PKG_FOLDER/Contents/MacOS/
CONTENTS_FOLDER=$PKG_FOLDER/Contents
cp release/logos/$PACKAGE_NAME.icns ${CONTENTS_FOLDER}/Resources
cp release/logos/$PACKAGE_NAME.png ${CONTENTS_FOLDER}/Resources
cp release/macos/$APP_NAME ${CONTENTS_FOLDER}/MacOS

cp release/macos/Info.plist $PKG_FOLDER/Contents/
cp release/macos/Info.plist ${CONTENTS_FOLDER}

# change permissions for entry script
chmod +x $PKG_FOLDER/Contents/MacOS/$APP_NAME
chmod +x ${CONTENTS_FOLDER}/MacOS/$APP_NAME

pkgbuild --root $PKG_FOLDER --identifier de.mpg.biochem.$PACKAGE_NAME.app --version $PACKAGE_VERSION --install-location /Applications/$APP_NAME.app --scripts release/macos/scripts dist/$BUILD_NAME.pkg --nopayload
pkgbuild --root $PKG_FOLDER --identifier de.mpg.biochem.$PACKAGE_NAME.app --version $PACKAGE_VERSION --install-location /Applications/$APP_NAME.app --scripts release/macos/scripts $BUILD_NAME.pkg --nopayload
4 changes: 2 additions & 2 deletions release/windows/alphadia_innoinstaller.iss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LicenseFile=..\..\LICENSE.txt
; Uncomment the following line to run in non administrative install mode (install for current user only.)
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=..\..\dist
OutputDir=.\
; example for BUILD_NAME: alphadia-1.7.2-win-x64
OutputBaseFilename={#GetEnv('BUILD_NAME')}
SetupIconFile=..\logos\alphadia.ico
Expand All @@ -41,7 +41,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
[Files]
Source: "..\..\gui\out\alphadia-gui-win32-x64\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\gui\out\alphadia-gui-win32-x64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\..\dist\alphadia\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\..\dist_pyinstaller\alphadia\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

Expand Down
2 changes: 1 addition & 1 deletion release/windows/build_installer.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TODO remove with old release workflow


& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" .\release\windows\alphadia_innoinstaller.iss
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" .\release\windows\alphadia_innoinstaller_old.iss
4 changes: 2 additions & 2 deletions release/windows/build_installer_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ python -m build
pip install "dist/alphadia-1.7.2-py3-none-any.whl[stable]"

# Creating the stand-alone pyinstaller folder
pip install pyinstaller tbb==2021.13.1
pyinstaller release/pyinstaller/alphadia.spec -y
pip install tbb==2021.13.1
pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y
1 change: 0 additions & 1 deletion release/windows/build_package_windows.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Build the install package for Windows.
# This script must be run from the root of the repository after running build_installer_windows.ps1

& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" .\release\windows\alphadia_innoinstaller.iss

0 comments on commit 3827452

Please sign in to comment.