Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions windows/deploy_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ param(
[string] $NsisUrl = "https://jztkft.dl.sourceforge.net/project/nsis/NSIS%203/3.06.1/nsis-3.06.1.zip"
)

# change directory to the directory above (if needed)
Set-Location -Path "$PSScriptRoot\..\"

# Global constants
$RootPath = "$PWD"
$BuildPath = "$RootPath\build"
Expand All @@ -19,6 +22,7 @@ $AppName = "Jamulus"
# Stop at all errors
$ErrorActionPreference = "Stop"


# Execute native command with errorlevel handling
Function Execute-Native-Command {
Param(
Expand Down
19 changes: 15 additions & 4 deletions windows/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ BrandingText "${APP_NAME} powers your online jam session"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_EXE}"
!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_CHECKED
!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(DESKTOP_SET_SHORTCUT)"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION createdesktopshortcut
!insertmacro MUI_PAGE_FINISH

; Uninstaller page configuration
Expand All @@ -66,7 +70,8 @@ BrandingText "${APP_NAME} powers your online jam session"
; Additional languages can be added below, see https://nsis.sourceforge.io/Examples/Modern%20UI/MultiLanguage.nsi
!insertmacro MUI_LANGUAGE "English" ; The first language is the default
; !insertmacro MUI_LANGUAGE "Italian"

LangString DESKTOP_SET_SHORTCUT ${LANG_ENGLISH} \
"Create Desktop shortcut"
LangString INVALID_FOLDER_MSG ${LANG_ENGLISH} \
"The destination folder already exists. Please enter a new destination folder."
; LangString INVALID_FOLDER_MSG ${LANG_ITALIAN} \
Expand Down Expand Up @@ -138,8 +143,7 @@ LangString OLD_WRONG_VER_REMOVE_FAILED ${LANG_ENGLISH} \
; Add the uninstaller
WriteUninstaller "$INSTDIR\${UNINSTALL_EXE}"

; Add the Start Menu and desktop shortcuts
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${APP_EXE}"
; Add the Start Menu shortcuts
CreateDirectory "$SMPROGRAMS\${APP_NAME}"
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${APP_EXE}"
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME} Server.lnk" "$INSTDIR\${APP_EXE}" "-s" "$INSTDIR\servericon.ico"
Expand Down Expand Up @@ -241,6 +245,9 @@ Function AbortOnRunningApp
!insertmacro _AbortOnRunningApp
FunctionEnd

Function createdesktopshortcut
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${APP_EXE}"
FunctionEnd

; Uninstaller
!macro un.InstallFiles buildArch
Expand Down Expand Up @@ -281,7 +288,11 @@ Section "un.Install"
${EndIf}

; Remove the Start Menu and desktop shortcuts
Delete "$DESKTOP\${APP_NAME}.lnk"
IfFileExists "$DESKTOP\${APP_NAME}.lnk" deleteshortcut skipshortcut
deleteshortcut:
Delete "$DESKTOP\${APP_NAME}.lnk"
goto skipshortcut
skipshortcut:
RMDir /r "$SMPROGRAMS\${APP_NAME}"

; There may be an auto run entry in the registry for the server, remove it
Expand Down