Skip to content

Commit 85b0c43

Browse files
committed
test wix v5 build
1 parent a48411a commit 85b0c43

File tree

8 files changed

+67
-66
lines changed

8 files changed

+67
-66
lines changed

.github/workflows/CI_build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ jobs:
4343
if: matrix.build_configuration == 'Release'
4444
working-directory: installer
4545
run: |
46-
$env:PYTHONBUILDDIR_X64='..\packages\python.3.12.8\tools'
47-
$env:PYTHONBUILDDIR='..\packages\pythonx86.3.12.8\tools'
46+
dotnet tool install --global wix
47+
echo ${{ github.workspace }}
48+
MY_WORK_DIR=${{ github.workspace }}
49+
echo $MY_WORK_DIR
50+
$env:PYTHONBUILDDIR_X64='${{ github.workspace }}\..\packages\python.3.12.8\tools'
51+
$env:PYTHONBUILDDIR='${{ github.workspace }}\..\packages\pythonx86.3.12.8\tools'
4852
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
53+
$env:WIX_HEAT_PATH="${{ github.workspace }}\..\packages\wixtoolset.heat.5.0.2\tools\net472\x64"
54+
$env:PATH = $env:WIX_HEAT_PATH + ';' + $env:PATH
5155
.\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: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if NOT [%ERRORLEVEL%]==[0] (
5050
)
5151

5252
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%
53+
wix build %INST_TEMP_DIR%\fullLib.wxs -o %INST_TEMP_DIR%\fullLib.wixobj -d pylibSource=..\pythonlib\full -arch %MSI_ARCH%
5454
if NOT [%ERRORLEVEL%]==[0] (
5555
goto error
5656
)
@@ -62,7 +62,7 @@ if NOT [%ERRORLEVEL%]==[0] (
6262
)
6363

6464
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%
65+
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%
6666
if NOT [%ERRORLEVEL%]==[0] (
6767
goto error
6868
)
@@ -74,7 +74,7 @@ if NOT [%ERRORLEVEL%]==[0] (
7474
)
7575

7676
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%
77+
wix build %INST_TEMP_DIR%\tcl.wxs -o %INST_TEMP_DIR%\tcl.wixobj -d pylibSource=..\pythonlib\tcl -arch %MSI_ARCH%
7878
if NOT [%ERRORLEVEL%]==[0] (
7979
goto error
8080
)
@@ -86,7 +86,7 @@ if NOT [%ERRORLEVEL%]==[0] (
8686
)
8787

8888
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%
89+
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%
9090
if NOT [%ERRORLEVEL%]==[0] (
9191
goto error
9292
)
@@ -98,7 +98,7 @@ if NOT [%ERRORLEVEL%]==[0] (
9898
)
9999

100100
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%
101+
wix build %INST_TEMP_DIR%\sampleScripts.wxs -o %INST_TEMP_DIR%\sampleScripts.wixobj -d scriptSource=..\scripts\Samples -arch %MSI_ARCH%
102102
if NOT [%ERRORLEVEL%]==[0] (
103103
goto error
104104
)
@@ -111,7 +111,7 @@ if NOT [%ERRORLEVEL%]==[0] (
111111
)
112112

113113
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%
114+
wix build %INST_TEMP_DIR%\unittests.wxs -o %INST_TEMP_DIR%\unittests.wixobj -d unittestSource=..\PythonScript\python_tests -arch %MSI_ARCH%
115115
if NOT [%ERRORLEVEL%]==[0] (
116116
goto error
117117
)
@@ -123,13 +123,13 @@ if NOT [%ERRORLEVEL%]==[0] (
123123
)
124124

125125
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%
126+
wix build %INST_TEMP_DIR%\htmldoc.wxs -o %INST_TEMP_DIR%\htmldoc.wixobj -d htmldocsSource=..\docs\build\html -arch %MSI_ARCH%
127127
if NOT [%ERRORLEVEL%]==[0] (
128128
goto error
129129
)
130130

131131
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%
132+
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%
133133
if NOT [%ERRORLEVEL%]==[0] (
134134
goto error
135135
)
@@ -141,7 +141,7 @@ IF NOT EXIST "build\%PYTHONSCRIPTVERSION%" (
141141
)
142142

143143

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
144+
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
145145
if NOT [%ERRORLEVEL%]==[0] (
146146
goto error
147147
)

installer/buildReleaseZips.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ mkdir %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%
103103
cd %INST_TEMP_DIR%\release\Full\plugins\PythonScript
104104
%SEVENZIPEXE% a -r -tzip %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%_PluginAdmin.zip .
105105

106-
cd %INST_TEMP_DIR%\release\Full
106+
cd %INSTALLERDIR%\%INST_TEMP_DIR%\release\Full
107107
%SEVENZIPEXE% a -r -t7z %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.7z .
108108
%SEVENZIPEXE% a -r -tzip %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.zip .
109109

installer/extractVersion.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
13
"""Extracts the version number of PythonScript"""
24
from __future__ import print_function
35

installer/humanReadableSize.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
13
from __future__ import print_function
24
import sys, os
35

@@ -9,4 +11,6 @@ def sizeof_format(size):
911
size /= 1024.0
1012
return "%3.1f%s" % (size, 'TB')
1113

14+
print(sys.argv[1])
15+
1216
print(sizeof_format(os.stat(sys.argv[1]).st_size))

installer/updateLatestVersion.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
13
import sys, re
24

35
versionRegex = re.compile('^\\s*Latest Version: ([0-9]+\\.){3}[0-9]+\\s*')

0 commit comments

Comments
 (0)