diff options
| -rw-r--r-- | packaging/win32/RequireLatestNSIS.nsh | 2 | ||||
| -rw-r--r-- | packaging/win32/VersionCompleteXXXX.nsh | 47 | ||||
| -rwxr-xr-x | packaging/win32/inkscape.nsi | 21 |
3 files changed, 46 insertions, 24 deletions
diff --git a/packaging/win32/RequireLatestNSIS.nsh b/packaging/win32/RequireLatestNSIS.nsh index f859ec7ad..70371552a 100644 --- a/packaging/win32/RequireLatestNSIS.nsh +++ b/packaging/win32/RequireLatestNSIS.nsh @@ -1,4 +1,4 @@ -!if ${NSIS_VERSION} = v2.45 +!if `${NSIS_VERSION}` == `v2.45` !error "There is a bug in !searchparse which makes this script not compile in NSIS 2.45. Please upgrade to NSIS 2.46 or later and try again." !else !echo "(If you get a compile error with !searchparse, please upgrade to NSIS 2.46 or later and try again.)" diff --git a/packaging/win32/VersionCompleteXXXX.nsh b/packaging/win32/VersionCompleteXXXX.nsh index e4c6961cd..6ea780508 100644 --- a/packaging/win32/VersionCompleteXXXX.nsh +++ b/packaging/win32/VersionCompleteXXXX.nsh @@ -1,42 +1,55 @@ ; See http://nsis.sourceforge.net/VersionCompleteXXXX for documentation -!macro VersionCompleteXXXN _INPUT_VALUE _OUTPUT_SYMBOL _REVISION +!macro VersionCompleteXXXRevision _INPUT_VALUE _OUTPUT_SYMBOL _REVISION !searchparse /noerrors ${_INPUT_VALUE} "" _VERSION_1 "." _VERSION_2 "." _VERSION_3 "." _VERSION_4 - !if `${_VERSION_1}` == `` - !undef _VERSION_1 + !ifndef _VERSION_1 !define _VERSION_1 0 + !else if `${_VERSION_1}` == `` + !define /redef _VERSION_1 0 !endif - !if `${_VERSION_2}` == `` - !undef _VERSION_2 + !ifndef _VERSION_2 !define _VERSION_2 0 + !else if `${_VERSION_2}` == `` + !define /redef _VERSION_2 0 !endif - !if `${_VERSION_3}` == `` - !undef _VERSION_3 + !ifndef _VERSION_3 !define _VERSION_3 0 + !else if `${_VERSION_3}` == `` + !define /redef _VERSION_3 0 + !endif + !ifndef _VERSION_4 + !define _VERSION_4 0 + !else if `${_VERSION_4}` == `` + !define /redef _VERSION_4 0 !endif !define ${_OUTPUT_SYMBOL} ${_VERSION_1}.${_VERSION_2}.${_VERSION_3}.${_REVISION} !undef _VERSION_1 !undef _VERSION_2 !undef _VERSION_3 !undef _VERSION_4 + !undef _REVISION !macroend -!define VersionCompleteXXXN `!insertmacro VersionCompleteXXXN` +!define VersionCompleteXXXRevision `!insertmacro VersionCompleteXXXRevision` !macro VersionCompleteXXXX _INPUT_VALUE _OUTPUT_SYMBOL !searchparse /noerrors ${_INPUT_VALUE} "" _VERSION_1 "." _VERSION_2 "." _VERSION_3 "." _VERSION_4 - !if `${_VERSION_1}` == `` - !undef _VERSION_1 + !ifndef _VERSION_1 !define _VERSION_1 0 + !else if `${_VERSION_1}` == `` + !define /redef _VERSION_1 0 !endif - !if `${_VERSION_2}` == `` - !undef _VERSION_2 + !ifndef _VERSION_2 !define _VERSION_2 0 + !else if `${_VERSION_2}` == `` + !define /redef _VERSION_2 0 !endif - !if `${_VERSION_3}` == `` - !undef _VERSION_3 + !ifndef _VERSION_3 !define _VERSION_3 0 + !else if `${_VERSION_3}` == `` + !define /redef _VERSION_3 0 !endif - !if `${_VERSION_4}` == `` - !undef _VERSION_4 + !ifndef _VERSION_4 !define _VERSION_4 0 + !else if `${_VERSION_4}` == `` + !define /redef _VERSION_4 0 !endif !define ${_OUTPUT_SYMBOL} ${_VERSION_1}.${_VERSION_2}.${_VERSION_3}.${_VERSION_4} !undef _VERSION_1 @@ -44,4 +57,4 @@ !undef _VERSION_3 !undef _VERSION_4 !macroend -!define VersionCompleteXXXX `!insertmacro VersionCompleteXXXX` +!define VersionCompleteXXXX `!insertmacro VersionCompleteXXXX`
\ No newline at end of file diff --git a/packaging/win32/inkscape.nsi b/packaging/win32/inkscape.nsi index 7948e4b85..9646ee2f4 100755 --- a/packaging/win32/inkscape.nsi +++ b/packaging/win32/inkscape.nsi @@ -143,7 +143,7 @@ ShowUninstDetails hide !verbose pop ReserveFile inkscape.nsi.uninstall -ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" +ReserveFile /plugin UserInfo.dll !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ; ####################################### @@ -151,6 +151,13 @@ ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" ; ####################################### ; Product details (version, name, registry keys etc.) {{{2 +; Try to find version number in inkscape.rc first (e.g. 0.92pre1) {{{3 +!ifndef INKSCAPE_VERSION + !searchparse /noerrors /file ..\..\src\inkscape.rc `VALUE "ProductVersion", "` INKSCAPE_VERSION `"` + !ifdef INKSCAPE_VERSION + !echo `Got version number from ..\..\src\inkscape.rc: ${INKSCAPE_VERSION}` + !endif +!endif ; Find the version number in inkscape-version.cpp (e.g. 0.47+devel) {{{3 !ifndef INKSCAPE_VERSION ; Official release format (no newlines) @@ -159,12 +166,14 @@ ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" ; Other format; sorry, it has to be done in two steps. !searchparse /noerrors /file ..\..\src\inkscape-version.cpp `char const *version_string = "` INKSCAPE_VERSION `";` !searchparse /noerrors `${INKSCAPE_VERSION}` `` INKSCAPE_VERSION ` r` BZR_REVISION - !ifndef INKSCAPE_VERSION - !error "INKSCAPE_VERSION not defined and unable to get version number from ..\..\src\inkscape-version.cpp!" - !endif !endif + !ifdef INKSCAPE_VERSION + !echo `Got version number from ..\..\src\inkscape-version.cpp: ${INKSCAPE_VERSION}` + !endif +!endif +!ifndef INKSCAPE_VERSION + !error "INKSCAPE_VERSION not defined and unable to get version number from either ..\..\src\inkscape.rc or ..\..\src\inkscape-version.cpp!" !endif -!echo `Got version number from ..\..\src\inkscape-version.cpp: ${INKSCAPE_VERSION}` !define FILENAME Inkscape-${INKSCAPE_VERSION} !define BrandingText `Inkscape ${INKSCAPE_VERSION}` @@ -214,7 +223,7 @@ ${!ifexist} ..\..\.bzr\branch\last-revision !define VERSION_X.X.X.X_REVISION 0 !endif -${VersionCompleteXXXN} ${INKSCAPE_VERSION_NUMBER} VERSION_X.X.X.X ${VERSION_X.X.X.X_REVISION} +${VersionCompleteXXXRevision} ${INKSCAPE_VERSION_NUMBER} VERSION_X.X.X.X ${VERSION_X.X.X.X_REVISION} ; Product definitions {{{3 !define PRODUCT_NAME "Inkscape" ; TODO: fix up the language files to not use this and kill this line |
