Skip to content

Commit c15d2ee

Browse files
committed
test wix v5 build
1 parent a48411a commit c15d2ee

File tree

5 files changed

+71
-64
lines changed

5 files changed

+71
-64
lines changed

.github/workflows/CI_build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ jobs:
4343
if: matrix.build_configuration == 'Release'
4444
working-directory: installer
4545
run: |
46+
dotnet tool install --global wix
4647
$env:PYTHONBUILDDIR_X64='..\packages\python.3.12.8\tools'
4748
$env:PYTHONBUILDDIR='..\packages\pythonx86.3.12.8\tools'
4849
Rename-Item -Path ".\buildPaths.bat.orig" -NewName "buildPaths.bat"
49-
$env:WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.11\bin"
50-
$env:PATH = $env:PATH + ';' + $env:WIX_PATH
50+
$env:WIX_HEAT_PATH="..\packages\wixtoolset.heat.5.0.2\tools\net472\x64"
51+
$env:PATH = $env:WIX_HEAT_PATH + ';' + $env:PATH
5152
.\buildAll.bat ${{ matrix.build_platform }}

PythonScript/project/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="WixToolset.Heat" version="5.0.2" targetFramework="native" />
34
<package id="boost" version="1.86.0" targetFramework="native" />
45
<package id="boost_python312-vc143" version="1.86.0" targetFramework="native" />
56
<package id="python" version="3.12.8" targetFramework="native" />

installer/PythonScript.wxs

Lines changed: 40 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,30 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
32

43

54
<?if $(var.Platform) = x64 ?>
65
<?define ProductName = "PythonScript plugin for Notepad++ (64 bit)" ?>
7-
<?define Win64 = "yes" ?>
6+
<?define Win64 = "always64" ?>
87
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
9-
<?else ?>
8+
<?else?>
109
<?define ProductName = "PythonScript plugin for Notepad++" ?>
11-
<?define Win64 = "no" ?>
10+
<?define Win64 = "always32" ?>
1211
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
13-
<?endif ?>
12+
<?endif?>
1413

15-
<Product Id="*" Language="1033" Manufacturer="Dave Brotherstone" Name="$(var.ProductName)"
16-
UpgradeCode="717FEC91-6F2B-459D-9868-0A3A037F5195"
17-
Version="$(var.version)">
18-
19-
20-
21-
<Package Id='*' InstallerVersion='200' Platform="$(var.Platform)" Compressed='yes' />
22-
23-
<Upgrade Id="717FEC91-6F2B-459D-9868-0A3A037F5195">
24-
<UpgradeVersion Minimum="0.0.0.0" Maximum="$(var.version)"
25-
Property="PREVIOUSVERSIONSINSTALLED"
26-
IncludeMinimum="yes" IncludeMaximum="no" />
14+
<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">
15+
<UpgradeVersion Minimum="0.0.0.0" Maximum="$(var.version)" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
2716
</Upgrade>
2817

29-
<Media Id='1' Cabinet='PythonScript.cab' EmbedCab='yes' />
18+
<Media Id="1" Cabinet="PythonScript.cab" EmbedCab="yes" />
3019

3120
<InstallExecuteSequence>
3221
<RemoveExistingProducts Before="InstallInitialize" />
3322
</InstallExecuteSequence>
3423

3524
<Property Id="INSTALLLEVEL" Value="5" />
36-
<Directory Id="TARGETDIR" Name="SourceDir">
37-
<Directory Id="$(var.PlatformProgramFilesFolder)">
38-
<Directory Id="INSTALLDIR" Name="Notepad++">
39-
<Directory Id="D_Plugins" Name="plugins">
40-
<Directory Id="D_PythonScript" Name="PythonScript">
41-
<Directory Id="D_PythonLib" Name="lib" />
42-
<Directory Id="D_Scripts" Name="scripts">
43-
<Component Id="C_startup.py" Guid="*" Win64="$(var.Win64)">
44-
<RemoveFile Id="Remove_F_startup.py" Name="startup.py" On="install"/>
45-
<RemoveFile Id="Remove_F_startup.pyc" Name="startup.pyc" On="install"/>
46-
<File Id="F_startup.py" KeyPath="yes" Name="startup.py" Source="$(var.baseDir)\scripts\startup.py" />
47-
</Component>
48-
<Directory Id="D_npp_unit_tests" Name="npp_unit_tests" />
49-
<Directory Id="D_SampleScripts" Name="Samples" />
50-
</Directory>
51-
<Directory Id="D_DocPythonScript" Name="doc"/>
52-
<Component Id="C_pythonscript.dll" Guid="*" Win64="$(var.Win64)">
53-
<RemoveFile Id="Remove_F_pythonscript.dll" Name="PythonScript.dll" On="install"/>
54-
<File Id="F_pythonscript.dll" Name="PythonScript.dll" Source="$(var.baseDir)\$(var.variantDir)\Release\PythonScript.dll" />
55-
</Component>
56-
<Component Id="C_python312.dll" Guid="*" Win64="$(var.Win64)">
57-
<RemoveFile Id="Remove_F_python312.dll" Name="python312.dll" On="install"/>
58-
<File Id="F_python312.dll" Name="python312.dll" Source="$(var.pythonDir)\python312.dll" />
59-
</Component>
60-
</Directory>
61-
</Directory>
62-
</Directory>
63-
</Directory>
64-
</Directory>
25+
6526

