Skip to content

Commit

Permalink
build-nsi: fine tune unmangle paths when running on MinGW
Browse files Browse the repository at this point in the history
Closes: #2073
  • Loading branch information
Lucarda committed Aug 2, 2023
1 parent 06d6632 commit be6da96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
11 changes: 4 additions & 7 deletions msw/build-nsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,12 @@ find "${PDWINDIR}" -type d -printf 'RMDir "$INSTDIR/%P"\n' \
echo "!insertmacro MUI_PAGE_LICENSE \"${PDWINDIR}/LICENSE.txt\"" \
> "${LICENSEFILE}"


# if we are on mingw/cygwin, we have to unmangle the directories
WWORKDIR=$(cygpath -m "${WORKDIR}" 2>/dev/null || echo "${WORKDIR}")
WOUTDIR=$(cygpath -m "${OUTDIR}" 2>/dev/null || echo "${OUTDIR}")
WOUTDIR=$(cygpath -m "${OUTDIR}\\" || echo "${OUTDIR}/" | sed 's|\\|\\\\|g')

# uninstall/license/... information into pd.nsi script
# Outfile into pd.nsi script
cat "${SCRIPTDIR}/pd.nsi" | sed \
-e "s|include \"/tmp/|include \"${WWORKDIR}/|" \
-e "s|OutFile \"/tmp/|OutFile \"${WOUTDIR}/|" \
-e "s|OutFile \"/tmp/|OutFile \"${WOUTDIR}|" \
> "${NSIFILE}"

# check if we have nsis compiler
Expand Down Expand Up @@ -265,4 +262,4 @@ else
error "(files are not cleaned up so you can inspect them)"
exit 1
fi
cleanup 0
cleanup 0
11 changes: 3 additions & 8 deletions msw/pd.nsi
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
;
; to make this work outside of Miller's machines (and on Windows) create a 'C:\tmp' dir and
; remove all occurrences of '/tmp/' except on :
;
; "OutFile "/tmp/pd-${PRODUCT_VERSION}.windows-installer.exe"
;

; https://stackoverflow.com/questions/36185539/can-i-get-nsis-to-make-a-single-installer-that-handles-local-deployment-and-syst
; ./build-nsi.sh G:/gitportable/nsis/pd-0.53.1 0.53.1

Expand Down Expand Up @@ -95,7 +90,7 @@ InstallDir ""
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
; License page
!include "/tmp/license_page.nsh"
!include "license_page.nsh"
Page Custom JustForMe JustForMeLeave
Page Custom Troubleshoot TroubleshootLeave
Page Custom PreviousInstallationDetected PreviousInstallationDetectedLeave
Expand Down Expand Up @@ -498,7 +493,7 @@ SectionGroup /e "${PRODUCT_NAME}"
${EndIf}
x_nosilent:
SectionIn RO
!include "/tmp/install_files_list.nsh"
!include "install_files_list.nsh"
; write ini file
WriteINIStr "$INSTDIR\uninst.ini" section1 vname "$VProductName"
WriteINIStr "$INSTDIR\uninst.ini" section1 shellcontext "$VContext"
Expand Down Expand Up @@ -589,7 +584,7 @@ Function un.dirty
FunctionEnd

Function un.deletefiles
!include "/tmp/uninstall_files_list.nsh"
!include "uninstall_files_list.nsh"
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.ini"
Delete "$INSTDIR\uninst.exe"
Expand Down

0 comments on commit be6da96

Please sign in to comment.