Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
…et.org/docs/schema/wxs/files/ , wixtoolset/issues#7857) instead of heat for file harvesting

- remove unused xsl msi scripts

TODO:
Remove also __pycache__ dirs on unistall, maybe also pyc files
  • Loading branch information
chcg committed Dec 30, 2024
commit 2b6713aa4a81bff4bbcaf1dee73e799e4532bc96
2 changes: 0 additions & 2 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,4 @@ jobs:
$env:PYTHONBUILDDIR='${{ github.workspace }}\packages\pythonx86.3.12.8\tools'
Rename-Item -Path ".\buildPaths.bat.orig" -NewName "buildPaths.bat"
dotnet tool install --global wix
$env:WIX_HEAT_PATH="${{ github.workspace }}\packages\wixtoolset.heat.5.0.2\tools\net472\x64"
$env:PATH = $env:WIX_HEAT_PATH + ';' + $env:PATH
.\buildAll.bat ${{ matrix.build_platform }}
1 change: 0 additions & 1 deletion PythonScript/project/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WixToolset.UI.wixext" version="5.0.2" targetFramework="native" />
<package id="WixToolset.Heat" version="5.0.2" targetFramework="native" />
<package id="boost" version="1.87.0" targetFramework="native" />
<package id="boost_python312-vc143" version="1.87.0" targetFramework="native" />
<package id="python" version="3.12.8" targetFramework="native" />
Expand Down
1 change: 1 addition & 0 deletions PythonScript/project/packages_local_pydebug.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WixToolset.UI.wixext" version="5.0.2" targetFramework="native" />
<package id="boost" version="1.87.0" targetFramework="native" />
<package id="boost_python312-vc143" version="1.87.0" targetFramework="native" />
</packages>
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ after_build:

- cd "%APPVEYOR_BUILD_FOLDER%"\installer
- dotnet tool install --global wix
- set WIX_HEAT_PATH="%APPVEYOR_BUILD_FOLDER%"\packages\wixtoolset.heat.5.0.2\tools\net472\x64
- set PATH=%WIX_HEAT_PATH%;%PATH%
- 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
Expand Down
39 changes: 33 additions & 6 deletions installer/PythonScript.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

<?if $(var.Platform) = x64 ?>
<?define ProductName = "PythonScript plugin for Notepad++ (64 bit)" ?>
<?define Win64 = "always64" ?>
<?else?>
<?define ProductName = "PythonScript plugin for Notepad++" ?>
<?define Win64 = "always32" ?>
<?endif?>

<Package Language="1033" Manufacturer="Dave Brotherstone" Name="$(var.ProductName)" UpgradeCode="717FEC91-6F2B-459D-9868-0A3A037F5195" Version="$(var.version)" InstallerVersion="200"><Upgrade Id="717FEC91-6F2B-459D-9868-0A3A037F5195">
Expand Down Expand Up @@ -40,7 +38,7 @@
<ComponentGroupRef Id="CG_PythonTclTkLibDll" />
</Feature>
<Feature Id="FT_UnitTests" Title="Unit Tests" Level="10" AllowAdvertise="no" Description="Unit tests for PythonScript. Not usually necessary, but if you are having problems, any issues reported from the tests will be useful for diagnosis.">
<ComponentGroupRef Id="CG_UnitTests" />
<ComponentGroupRef Id="CG_Unittests" />
</Feature>
</Feature>

Expand All @@ -49,13 +47,42 @@
<WixVariable Id="WixUIDialogBmp" Value="images\dialog.bmp" />
<ui:WixUI Id="WixUI_FeatureTree" />

<ComponentGroup Id="CG_PythonLib" Directory="D_PythonLib">
<Files Include="..\pythonlib\full\**" />
</ComponentGroup>

<ComponentGroup Id="CG_PythonLibDll" Directory="D_PythonLib">
<Files Include="..\pythonlib\full_dll$(var.nameAddon)\**" />
</ComponentGroup>

<ComponentGroup Id="CG_HtmlDocs" Directory="D_DocPythonScript">
<Files Include="..\docs\build\html\**" />
</ComponentGroup>

<ComponentGroup Id="CG_SampleScripts" Directory="D_SampleScripts">
<Files Include="..\scripts\Samples\**" />
</ComponentGroup>

<ComponentGroup Id="CG_PythonTclTkLib" Directory="D_PythonLib">
<Files Include="..\pythonlib\tcl\**" />
</ComponentGroup>

<ComponentGroup Id="CG_PythonTclTkLibDll" Directory="D_PythonLib">
<Files Include="..\pythonlib\tcl_dll$(var.nameAddon)\**" />
</ComponentGroup>

<ComponentGroup Id="CG_Unittests" Directory="D_npp_unit_tests">
<Files Include="..\PythonScript\python_tests\**" />
</ComponentGroup>