66-
<Feature Id="FT_PythonScriptAll" Title="PythonScript Components" Display="expand" AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR"
67-
Description="Install directory should be the install directory of your Notepad++ directory">
27+
<Feature Id="FT_PythonScriptAll" Title="PythonScript Components" Display="expand" AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR" Description="Install directory should be the install directory of your Notepad++ directory">
6828
<Feature Id="FT_PythonScript" Title="PythonScript plugin" AllowAdvertise="no">
6929
<ComponentRef Id="C_startup.py" />
7030
<ComponentRef Id="C_pythonscript.dll" />
@@ -90,9 +50,37 @@
9050
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
9151
<WixVariable Id="WixUIBannerBmp" Value="images\banner.bmp" />
9252
<WixVariable Id="WixUIDialogBmp" Value="images\dialog.bmp" />
93-
<UIRef Id="WixUI_FeatureTree" />
53+
<ui:WixUI Id="WixUI_FeatureTree" />
9454

95-
</Product>
55+
56+
<Directory Id="$(var.PlatformProgramFilesFolder)">
57+
<Directory Id="INSTALLDIR" Name="Notepad++">
58+
<Directory Id="D_Plugins" Name="plugins">
59+
<Directory Id="D_PythonScript" Name="PythonScript">
60+
<Directory Id="D_PythonLib" Name="lib" />
61+
<Directory Id="D_Scripts" Name="scripts">
62+
<Component Id="C_startup.py" Bitness="$(var.Win64)">
63+
<RemoveFile Id="Remove_F_startup.py" Name="startup.py" On="install" />
64+
<RemoveFile Id="Remove_F_startup.pyc" Name="startup.pyc" On="install" />
65+
<File Id="F_startup.py" KeyPath="yes" Name="startup.py" Source="$(var.baseDir)\scripts\startup.py" />
66+
</Component>
67+
<Directory Id="D_npp_unit_tests" Name="npp_unit_tests" />
68+
<Directory Id="D_SampleScripts" Name="Samples" />
69+
</Directory>
70+
<Directory Id="D_DocPythonScript" Name="doc" />
71+
<Component Id="C_pythonscript.dll" Bitness="$(var.Win64)">
72+
<RemoveFile Id="Remove_F_pythonscript.dll" Name="PythonScript.dll" On="install" />
73+
<File Id="F_pythonscript.dll" Name="PythonScript.dll" Source="$(var.baseDir)\$(var.variantDir)\Release\PythonScript.dll" />
74+
</Component>
75+
<Component Id="C_python312.dll" Bitness="$(var.Win64)">
76+
<RemoveFile Id="Remove_F_python312.dll" Name="python312.dll" On="install" />
77+
<File Id="F_python312.dll" Name="python312.dll" Source="$(var.pythonDir)\python312.dll" />
78+
</Component>
79+
</Directory>
80+
</Directory>
81+
</Directory>
82+
</Directory>
83+
</Package>
9684

9785

9886
</Wix>

installer/buildInstaller.bat

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ SET /p PYTHONSCRIPTVERSION= < %INST_TEMP_DIR%\version.txt
4444

4545

4646
echo Generating WiX information for ..\pythonlib\full
47-
heat dir ..\pythonlib\full -ag -cg CG_PythonLib -dr D_PythonScript -var var.pylibSource -t changeDirLib.xsl -o %INST_TEMP_DIR%\fullLib.wxs
47+
heat dir -?
48+
heat dir ..\pythonlib\full -ag -cg CG_PythonLib -dr D_PythonScript -var var.pylibSource -t changeDirLib.xsl -out %INST_TEMP_DIR%\fullLib.wxs
4849
if NOT [%ERRORLEVEL%]==[0] (
4950
goto error
5051
)
5152

