diff options
Diffstat (limited to 'packaging')
| -rw-r--r-- | packaging/win32/inkscape.nsi | 178 | ||||
| -rw-r--r-- | packaging/win32/macros/VersionCompleteXXXX.nsh | 60 | ||||
| -rwxr-xr-x | packaging/wix/files.py | 10 | ||||
| -rw-r--r-- | packaging/wix/inkscape.wxs | 6 | ||||
| -rwxr-xr-x | packaging/wix/version.py | 54 |
5 files changed, 107 insertions, 201 deletions
diff --git a/packaging/win32/inkscape.nsi b/packaging/win32/inkscape.nsi index 42cf108de..7ef5bfcc9 100644 --- a/packaging/win32/inkscape.nsi +++ b/packaging/win32/inkscape.nsi @@ -5,17 +5,6 @@ ; 1. Install NSIS 3.0 or later (http://nsis.sourceforge.net/) ; 2. Compile Inkscape (http://wiki.inkscape.org/wiki/index.php/Win32Port) ; 3. Compile this file with NSIS. -; -; There should be no need to set version numbers in this file as it -; gets them from the Bazaar branch info and inkscape.rc or -; inkscape-version.cpp respectively. However, if the version number comes -; out wrong or this script didn't compile properly then you can define -; INKSCAPE_VERSION by uncommenting the next line and setting the correct -; value: -; !define INKSCAPE_VERSION "0.48" -; If you ever need to do a second, third or Nth release of the build or -; of the installer, then change the RELEASE_REVISION value below: - !define RELEASE_REVISION 1 ; There should never be any need for packagers to touch anything below ; this line. Otherwise file a bug or write to the mailing list. @@ -30,7 +19,7 @@ ; Unicode, compression and admin requirement {{{2 Unicode true SetCompressor /SOLID lzma -SetCompressorDictSize 32 +SetCompressorDictSize 64 RequestExecutionLevel admin ; Include required files {{{2 @@ -39,7 +28,6 @@ RequestExecutionLevel admin !include macros\ifexist.nsh !include macros\RequireLatestNSIS.nsh !include macros\SHMessageBoxCheck.nsh -!include macros\VersionCompleteXXXX.nsh !include languages\_language_lists.nsh ; Advanced Uninstall Log {{{3 @@ -133,8 +121,8 @@ ReserveFile /plugin UserInfo.dll ; SETTINGS ; ####################################### -; Find inkscape distribution directory (uncomment line below to manually define) -;!define INKSCAPE_DIST_DIR ..\..\inkscape +; Find inkscape distribution directory (define on command line or uncomment line below to manually define) +;!define INKSCAPE_DIST_DIR ..\..\build\inkscape !ifdef INKSCAPE_DIST_DIR ${!defineifexist} ${INKSCAPE_DIST_DIR}\inkscape.exe FOUND 1 !ifndef FOUND @@ -153,100 +141,67 @@ ReserveFile /plugin UserInfo.dll !echo `Bundling compiled Inkscape files from ${INKSCAPE_DIST_DIR}` ; Product details (version, name, registry keys etc.) {{{2 -; Try to find version number in inkscape.rc first (e.g. 0.92pre1) {{{3 +; Extract version number from CMakeLists.txt (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) - !searchparse /noerrors /file ..\..\src\inkscape-version.cpp `namespace Inkscape { char const *version_string = "` INKSCAPE_VERSION ` r` BZR_REVISION `"; }` - !ifndef INKSCAPE_VERSION - ; 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 + !searchparse /noerrors /file ..\..\CMakeLists.txt `set(INKSCAPE_VERSION_MAJOR` INKSCAPE_VERSION_MAJOR `)` + !searchparse /noerrors /file ..\..\CMakeLists.txt `set(INKSCAPE_VERSION_MINOR` INKSCAPE_VERSION_MINOR `)` + !searchparse /noerrors /file ..\..\CMakeLists.txt `set(INKSCAPE_VERSION_PATCH` INKSCAPE_VERSION_PATCH `)` + !searchparse /noerrors /file ..\..\CMakeLists.txt `set(INKSCAPE_VERSION_SUFFIX` INKSCAPE_VERSION_SUFFIX `)` + ; strip whitespace + !define /redef INKSCAPE_VERSION_MAJOR ${INKSCAPE_VERSION_MAJOR} + !define /redef INKSCAPE_VERSION_MINOR ${INKSCAPE_VERSION_MINOR} + !define /redef INKSCAPE_VERSION_PATCH ${INKSCAPE_VERSION_PATCH} + !define /redef INKSCAPE_VERSION_SUFFIX ${INKSCAPE_VERSION_SUFFIX} + ; strip quotes + !searchparse /noerrors ${INKSCAPE_VERSION_SUFFIX} `"` INKSCAPE_VERSION_SUFFIX `"` + ; construct version string + !define INKSCAPE_VERSION "${INKSCAPE_VERSION_MAJOR}.${INKSCAPE_VERSION_MINOR}" + !if "${INKSCAPE_VERSION_PATCH}" != "0" + !if "${INKSCAPE_VERSION_PATCH}" != "" + !define /redef INKSCAPE_VERSION "${INKSCAPE_VERSION}.${INKSCAPE_VERSION_PATCH}" + !endif !endif - !ifdef INKSCAPE_VERSION - !echo `Got version number from ..\..\src\inkscape-version.cpp: ${INKSCAPE_VERSION}` + !define /redef INKSCAPE_VERSION "${INKSCAPE_VERSION}${INKSCAPE_VERSION_SUFFIX}" + ; construct X.X.X.X version string for VIProductVersion + !if "${INKSCAPE_VERSION_PATCH}" != "" + !define VERSION_X.X.X.X ${INKSCAPE_VERSION_MAJOR}.${INKSCAPE_VERSION_MINOR}.${INKSCAPE_VERSION_PATCH}.0 + !else + !define VERSION_X.X.X.X ${INKSCAPE_VERSION_MAJOR}.${INKSCAPE_VERSION_MINOR}.0.0 !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!" +!ifdef INKSCAPE_VERSION + !echo `INKSCAPE_VERSION: ${INKSCAPE_VERSION}` +!else + !error "INKSCAPE_VERSION not defined and unable to get version number from CMakeLists.txt!" !endif -!define FILENAME Inkscape-${INKSCAPE_VERSION} +!define FILENAME inkscape-${INKSCAPE_VERSION} !define BrandingText `Inkscape ${INKSCAPE_VERSION}` ; Detect architecture of the build ${!ifexist} ${INKSCAPE_DIST_DIR}\gspawn-win32-helper.exe !define BITNESS 32 + !define /redef FILENAME `${FILENAME}-x86` !endif ${!ifexist} ${INKSCAPE_DIST_DIR}\gspawn-win64-helper.exe !define BITNESS 64 - !define /redef FILENAME `${FILENAME}-x64` ; add architecture to filename for 64-bit builds + !define /redef FILENAME `${FILENAME}-x64` !endif !ifndef BITNESS !error "Could not detect architecture (BITNESS) of the Inkscape build" !endif -; Check for the Bazaar revision number for lp:inkscape {{{3 -${!ifexist} ..\..\.bzr\branch\last-revision - !if `${BZR_REVISION}` == `` - !undef BZR_REVISION - !endif - !ifndef BZR_REVISION - !searchparse /noerrors /file ..\..\.bzr\branch\last-revision "" BZR_REVISION " " - !endif -!endif - -; Check for devel builds and clear up bzr revision number define {{{3 -!searchparse /noerrors ${INKSCAPE_VERSION} "" INKSCAPE_VERSION_NUMBER "+devel" -!if ${INKSCAPE_VERSION_NUMBER} != ${INKSCAPE_VERSION} - !define DEVEL -!endif -!if `${BZR_REVISION}` == `` - !undef BZR_REVISION -!endif -; For releases like 0.48pre1, throw away the preN. It's too tricky to deal with -; it properly so I'll leave it alone. It's just a pre-release, so it doesn't -; really matter. So long as the final release works properly. -!ifndef DEVEL - !undef INKSCAPE_VERSION_NUMBER - !searchparse /noerrors ${INKSCAPE_VERSION} "" INKSCAPE_VERSION_NUMBER "pre" PRE_NUMBER -!endif - -; Handle display version number and complete X.X version numbers into X.X.X.X {{{3 -!ifdef DEVEL & BZR_REVISION - !define /redef FILENAME `${FILENAME}-r${BZR_REVISION}` - !define /redef BrandingText `${BrandingText} r${BZR_REVISION}` - !define VERSION_X.X.X.X_REVISION ${BZR_REVISION} -; Handle the installer revision number {{{4 -!else ifdef RELEASE_REVISION - !define /redef FILENAME `${FILENAME}-${RELEASE_REVISION}` - ; If we wanted the branding text to be like "Inkscape 0.48pre1 r9505" this'd do it. - ;!ifdef BZR_REVISION - ; !define /redef BrandingText `${BrandingText} r${BZR_REVISION}` - ;!endif - !if `${RELEASE_REVISION}` != `1` - !define /redef BrandingText `${BrandingText}, revision ${RELEASE_REVISION}` - !endif - !define VERSION_X.X.X.X_REVISION ${RELEASE_REVISION} -!else - !define VERSION_X.X.X.X_REVISION 0 -!endif - -${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 !define INSTDIR_KEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inkscape.exe" !define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Inkscape" -!define _FILENAME ${FILENAME}.exe -!undef FILENAME -!define FILENAME ${_FILENAME} -!undef _FILENAME + +!ifdef OutFile + ; allow to set different output filename by defining 'OutFile' on command line + !define /redef FILENAME ${OutFile} +!else + !define /redef FILENAME ${FILENAME}.exe +!endif + ; Product information {{{3 Name `Inkscape` @@ -261,14 +216,16 @@ OutFile `${FILENAME}` InstallDirRegKey HKLM "${INSTDIR_KEY}" "" ; Version information {{{3 +!define /date COPYRIGHT_YEAR "%Y" VIProductVersion ${VERSION_X.X.X.X} VIAddVersionKey /LANG=0 ProductName "Inkscape" VIAddVersionKey /LANG=0 Comments "Licensed under the GNU GPL" -VIAddVersionKey /LANG=0 CompanyName "Inkscape Project" -VIAddVersionKey /LANG=0 LegalCopyright "© 2016 Inkscape Project" -VIAddVersionKey /LANG=0 FileDescription "Inkscape Vector Graphics Editor" -VIAddVersionKey /LANG=0 FileVersion ${VERSION_X.X.X.X} -VIAddVersionKey /LANG=0 ProductVersion ${VERSION_X.X.X.X} +VIAddVersionKey /LANG=0 CompanyName "Inkscape project" +VIAddVersionKey /LANG=0 LegalCopyright "© ${COPYRIGHT_YEAR} Inkscape project" +VIAddVersionKey /LANG=0 FileDescription "Installer for Inkscape vector graphics editor" +VIAddVersionKey /LANG=0 FileVersion ${INKSCAPE_VERSION} +VIAddVersionKey /LANG=0 ProductVersion ${INKSCAPE_VERSION} + ; Variables {{{2 Var askMultiUser @@ -330,8 +287,10 @@ Section "$(Core)" SecCore ; Mandatory Inkscape core files section {{{ SetOutPath $INSTDIR !insertmacro UNINSTALL.LOG_OPEN_INSTALL - File /a ${INKSCAPE_DIST_DIR}\ink*.exe - File /nonfatal /a ${INKSCAPE_DIST_DIR}\inkscape.com ; not created as of Inkscape 0.92pre1 + File /a ${INKSCAPE_DIST_DIR}\inkscape.exe + File /a ${INKSCAPE_DIST_DIR}\inkscape.com + File /a ${INKSCAPE_DIST_DIR}\inkview.exe + File /a ${INKSCAPE_DIST_DIR}\inkview.com File /a ${INKSCAPE_DIST_DIR}\AUTHORS File /a ${INKSCAPE_DIST_DIR}\COPYING File /a ${INKSCAPE_DIST_DIR}\GPL2.txt @@ -340,26 +299,14 @@ Section "$(Core)" SecCore ; Mandatory Inkscape core files section {{{ File /a ${INKSCAPE_DIST_DIR}\NEWS File /a ${INKSCAPE_DIST_DIR}\gspawn-win${BITNESS}-helper.exe File /a ${INKSCAPE_DIST_DIR}\gspawn-win${BITNESS}-helper-console.exe - File /a ${INKSCAPE_DIST_DIR}\README + File /a ${INKSCAPE_DIST_DIR}\README.md File /a ${INKSCAPE_DIST_DIR}\TRANSLATORS !insertmacro UNINSTALL.LOG_CLOSE_INSTALL - SetOutPath $INSTDIR\data - !insertmacro UNINSTALL.LOG_OPEN_INSTALL - File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\data\*.* - !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\doc !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\doc\*.* !insertmacro UNINSTALL.LOG_CLOSE_INSTALL - SetOutPath $INSTDIR\plugins - !insertmacro UNINSTALL.LOG_OPEN_INSTALL - File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\plugins\*.* - !insertmacro UNINSTALL.LOG_CLOSE_INSTALL - SetOutPath $INSTDIR\modules - !insertmacro UNINSTALL.LOG_OPEN_INSTALL - File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\modules\*.* - !insertmacro UNINSTALL.LOG_CLOSE_INSTALL ;exclude everything from /share for which we have separate sections below SetOutPath $INSTDIR\share @@ -385,11 +332,11 @@ Section "$(GTKFiles)" SecGTK ; Mandatory GTK files section {{{ DetailPrint "Installing GTK files..." SetOutPath $INSTDIR !insertmacro UNINSTALL.LOG_OPEN_INSTALL - File /a /r /x python ${INKSCAPE_DIST_DIR}\*.dll + File /a /r /x libpython2.7.dll ${INKSCAPE_DIST_DIR}\*.dll !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\lib !insertmacro UNINSTALL.LOG_OPEN_INSTALL - File /a /r /x locale /x aspell-0.60 ${INKSCAPE_DIST_DIR}\lib\*.* + File /a /r /x locale /x aspell-0.60 /x enchant /x python2.7 ${INKSCAPE_DIST_DIR}\lib\*.* !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath $INSTDIR\etc !insertmacro UNINSTALL.LOG_OPEN_INSTALL @@ -497,6 +444,15 @@ Section "$(Python)" SecPython ; Python distribution {{{ !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\python\*.* !insertmacro UNINSTALL.LOG_CLOSE_INSTALL + SetOutPath $INSTDIR\lib\python2.7 + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\lib\python2.7\*.* + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL + SetOutPath $INSTDIR + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /nonfatal /a ${INKSCAPE_DIST_DIR}\python*.exe + File /nonfatal /a ${INKSCAPE_DIST_DIR}\libpython*.dll + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL !endif SectionEnd ; SecPython }}} @@ -543,6 +499,10 @@ Section "$(Dictionaries)" SecDictionaries ; Aspell dictionaries {{{ !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\lib\aspell-0.60\*.* !insertmacro UNINSTALL.LOG_CLOSE_INSTALL + SetOutPath $INSTDIR\lib\enchant + !insertmacro UNINSTALL.LOG_OPEN_INSTALL + File /nonfatal /a /r ${INKSCAPE_DIST_DIR}\lib\enchant\*.* + !insertmacro UNINSTALL.LOG_CLOSE_INSTALL !endif SectionEnd ; SecDictionaries }}} diff --git a/packaging/win32/macros/VersionCompleteXXXX.nsh b/packaging/win32/macros/VersionCompleteXXXX.nsh deleted file mode 100644 index 6ea780508..000000000 --- a/packaging/win32/macros/VersionCompleteXXXX.nsh +++ /dev/null @@ -1,60 +0,0 @@ -; See http://nsis.sourceforge.net/VersionCompleteXXXX for documentation -!macro VersionCompleteXXXRevision _INPUT_VALUE _OUTPUT_SYMBOL _REVISION - !searchparse /noerrors ${_INPUT_VALUE} "" _VERSION_1 "." _VERSION_2 "." _VERSION_3 "." _VERSION_4 - !ifndef _VERSION_1 - !define _VERSION_1 0 - !else if `${_VERSION_1}` == `` - !define /redef _VERSION_1 0 - !endif - !ifndef _VERSION_2 - !define _VERSION_2 0 - !else if `${_VERSION_2}` == `` - !define /redef _VERSION_2 0 - !endif - !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 VersionCompleteXXXRevision `!insertmacro VersionCompleteXXXRevision` -!macro VersionCompleteXXXX _INPUT_VALUE _OUTPUT_SYMBOL - !searchparse /noerrors ${_INPUT_VALUE} "" _VERSION_1 "." _VERSION_2 "." _VERSION_3 "." _VERSION_4 - !ifndef _VERSION_1 - !define _VERSION_1 0 - !else if `${_VERSION_1}` == `` - !define /redef _VERSION_1 0 - !endif - !ifndef _VERSION_2 - !define _VERSION_2 0 - !else if `${_VERSION_2}` == `` - !define /redef _VERSION_2 0 - !endif - !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}.${_VERSION_4} - !undef _VERSION_1 - !undef _VERSION_2 - !undef _VERSION_3 - !undef _VERSION_4 -!macroend -!define VersionCompleteXXXX `!insertmacro VersionCompleteXXXX`
\ No newline at end of file diff --git a/packaging/wix/files.py b/packaging/wix/files.py index 9bf5f393e..dd5d72381 100755 --- a/packaging/wix/files.py +++ b/packaging/wix/files.py @@ -40,16 +40,17 @@ def directory(root, breadcrumb, level, exclude=[]): files = [ f for f in os.listdir(root) if os.path.isfile(os.path.join(root,f)) and f not in exclude] for file in files: file_key = os.path.join(root, file) + file_key = file_key.replace('/', '\\') # for usage from MSYS2 shell _id = '_%06d' % (len(file_ids.keys()) + 1) file_ids[file_key] = 'component' + _id wxs.write(indent(level)+ "<Component Id='component" + _id + "' Guid='" + str(uuid.uuid4()) + "' DiskId='1' Win64='$(var.Win64)'>\n") if file == 'inkscape.exe': - # we refenrence inkscape.exe in inkscape.wxs + # we reference inkscape.exe in inkscape.wxs _id = '_inkscape_exe' wxs.write(indent(level + 1)+ "<File Id='file" + _id + "' Name='" + file + "' DiskId='1' Source='" + file_key + "' KeyPath='yes' />\n") wxs.write(indent(level)+ "</Component>\n") - # then all directories + # then all directories dirs = [ f for f in os.listdir(root) if os.path.isdir(os.path.join(root,f)) ] for dir in dirs: directory_key = breadcrumb + '__' + dir @@ -119,7 +120,8 @@ with open('files.wxs', 'w', encoding='utf-8') as wxs: wxs.write(indent(2) + "</Directory>\n") # Python - ComponentGroup("Python", 'inkscape\\python\\', 2) + ComponentGroup("Python", ['inkscape\\python\\','inkscape\\lib\\python2.7\\', + 'inkscape\\libpython', 'inkscape\\python'], 2) # translations and localized content for lang_code in sorted(locales): ComponentGroup("Translation_" + valid_id(lang_code), ['\\' + lang_code + '\\', @@ -128,7 +130,7 @@ with open('files.wxs', 'w', encoding='utf-8') as wxs: ComponentGroup("Extensions", 'inkscape\\share\\extensions\\', 2) ComponentGroup("Examples", 'inkscape\\share\\examples\\', 2) ComponentGroup("Tutorials", 'inkscape\\share\\tutorials\\', 2) - ComponentGroup("Dictionaries", 'inkscape\\lib\\aspell-0.60\\', 2) + ComponentGroup("Dictionaries", ['inkscape\\lib\\aspell-0.60\\', 'inkscape\\lib\\enchant\\'], 2) # everything that is left (which should be the Inkscape core unless inkscape_dist_dir contains unnecessary files or we defined our components poorly) ComponentGroup("AllOther", '', 2) diff --git a/packaging/wix/inkscape.wxs b/packaging/wix/inkscape.wxs index 051c1cfc1..3dad2ca4c 100644 --- a/packaging/wix/inkscape.wxs +++ b/packaging/wix/inkscape.wxs @@ -3,9 +3,9 @@ <?include version.wxi?>
<!-- change Product Id for every new version and subversion, do not change UpgradeCode -->
- <Product Name="$(var.FullProductName)" Id='81922150-317e-4bb0-a31d-ff1c14f707c5' UpgradeCode='4d5fedaa-84a0-48be-bd2a-08246398361a' Language='1033' Codepage='1252' Version='$(var.ProductVersion)' Manufacturer='inkscape.org'>
+ <Product Name="$(var.FullProductName)" Id='81922150-317e-4bb0-a31d-ff1c14f707c5' UpgradeCode='4d5fedaa-84a0-48be-bd2a-08246398361a' Language='1033' Codepage='1252' Version='$(var.ProductVersion)' Manufacturer='Inkscape project'>
- <Package Id='*' Keywords='Installer' Description="Inkscape Installer" Comments='inkscape is registered trademark of inkscape.org' Manufacturer='inkscape.org' InstallerVersion='$(var.InstallerVersion)' Platform='$(var.Platform)' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+ <Package Id='*' Keywords='SVG, vector graphics' Description="Installer for Inkscape vector graphics editor" Comments='Licensed under the GNU GPL' Manufacturer='Inkscape project' InstallerVersion='$(var.InstallerVersion)' Platform='$(var.Platform)' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" CompressionLevel="high"/>
<Property Id='DiskPrompt' Value="inkscape Installation [1]" />
@@ -121,7 +121,7 @@ <UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" />
- <Icon Id="inkscape.ico" SourceFile="..\..\inkscape.ico" />
+ <Icon Id="inkscape.ico" SourceFile="..\..\share\branding\inkscape.ico" />
<Property Id="ARPPRODUCTICON" Value="inkscape.ico" />
</Product>
</Wix>
diff --git a/packaging/wix/version.py b/packaging/wix/version.py index a7ffebaa0..68ca5cc2b 100755 --- a/packaging/wix/version.py +++ b/packaging/wix/version.py @@ -14,9 +14,9 @@ architecture = '' def is64bitArchitecture(filename):
''' test if a executable is of x64 format @see http://stackoverflow.com/questions/1001404/check-if-unmanaged-dll-is-32-bit-or-64-bit/1002672#1002672
@see http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
- //offset to PE header is always at 0x3C
- //PE header starts with "PE\0\0" = 0x50 0x45 0x00 0x00
- //followed by 2-byte machine type field (see document above for enum)
+ //offset to PE header is always at 0x3C
+ //PE header starts with "PE\0\0" = 0x50 0x45 0x00 0x00
+ //followed by 2-byte machine type field (see document above for enum)
'''
with open(filename, 'rb') as cofffile:
cofffile.seek(0x3c)
@@ -37,31 +37,35 @@ inkscape_dist_dir = get_inkscape_dist_dir() if is64bitArchitecture(inkscape_dist_dir + '\\inkscape.exe'):
architecture = '-x64'
else:
- architecture = ''
+ architecture = '-x86'
-# retrieve the version information from the inkscape.rc file
-# VALUE "ProductVersion", "0.48+devel"
-with open('..\..\src\inkscape.rc', 'r') as rc:
+# retrieve the version information from CMakeLists.txt
+with open('..\..\CMakeLists.txt', 'r') as rc:
isversioninfo = False
-
+
for line in rc.readlines():
- if 'productversion' in line.lower() and 'value' in line.lower():
- items = line.split()
- versionstr = items[2]
- versionstr = versionstr.replace('"', '')
- versionstr = versionstr.replace("'", "")
- # version = version.replace("+", "_")
- print(versionstr + architecture)
- if 'versioninfo' in line.lower():
- isversioninfo = True
- if 'begin' in line.lower():
- isversioninfo = False
- if isversioninfo and 'productversion' in line.lower():
- items = line.split()
- ''' the second element contains now version info in the form major,minor,fix,build'''
- veritems = items[1].split(',')
- version = veritems[0] + '.' + veritems[1]
-
+ if 'set(INKSCAPE_VERSION_MAJOR' in line:
+ version_major = line.split()[-1][0:-1]
+ if 'set(INKSCAPE_VERSION_MINOR' in line:
+ version_minor = line.split()[-1][0:-1]
+ if 'set(INKSCAPE_VERSION_PATCH' in line:
+ version_patch = line.split()[-1][0:-1]
+ if version_patch == '':
+ version_patch = '0'
+ if 'set(INKSCAPE_VERSION_SUFFIX' in line:
+ version_suffix = line.split()[-1][0:-1]
+ version_suffix = version_suffix.replace('"', '')
+
+ version_list = [version_major, version_minor, version_patch, '0']
+ version = '.'.join(version_list)
+
+ versionstr = '.'.join(version_list[0:2])
+ if version_patch != '0':
+ versionstr += '.' + version_patch
+ versionstr += version_suffix
+
+ # required by install.bat
+ print(versionstr + architecture)
with open('version.wxi', 'w') as wxi:
wxi.write("<?xml version='1.0' encoding='utf-8'?>\n")
|
