diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 968bdefd..d2508e52 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -46,6 +46,5 @@ jobs: $env:PYTHONBUILDDIR_X64='${{ github.workspace }}\packages\python.3.12.8\tools' $env:PYTHONBUILDDIR='${{ github.workspace }}\packages\pythonx86.3.12.8\tools' Rename-Item -Path ".\buildPaths.bat.orig" -NewName "buildPaths.bat" - $env:WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.11\bin" - $env:PATH = $env:PATH + ';' + $env:WIX_PATH + dotnet tool install --global wix .\buildAll.bat ${{ matrix.build_platform }} diff --git a/PythonScript/project/packages.config b/PythonScript/project/packages.config index ebf781fd..b4cff744 100644 --- a/PythonScript/project/packages.config +++ b/PythonScript/project/packages.config @@ -1,5 +1,6 @@  + diff --git a/PythonScript/project/packages_local_pydebug.config b/PythonScript/project/packages_local_pydebug.config index 5c16e22e..ffb741ae 100644 --- a/PythonScript/project/packages_local_pydebug.config +++ b/PythonScript/project/packages_local_pydebug.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index c9789a57..d6c04128 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,8 +42,7 @@ after_build: - if "%configuration%"=="Release" make.bat html - cd "%APPVEYOR_BUILD_FOLDER%"\installer - - set WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.14\bin" - - set PATH=%WIX_PATH%;%PATH% + - dotnet tool install --global wix - if "%platform_input%"=="x64" SET PYTHONBUILDDIR_X64="%APPVEYOR_BUILD_FOLDER%"\packages\python.3.12.8\tools - if "%platform_input%"=="Win32" SET PYTHONBUILDDIR="%APPVEYOR_BUILD_FOLDER%"\packages\pythonx86.3.12.8\tools - copy "%APPVEYOR_BUILD_FOLDER%"\installer\buildPaths.bat.orig "%APPVEYOR_BUILD_FOLDER%"\installer\buildPaths.bat diff --git a/installer/PythonScript.wxs b/installer/PythonScript.wxs index 46ee5d5f..e65d345e 100644 --- a/installer/PythonScript.wxs +++ b/installer/PythonScript.wxs @@ -1,70 +1,25 @@ - - - + + - - - + - - - - - - - - - - - - + + + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -83,16 +38,72 @@ - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/installer/buildInstaller.bat b/installer/buildInstaller.bat index ef662e8f..478f8399 100644 --- a/installer/buildInstaller.bat +++ b/installer/buildInstaller.bat @@ -43,105 +43,15 @@ mkdir %INST_TEMP_DIR% SET /p PYTHONSCRIPTVERSION= < %INST_TEMP_DIR%\version.txt -echo Generating WiX information for ..\pythonlib\full -heat dir ..\pythonlib\full -ag -cg CG_PythonLib -dr D_PythonScript -var var.pylibSource -t changeDirLib.xsl -o %INST_TEMP_DIR%\fullLib.wxs -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling python lib WiX source -candle %INST_TEMP_DIR%\fullLib.wxs -o %INST_TEMP_DIR%\fullLib.wixobj -dpylibSource=..\pythonlib\full -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Generating WiX information for ..\pythonlib\full_dll%NAME_ADDON% -heat dir ..\pythonlib\full_dll%NAME_ADDON% -ag -cg CG_PythonLibDll -dr D_PythonScript -var var.pylibSource -t changeDirLib.xsl -o %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wxs -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling python pyd lib WiX source -candle %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wixobj -dpylibSource=..\pythonlib\full_dll%NAME_ADDON% -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Generating WiX information for ..\pythonlib\tcl -heat dir ..\pythonlib\tcl -ag -cg CG_PythonTclTkLib -dr D_PythonScript -var var.pylibSource -t changeDirLib.xsl -o %INST_TEMP_DIR%\tcl.wxs -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling tcl lib WiX source -candle %INST_TEMP_DIR%\tcl.wxs -o %INST_TEMP_DIR%\tcl.wixobj -dpylibSource=..\pythonlib\tcl -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Generating WiX information for ..\pythonlib\tcl_dll%NAME_ADDON% -heat dir ..\pythonlib\tcl_dll%NAME_ADDON% -ag -cg CG_PythonTclTkLibDll -dr D_PythonScript -var var.pylibSource -t changeDirLib.xsl -o %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wxs -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling tcl lib WiX source -candle %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wixobj -dpylibSource=..\pythonlib\tcl_dll%NAME_ADDON% -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Generating WiX information for ..\PythonScript\scripts\Samples -heat dir ..\scripts\Samples -ag -cg CG_SampleScripts -dr D_PythonScript -var var.scriptSource -t changeDirSampleScripts.xsl -o %INST_TEMP_DIR%\sampleScripts.wxs -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling Sample Scripts WiX source -candle %INST_TEMP_DIR%\sampleScripts.wxs -o %INST_TEMP_DIR%\sampleScripts.wixobj -dscriptSource=..\scripts\Samples -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - - -echo Generating WiX information for ..\PythonScript\python_tests -heat dir ..\PythonScript\python_tests -ag -cg CG_UnitTests -dr D_PythonScript -var var.unittestSource -t changeDirTests.xsl -o %INST_TEMP_DIR%\unittests.wxs -platform=%NAME_ADDON% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling Unit test WiX source -candle %INST_TEMP_DIR%\unittests.wxs -o %INST_TEMP_DIR%\unittests.wixobj -dunittestSource=..\PythonScript\python_tests -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Generating WiX information for ..\docs\build\html -heat dir ..\docs\build\html -ag -cg CG_HtmlDocs -dr D_PythonScript -var var.htmldocsSource -t changeDirHtmlDoc.xsl -o %INST_TEMP_DIR%\htmldoc.wxs -platform=%NAME_ADDON% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling Html doc WiX source -candle %INST_TEMP_DIR%\htmldoc.wxs -o %INST_TEMP_DIR%\htmldoc.wixobj -dhtmldocsSource=..\docs\build\html -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - -echo Compiling main PythonScript installer -candle pythonscript.wxs -o %INST_TEMP_DIR%\pythonscript.wixobj -dversion=%PYTHONSCRIPTVERSION% -dbaseDir=.. -dpythonDir=%PYTHONBUILDDIR% -dvariantDir=%PYTHONSCRIPTDLLDIR% -dPlatform=%MSI_ARCH% -arch %MSI_ARCH% -if NOT [%ERRORLEVEL%]==[0] ( - goto error -) - - -echo Linking installer - generating MSI -IF NOT EXIST "build\%PYTHONSCRIPTVERSION%" ( - mkdir build\%PYTHONSCRIPTVERSION% -) +cd ..\packages +echo add UI extension globally +wix extension add -g WixToolset.UI.wixext +wix extension list -g +cd ..\installer -light %INST_TEMP_DIR%\pythonscript.wixobj %INST_TEMP_DIR%\fullLib.wixobj %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wixobj %INST_TEMP_DIR%\unittests.wixobj %INST_TEMP_DIR%\tcl.wixobj %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wixobj %INST_TEMP_DIR%\sampleScripts.wixobj %INST_TEMP_DIR%\htmldoc.wixobj -o build\%PYTHONSCRIPTVERSION%\PythonScript_%PYTHONSCRIPTVERSION%%NAME_ADDON%.msi -ext WixUIExtension +echo Compiling PythonScript installer +wix build pythonscript.wxs -o build\%PYTHONSCRIPTVERSION%\PythonScript_%PYTHONSCRIPTVERSION%%NAME_ADDON%.msi -d version=%PYTHONSCRIPTVERSION% -d baseDir=.. -d pythonDir=%PYTHONBUILDDIR% -d variantDir=%PYTHONSCRIPTDLLDIR% -d Platform=%MSI_ARCH% -d nameAddon=%NAME_ADDON% -arch %MSI_ARCH% -ext "WixToolset.UI.wixext" if NOT [%ERRORLEVEL%]==[0] ( goto error ) diff --git a/installer/buildReleaseZips.bat b/installer/buildReleaseZips.bat index f9c5cac6..132c3788 100644 --- a/installer/buildReleaseZips.bat +++ b/installer/buildReleaseZips.bat @@ -103,7 +103,7 @@ mkdir %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION% cd %INST_TEMP_DIR%\release\Full\plugins\PythonScript %SEVENZIPEXE% a -r -tzip %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%_PluginAdmin.zip . -cd %INST_TEMP_DIR%\release\Full +cd %INSTALLERDIR%\%INST_TEMP_DIR%\release\Full %SEVENZIPEXE% a -r -t7z %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.7z . %SEVENZIPEXE% a -r -tzip %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.zip . diff --git a/installer/changeDirHtmlDoc.xsl b/installer/changeDirHtmlDoc.xsl deleted file mode 100644 index 4be6120e..00000000 --- a/installer/changeDirHtmlDoc.xsl +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/installer/changeDirLib.xsl b/installer/changeDirLib.xsl deleted file mode 100644 index 3ac8c216..00000000 --- a/installer/changeDirLib.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/installer/changeDirSampleScripts.xsl b/installer/changeDirSampleScripts.xsl deleted file mode 100644 index 4a22bf16..00000000 --- a/installer/changeDirSampleScripts.xsl +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/installer/changeDirTests.xsl b/installer/changeDirTests.xsl deleted file mode 100644 index 9685a032..00000000 --- a/installer/changeDirTests.xsl +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/installer/extractVersion.py b/installer/extractVersion.py index ebbf5647..61ebaac1 100644 --- a/installer/extractVersion.py +++ b/installer/extractVersion.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + """Extracts the version number of PythonScript""" from __future__ import print_function diff --git a/installer/fixDirectoryAndFileRefs.xsl b/installer/fixDirectoryAndFileRefs.xsl deleted file mode 100644 index e086a6e4..00000000 --- a/installer/fixDirectoryAndFileRefs.xsl +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/installer/humanReadableSize.py b/installer/humanReadableSize.py index f6ce080a..f8ca443a 100644 --- a/installer/humanReadableSize.py +++ b/installer/humanReadableSize.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + from __future__ import print_function import sys, os @@ -9,4 +11,6 @@ def sizeof_format(size): size /= 1024.0 return "%3.1f%s" % (size, 'TB') +print(sys.argv[1]) + print(sizeof_format(os.stat(sys.argv[1]).st_size)) diff --git a/installer/updateLatestVersion.py b/installer/updateLatestVersion.py index 8247f36b..557879ae 100644 --- a/installer/updateLatestVersion.py +++ b/installer/updateLatestVersion.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + import sys, re versionRegex = re.compile('^\\s*Latest Version: ([0-9]+\\.){3}[0-9]+\\s*')