5253
echo Compiling python lib WiX source
53-
candle %INST_TEMP_DIR%\fullLib.wxs -o %INST_TEMP_DIR%\fullLib.wixobj -dpylibSource=..\pythonlib\full -arch %MSI_ARCH%
54+
wix build %INST_TEMP_DIR%\fullLib.wxs -o %INST_TEMP_DIR%\fullLib.wixobj -d pylibSource=..\pythonlib\full -arch %MSI_ARCH%
5455
if NOT [%ERRORLEVEL%]==[0] (
5556
goto error
5657
)
@@ -62,7 +63,7 @@ if NOT [%ERRORLEVEL%]==[0] (
6263
)
6364

6465
echo Compiling python pyd lib WiX source
65-
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%
66+
wix build %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wixobj -d pylibSource=..\pythonlib\full_dll%NAME_ADDON% -arch %MSI_ARCH%
6667
if NOT [%ERRORLEVEL%]==[0] (
6768
goto error
6869
)
@@ -74,7 +75,7 @@ if NOT [%ERRORLEVEL%]==[0] (
7475
)
7576

7677
echo Compiling tcl lib WiX source
77-
candle %INST_TEMP_DIR%\tcl.wxs -o %INST_TEMP_DIR%\tcl.wixobj -dpylibSource=..\pythonlib\tcl -arch %MSI_ARCH%
78+
wix build %INST_TEMP_DIR%\tcl.wxs -o %INST_TEMP_DIR%\tcl.wixobj -d pylibSource=..\pythonlib\tcl -arch %MSI_ARCH%
7879
if NOT [%ERRORLEVEL%]==[0] (
7980
goto error
8081
)
@@ -86,7 +87,7 @@ if NOT [%ERRORLEVEL%]==[0] (
8687
)
8788

8889
echo Compiling tcl lib WiX source
89-
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%
90+
wix build %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wixobj -d pylibSource=..\pythonlib\tcl_dll%NAME_ADDON% -arch %MSI_ARCH%
9091
if NOT [%ERRORLEVEL%]==[0] (
9192
goto error
9293
)
@@ -98,7 +99,7 @@ if NOT [%ERRORLEVEL%]==[0] (
9899
)
99100

100101
echo Compiling Sample Scripts WiX source
101-
candle %INST_TEMP_DIR%\sampleScripts.wxs -o %INST_TEMP_DIR%\sampleScripts.wixobj -dscriptSource=..\scripts\Samples -arch %MSI_ARCH%
102+
wix build %INST_TEMP_DIR%\sampleScripts.wxs -o %INST_TEMP_DIR%\sampleScripts.wixobj -d scriptSource=..\scripts\Samples -arch %MSI_ARCH%
102103
if NOT [%ERRORLEVEL%]==[0] (
103104
goto error
104105
)
@@ -111,7 +112,7 @@ if NOT [%ERRORLEVEL%]==[0] (
111112
)
112113

113114
echo Compiling Unit test WiX source
114-
candle %INST_TEMP_DIR%\unittests.wxs -o %INST_TEMP_DIR%\unittests.wixobj -dunittestSource=..\PythonScript\python_tests -arch %MSI_ARCH%
115+
wix build %INST_TEMP_DIR%\unittests.wxs -o %INST_TEMP_DIR%\unittests.wixobj -d unittestSource=..\PythonScript\python_tests -arch %MSI_ARCH%
115116
if NOT [%ERRORLEVEL%]==[0] (
116117
goto error
117118
)
@@ -123,13 +124,13 @@ if NOT [%ERRORLEVEL%]==[0] (
123124
)
124125

125126
echo Compiling Html doc WiX source
126-
candle %INST_TEMP_DIR%\htmldoc.wxs -o %INST_TEMP_DIR%\htmldoc.wixobj -dhtmldocsSource=..\docs\build\html -arch %MSI_ARCH%
127+
wix build %INST_TEMP_DIR%\htmldoc.wxs -o %INST_TEMP_DIR%\htmldoc.wixobj -d htmldocsSource=..\docs\build\html -arch %MSI_ARCH%
127128
if NOT [%ERRORLEVEL%]==[0] (
128129
goto error
129130
)
130131

