Skip to content

Commit 7c54a2c

Browse files
committed
fixed wix v5 issues after automatic transformation and adaptions for heat which is not part of wix tooling
- PythonScript.wxs(52) : error WIX0094: The identifier 'WixUI:WixUI_FeatureTree_X64' could not be found. Ensure you have typed the reference correctly and that all the necessary inputs are provided to the linker. - PythonScript.wxs(54) : warning WIX5437: It is no longer necessary to define the standard directory 'ProgramFiles64Folder'. Use the StandardDirectory element instead. Linking installer - generating MSI see also oleg-shilo/wixsharp#1655 for WIX5437 https://wixtoolset.org/docs/tools/wixext/wixui/ for WIX0094 add extension as described at https://wixtoolset.org/docs/tools/wixext/
1 parent b08c46e commit 7c54a2c

14 files changed

+81
-79
lines changed

.github/workflows/CI_build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
$env:PYTHONBUILDDIR_X64='${{ github.workspace }}\packages\python.3.12.8\tools'
4747
$env:PYTHONBUILDDIR='${{ github.workspace }}\packages\pythonx86.3.12.8\tools'
4848
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
49+
dotnet tool install --global wix
50+
$env:WIX_HEAT_PATH="${{ github.workspace }}\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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="WixToolset.UI.wixext" version="5.0.2" targetFramework="native" />
4+
<package id="WixToolset.Heat" version="5.0.2" targetFramework="native" />
35
<package id="boost" version="1.87.0" targetFramework="native" />
46
<package id="boost_python312-vc143" version="1.87.0" targetFramework="native" />
57
<package id="python" version="3.12.8" targetFramework="native" />

appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ after_build:
4242
- if "%configuration%"=="Release" make.bat html
4343

4444
- cd "%APPVEYOR_BUILD_FOLDER%"\installer
45-
- set WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.11\bin"
46-
- set PATH=%WIX_PATH%;%PATH%
45+
- dotnet tool install --global wix
46+
- set WIX_HEAT_PATH="%APPVEYOR_BUILD_FOLDER%"\packages\wixtoolset.heat.5.0.2\tools\net472\x64
47+
- set PATH=%WIX_HEAT_PATH%;%PATH%
4748
- if "%platform_input%"=="x64" SET PYTHONBUILDDIR_X64="%APPVEYOR_BUILD_FOLDER%"\packages\python.3.12.8\tools
4849
- if "%platform_input%"=="Win32" SET PYTHONBUILDDIR="%APPVEYOR_BUILD_FOLDER%"\packages\pythonx86.3.12.8\tools
4950
- copy "%APPVEYOR_BUILD_FOLDER%"\installer\buildPaths.bat.orig "%APPVEYOR_BUILD_FOLDER%"\installer\buildPaths.bat

installer/PythonScript.wxs

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

54
<?if $(var.Platform) = x64 ?>
65
<?define ProductName = "PythonScript plugin for Notepad++ (64 bit)" ?>
7-
<?define Win64 = "yes" ?>
8-
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
9-
<?else ?>
6+
<?define Win64 = "always64" ?>
7+
<?else?>
108
<?define ProductName = "PythonScript plugin for Notepad++" ?>
11-
<?define Win64 = "no" ?>
12-
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
13-
<?endif ?>
14-
15-
<Product Id="*" Language="1033" Manufacturer="Dave Brotherstone" Name="$(var.ProductName)"
16-
UpgradeCode="717FEC91-6F2B-459D-9868-0A3A037F5195"
17-
Version="$(var.version)">
18-
19-
9+
<?define Win64 = "always32" ?>
10+
<?endif?>
2011

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" />
12+
<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">
13+
<UpgradeVersion Minimum="0.0.0.0" Maximum="$(var.version)" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
2714
</Upgrade>
2815

29-
<Media Id='1' Cabinet='PythonScript.cab' EmbedCab='yes' />
30-
16+
<Media Id="1" Cabinet="PythonScript.cab" EmbedCab="yes" />
17+
3118
<InstallExecuteSequence>
32-
<RemoveExistingProducts Before="InstallInitialize" />
19+
<RemoveExistingProducts Before="InstallInitialize" />
3320
</InstallExecuteSequence>
3421

