Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsis installer fixes #1909

Merged
merged 6 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions msw/build-nsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ Helper script to build a proper Windows installer out of a
Pd build tree.

Usage:
$0 <path_to_pd_build> <version> <wish-exec-name> [<arch>]
$0 <path_to_pd_build> <version> [<wish-exec-name> [<arch>]]

<path_to_pd_build> input directory (containing 'bin/pd.exe')
<version> Pd-version to create installer for (e.g. '0.32-8')
<wishname> name of wish executable (e.g., wish85.exe)
<wish-exec-name> name of wish executable (e.g., 'wish85.exe')
<arch> architecture of Pd ('32' or '64')
EOF
cleanup 1
}

# show usage when invoked without args
if [ "$#" -lt "3" ]
if [ "$#" -lt "2" ]
then
usage
fi
Expand All @@ -104,6 +104,18 @@ then
cleanup 1
fi

# autodetect wishname if none is given
if [ -z "${WISHNAME}" ]; then
WISHNAME=$(find "${PDWINDIR}/bin" -iname "wish*.exe" -quit)
Lucarda marked this conversation as resolved.
Show resolved Hide resolved
if [ -n "${WISHNAME}" ]; then
WISHNAME=$(basename "${WISHNAME}")
fi
fi
if [ -z "${WISHNAME}" ]; then
error "Unable to automatically determine <wish-exec-name>."
cleanup 1
fi

# autodetect architecture if not given on the cmdline
if [ "x$PDARCH" = "x" ]; then
if file -b "$PDWINDIR/bin/pd.exe" | egrep "^PE32 .* 80386 " >/dev/null; then
Expand Down
30 changes: 23 additions & 7 deletions msw/pd.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
; Script generated by the HM NIS Edit Script Wizard.
; Manually edited by Roman Haefeli
; the string PDVERSION should be replaced by, e.g., 0.46-7
; and the string WISHNAME by, e.g., wish86.exe .
; and the string WISHNAME by, e.g., wish86.exe.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Pure Data (${ARCHI}-bit)"

; App name
!if ${ARCHI} == "64"
!define PRODUCT_NAME "Pure Data"
!else
!define PRODUCT_NAME "Pure Data (${ARCHI}-bit)"
!endif
Lucarda marked this conversation as resolved.
Show resolved Hide resolved
!define PRODUCT_VERSION "PDVERSION"
!define WISH_NAME "WISHNAME"
!define PRODUCT_PUBLISHER "Miller Puckette"
Expand Down Expand Up @@ -55,7 +61,9 @@
; set file associations page

; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\pd.exe"
Var SHORTPATH
!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\WISHNAME"
!define MUI_FINISHPAGE_RUN_PARAMETERS " $SHORTPATH\tcl\pd-gui.tcl"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\1.manual\index.htm"
!insertmacro MUI_PAGE_FINISH

Expand All @@ -76,6 +84,12 @@ Function RefreshShellIcons
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
(${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
FunctionEnd

; start Pd-GUI from the installer (this is to avoid whitespace in path)
; make variable $SHORTPATH
Function PdGuiFromInstaller
GetFullPathName /SHORT $SHORTPATH $INSTDIR
FunctionEnd
; /Function

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
Expand Down Expand Up @@ -125,15 +139,17 @@ SectionGroup /e "${COMPONENT_GROUP_TEXT}"
; Refresh Shell Icons
Call RefreshShellIcons
SectionEnd

Section
; make variable $SHORTPATH
Call PdGuiFromInstaller
SectionEnd

SectionGroupEnd

Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"


WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "${ARCHI}" "$INSTDIR"


WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\pd.exe"
Expand Down