<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLDIR" Name="Notepad++">
<Directory Id="D_Plugins" Name="plugins">
<Directory Id="D_PythonScript" Name="PythonScript">
<Directory Id="D_PythonLib" Name="lib" />
<Directory Id="D_Scripts" Name="scripts">
<Component Id="C_startup.py" Bitness="$(var.Win64)">
<Component Id="C_startup.py">
<RemoveFile Id="Remove_F_startup.py" Name="startup.py" On="install" />
<RemoveFile Id="Remove_F_startup.pyc" Name="startup.pyc" On="install" />
<File Id="F_startup.py" KeyPath="yes" Name="startup.py" Source="$(var.baseDir)\scripts\startup.py" />
Expand All @@ -64,11 +91,11 @@
<Directory Id="D_SampleScripts" Name="Samples" />
</Directory>
<Directory Id="D_DocPythonScript" Name="doc" />
<Component Id="C_pythonscript.dll" Bitness="$(var.Win64)">
<Component Id="C_pythonscript.dll">
<RemoveFile Id="Remove_F_pythonscript.dll" Name="PythonScript.dll" On="install" />
<File Id="F_pythonscript.dll" Name="PythonScript.dll" Source="$(var.baseDir)\$(var.variantDir)\Release\PythonScript.dll" />
</Component>
<Component Id="C_python312.dll" Bitness="$(var.Win64)">
<Component Id="C_python312.dll">
<RemoveFile Id="Remove_F_python312.dll" Name="python312.dll" On="install" />
<File Id="F_python312.dll" Name="python312.dll" Source="$(var.pythonDir)\python312.dll" />
</Component>
Expand Down
100 changes: 2 additions & 98 deletions installer/buildInstaller.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,111 +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
wix build %INST_TEMP_DIR%\fullLib.wxs -o %INST_TEMP_DIR%\fullLib.wixlib -d pylibSource=..\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
wix build %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wixlib -d pylibSource=..\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
wix build %INST_TEMP_DIR%\tcl.wxs -o %INST_TEMP_DIR%\tcl.wixlib -d pylibSource=..\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
wix build %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wixlib -d pylibSource=..\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
wix build %INST_TEMP_DIR%\sampleScripts.wxs -o %INST_TEMP_DIR%\sampleScripts.wixlib -d scriptSource=..\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
wix build %INST_TEMP_DIR%\unittests.wxs -o %INST_TEMP_DIR%\unittests.wixlib -d unittestSource=..\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
wix build %INST_TEMP_DIR%\htmldoc.wxs -o %INST_TEMP_DIR%\htmldoc.wixlib -d htmldocsSource=..\docs\build\html -arch %MSI_ARCH%
if NOT [%ERRORLEVEL%]==[0] (
goto error
)

cd ..\packages
echo add UI extension globally
wix extension add -g WixToolset.UI.wixext
wix extension list -g
cd ..\installer


echo Compiling main PythonScript installer
wix build pythonscript.wxs -o %INST_TEMP_DIR%\pythonscript.wixlib -d version=%PYTHONSCRIPTVERSION% -d baseDir=.. -d pythonDir=%PYTHONBUILDDIR% -d variantDir=%PYTHONSCRIPTDLLDIR% -d Platform=%MSI_ARCH% -arch %MSI_ARCH% -ext "WixToolset.UI.wixext"
if NOT [%ERRORLEVEL%]==[0] (
goto error
)


echo Linking installer - generating MSI
IF NOT EXIST "build\%PYTHONSCRIPTVERSION%" (
mkdir build\%PYTHONSCRIPTVERSION%
)

wix build %INST_TEMP_DIR%\pythonscript.wixlib %INST_TEMP_DIR%\fullLib.wixlib %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wixlib %INST_TEMP_DIR%\unittests.wixlib %INST_TEMP_DIR%\tcl.wixlib %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wixlib %INST_TEMP_DIR%\sampleScripts.wixlib %INST_TEMP_DIR%\htmldoc.wixlib -o build\%PYTHONSCRIPTVERSION%\PythonScript_%PYTHONSCRIPTVERSION%%NAME_ADDON%.msi -ext "WixToolset.UI.wixext"
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
)
Expand Down
7 changes: 0 additions & 7 deletions installer/changeDirHtmlDoc.xsl

This file was deleted.

10 changes: 0 additions & 10 deletions installer/changeDirLib.xsl

This file was deleted.

7 changes: 0 additions & 7 deletions installer/changeDirSampleScripts.xsl

This file was deleted.

7 changes: 0 additions & 7 deletions installer/changeDirTests.xsl

This file was deleted.

79 changes: 0 additions & 79 deletions installer/fixDirectoryAndFileRefs.xsl

This file was deleted.