3522
<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>
6523

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">
24+
<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">
6825
<Feature Id="FT_PythonScript" Title="PythonScript plugin" AllowAdvertise="no">
6926
<ComponentRef Id="C_startup.py" />
7027
<ComponentRef Id="C_pythonscript.dll" />
@@ -86,13 +43,40 @@
8643
<ComponentGroupRef Id="CG_UnitTests" />
8744
</Feature>
8845
</Feature>
89-
46+
9047
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
9148
<WixVariable Id="WixUIBannerBmp" Value="images\banner.bmp" />
9249
<WixVariable Id="WixUIDialogBmp" Value="images\dialog.bmp" />
93-
<UIRef Id="WixUI_FeatureTree" />
94-
95-
</Product>
50+
<ui:WixUI Id="WixUI_FeatureTree" />
51+
52+
<StandardDirectory Id="ProgramFiles6432Folder">
53+
<Directory Id="INSTALLDIR" Name="Notepad++">
54+
<Directory Id="D_Plugins" Name="plugins">
55+
<Directory Id="D_PythonScript" Name="PythonScript">
56+
<Directory Id="D_PythonLib" Name="lib" />
57+
<Directory Id="D_Scripts" Name="scripts">
58+
<Component Id="C_startup.py" Bitness="$(var.Win64)">
59+
<RemoveFile Id="Remove_F_startup.py" Name="startup.py" On="install" />
60+
<RemoveFile Id="Remove_F_startup.pyc" Name="startup.pyc" On="install" />
61+
<File Id="F_startup.py" KeyPath="yes" Name="startup.py" Source="$(var.baseDir)\scripts\startup.py" />
62+
</Component>
63+
<Directory Id="D_npp_unit_tests" Name="npp_unit_tests" />
64+
<Directory Id="D_SampleScripts" Name="Samples" />
65+
</Directory>
66+
<Directory Id="D_DocPythonScript" Name="doc" />
67+
<Component Id="C_pythonscript.dll" Bitness="$(var.Win64)">
68+
<RemoveFile Id="Remove_F_pythonscript.dll" Name="PythonScript.dll" On="install" />
69+
<File Id="F_pythonscript.dll" Name="PythonScript.dll" Source="$(var.baseDir)\$(var.variantDir)\Release\PythonScript.dll" />
70+
</Component>
71+
<Component Id="C_python312.dll" Bitness="$(var.Win64)">
72+
<RemoveFile Id="Remove_F_python312.dll" Name="python312.dll" On="install" />
73+
<File Id="F_python312.dll" Name="python312.dll" Source="$(var.pythonDir)\python312.dll" />
74+
</Component>
75+
</Directory>
76+
</Directory>
77+
</Directory>
78+
</StandardDirectory>
79+
</Package>
9680

9781

9882
</Wix>

installer/buildInstaller.bat

Lines changed: 16 additions & 10 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.wixlib -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%.wixlib -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.wixlib -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%.wixlib -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.wixlib -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.wixlib -d unittestSource=..\PythonScript\python_tests -arch %MSI_ARCH%
115115
if NOT [%ERRORLEVEL%]==[0] (
116116
goto error
117117
)
@@ -123,13 +123,20 @@ 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.wixlib -d htmldocsSource=..\docs\build\html -arch %MSI_ARCH%
127127
if NOT [%ERRORLEVEL%]==[0] (
128128
goto error
129129
)
130130

131+
cd ..\packages
132+
echo add UI extension globally
133+
wix extension add -g WixToolset.UI.wixext
134+
wix extension list -g
135+
cd ..\installer
136+
137+
131138
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%
139+
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"
133140
if NOT [%ERRORLEVEL%]==[0] (
134141
goto error
135142
)
@@ -140,8 +147,7 @@ IF NOT EXIST "build\%PYTHONSCRIPTVERSION%" (
140147
mkdir build\%PYTHONSCRIPTVERSION%
141148
)
142149

143-
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
150+
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"
145151
if NOT [%ERRORLEVEL%]==[0] (
146152
goto error
147153
)

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/changeDirHtmlDoc.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" version="1.0">
1+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" version="1.0">
22

33
<xsl:output method="xml" indent="yes" />
44
<xsl:param name="realDirectoryId" select="'D_DocPythonScript'" />

installer/changeDirLib.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" version="1.0">
1+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" version="1.0">
22

33

44
<xsl:output method="xml" indent="yes" />

installer/changeDirSampleScripts.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" version="1.0">
1+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" version="1.0">
22

33
<xsl:output method="xml" indent="yes" />
44
<xsl:param name="realDirectoryId" select="'D_SampleScripts'" />

installer/changeDirTests.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" version="1.0">
1+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" version="1.0">
22

33
<xsl:output method="xml" indent="yes" />
44
<xsl:param name="realDirectoryId" select="'D_npp_unit_tests'" />

0 commit comments

Comments
 (0)