131132
echo Compiling main PythonScript installer
132-
candle pythonscript.wxs -o %INST_TEMP_DIR%\pythonscript.wixobj -dversion=%PYTHONSCRIPTVERSION% -dbaseDir=.. -dpythonDir=%PYTHONBUILDDIR% -dvariantDir=%PYTHONSCRIPTDLLDIR% -dPlatform=%MSI_ARCH% -arch %MSI_ARCH%
133+
wix build pythonscript.wxs -o %INST_TEMP_DIR%\pythonscript.wixobj -d version=%PYTHONSCRIPTVERSION% -d baseDir=.. -dpythonDir=%PYTHONBUILDDIR% -d variantDir=%PYTHONSCRIPTDLLDIR% -d Platform=%MSI_ARCH% -arch %MSI_ARCH%
133134
if NOT [%ERRORLEVEL%]==[0] (
134135
goto error
135136
)
@@ -141,7 +142,7 @@ IF NOT EXIST "build\%PYTHONSCRIPTVERSION%" (
141142
)
142143

143144

144-
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
145+
wix build %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 extension add WixUIExtension
145146
if NOT [%ERRORLEVEL%]==[0] (
146147
goto error
147148
)

installer/buildReleaseZips.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,34 @@ cd %INSTALLERDIR%\%INST_TEMP_DIR%\release\Tcl
117117

118118
%SEVENZIPEXE% a -t7z %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_PDB_%PYTHONSCRIPTVERSION%%NAME_ADDON%.7z %INSTALLERDIR%\..\%PYTHONSCRIPTDLLDIR%\release\PythonScript.pdb
119119

120+
120121
echo Updating local download webpage
121122
echo ^<!--#include virtual="header.inc" --^> > %INSTALLERDIR%\..\www\localdl.shtml
122123
echo ^<h3^>Local Download^</h3^> >> %INSTALLERDIR%\..\www\localdl.shtml
123124
echo Here are the local server links if you can't get to ^<a href="http://sourceforge.net/projects/npppythonscript/files"^>the main one at sourceforge^</a^>. >> %INSTALLERDIR%\..\www\localdl.shtml
124125
echo Please use the sourceforge link if you can - I have limited bandwidth limits. >> %INSTALLERDIR%\..\www\localdl.shtml
125126
echo ^<br/^>^<br/^>^<br/^> >> %INSTALLERDIR%\..\www\localdl.shtml
126127

128+
echo header added to local download webpage
129+
130+
echo %INSTALLERDIR%\%INST_TEMP_DIR%
131+
echo %PYTHONSCRIPTVERSION%%NAME_ADDON%
132+
127133
%PYTHONBUILDDIR%\python %INSTALLERDIR%\humanReadableSize.py %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_%PYTHONSCRIPTVERSION%%NAME_ADDON%.msi > %INSTALLERDIR%\%INST_TEMP_DIR%\size.txt
134+
135+
echo header added to local download webpage 1
136+
137+
128138
SET /p PYTHONSCRIPT_FILESIZE= < %INSTALLERDIR%\%INST_TEMP_DIR%\size.txt
129139

140+
echo header added to local download webpage 2
141+
142+
130143
echo ^<br/^>^<a href="http://www.brotherstone.co.uk/npp/ps/downloads/%PYTHONSCRIPTVERSION%/PythonScript_%PYTHONSCRIPTVERSION%%NAME_ADDON%.msi"^>Python Script %PYTHONSCRIPTVERSION% Installer (includes all extra files) (%PYTHONSCRIPT_FILESIZE%)^</a^> >> %INSTALLERDIR%\..\www\localdl.shtml
131144

145+
echo header added to local download webpage 3
146+
147+
132148
%PYTHONBUILDDIR%\python %INSTALLERDIR%\humanReadableSize.py %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.7z > %INSTALLERDIR%\%INST_TEMP_DIR%\size.txt
133149
SET /p PYTHONSCRIPT_FILESIZE= < %INSTALLERDIR%\%INST_TEMP_DIR%\size.txt
134150
echo ^<br/^>^<a href="http://www.brotherstone.co.uk/npp/ps/downloads/%PYTHONSCRIPTVERSION%/PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.7z"^>Python Script %PYTHONSCRIPTVERSION% FULL 7zip version (%PYTHONSCRIPT_FILESIZE%)^</a^> >> %INSTALLERDIR%\..\www\localdl.shtml

0 commit comments

Comments
 (0)