Skip to content

Commit 60da2b2

Browse files
authored
- adapt zip structure to the changed plugin dir since N++ 7.6, but N++ 7.8 is needed to be able to load the python2.7 dll from plugin dir (bruderstein#131)
- adapt local doc search path - adapt msi + try to fix bruderstein#118
1 parent 75cf870 commit 60da2b2

File tree

4 files changed

+59
-45
lines changed

4 files changed

+59
-45
lines changed

PythonScript/src/HelpController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ std::wstring HelpController::getFilename()
4747
{
4848
TCHAR helpPath[MAX_PATH];
4949
::SendMessage(m_hNotepad, NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast<LPARAM>(helpPath));
50-
_tcscat_s(helpPath, MAX_PATH, _T("\\plugins\\doc\\PythonScript"));
50+
_tcscat_s(helpPath, MAX_PATH, _T("\\plugins\\PythonScript\\doc\\PythonScript"));
5151

5252
if (::PathFileExists(helpPath))
5353
{

installer/PythonScript.wxs

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33

44

5-
<Product Id="*" Language="1033" Manufacturer="Dave Brotherstone" Name="PythonScript plugin for Notepad++"
5+
<?if $(var.Platform) = x64 ?>
6+
<?define ProductName = "PythonScript plugin for Notepad++ (64 bit)" ?>
7+
<?define Win64 = "yes" ?>
8+
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
9+
<?else ?>
10+
<?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)"
616
UpgradeCode="717FEC91-6F2B-459D-9868-0A3A037F5195"
717
Version="$(var.version)">
818

919

1020

11-
<Package Id='*' InstallerVersion='200' Compressed='yes' />
21+
<Package Id='*' InstallerVersion='200' Platform="$(var.Platform)" Compressed='yes' />
1222

1323
<Upgrade Id="717FEC91-6F2B-459D-9868-0A3A037F5195">
1424
<UpgradeVersion Minimum="0.0.0.0" Maximum="$(var.version)"
@@ -24,33 +34,33 @@
2434

2535
<Property Id="INSTALLLEVEL" Value="5" />
2636
<Directory Id="TARGETDIR" Name="SourceDir">
27-
<Directory Id="ProgramFilesFolder">
37+
<Directory Id="$(var.PlatformProgramFilesFolder)">
2838
<Directory Id="INSTALLDIR" Name="Notepad++">
2939
<Directory Id="D_Plugins" Name="plugins">
3040
<Directory Id="D_PythonScript" Name="PythonScript">
3141
<Directory Id="D_PythonLib" Name="lib" />
3242
<Directory Id="D_Scripts" Name="scripts">
33-
<Component Id="C_startup.py" Guid="*">
43+
<Component Id="C_startup.py" Guid="*" Win64="$(var.Win64)">
3444
<RemoveFile Id="Remove_F_startup.py" Name="startup.py" On="install"/>
3545
<RemoveFile Id="Remove_F_startup.pyc" Name="startup.pyc" On="install"/>
3646
<File Id="F_startup.py" KeyPath="yes" Name="startup.py" Source="$(var.baseDir)\scripts\startup.py" />
3747
</Component>
3848
<Directory Id="D_npp_unit_tests" Name="npp_unit_tests" />
3949
<Directory Id="D_SampleScripts" Name="Samples" />
4050
</Directory>
51+
<Directory Id="D_doc" Name="doc">
52+
<Directory Id="D_DocPythonScript" Name="PythonScript" />
53+
</Directory>
54+
<Component Id="C_pythonscript.dll" Guid="*" Win64="$(var.Win64)">
55+
<RemoveFile Id="Remove_F_pythonscript.dll" Name="PythonScript.dll" On="install"/>
56+
<File Id="F_pythonscript.dll" Name="PythonScript.dll" Source="$(var.baseDir)\$(var.variantDir)\Release\PythonScript.dll" />
57+
</Component>
58+
<Component Id="C_python27.dll" Guid="*" Win64="$(var.Win64)">
59+
<RemoveFile Id="Remove_F_python27.dll" Name="python27.dll" On="install"/>
60+
<File Id="F_python27.dll" Name="python27.dll" Source="$(var.pythonDir)\python27.dll" />
61+
</Component>
4162
</Directory>
42-
<Directory Id="D_doc" Name="doc">
43-
<Directory Id="D_DocPythonScript" Name="PythonScript" />
44-
</Directory>
45-
<Component Id="C_pythonscript.dll" Guid="*">
46-
<RemoveFile Id="Remove_F_pythonscript.dll" Name="PythonScript.dll" On="install"/>
47-
<File Id="F_pythonscript.dll" Name="PythonScript.dll" Source="$(var.baseDir)\$(var.variantDir)\Release\PythonScript.dll" />
48-
</Component>
4963
</Directory>
50-
<Component Id="C_python27.dll" Guid="*">
51-
<RemoveFile Id="Remove_F_python27.dll" Name="python27.dll" On="install"/>
52-
<File Id="F_python27.dll" Name="python27.dll" Source="$(var.pythonDir)\python27.dll" />
53-
</Component>
5464
</Directory>
5565
</Directory>
5666
</Directory>

installer/buildInstaller.bat

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ IF NOT EXIST "buildPaths.bat" (
1616

1717
SET PYTHONSCRIPTDLLDIR=bin
1818
SET INST_TEMP_DIR=temp
19-
SET NAME_ADDON=""
19+
SET NAME_ADDON=
20+
SET MSI_ARCH=x86
2021

2122
CALL buildPaths.bat
2223

2324
IF "%1"=="x64" SET PYTHONBUILDDIR=%PYTHONBUILDDIR_X64%
2425
IF "%1"=="x64" SET PYTHONSCRIPTDLLDIR=x64
2526
IF "%1"=="x64" SET INST_TEMP_DIR=temp64
2627
IF "%1"=="x64" SET NAME_ADDON=_x64
28+
IF "%1"=="x64" SET MSI_ARCH=x64
2729

2830
IF NOT EXIST "%PYTHONBUILDDIR%\python.exe" (
2931
echo Your PYTHONBUILDDIR in buildPaths.bat does not contain python.exe. Please set PYTHONBUILDDIR to the root of a built Python 2.7
@@ -48,7 +50,7 @@ if NOT [%ERRORLEVEL%]==[0] (
4850
)
4951

5052
echo Compiling python lib WiX source
51-
candle %INST_TEMP_DIR%\fullLib.wxs -o %INST_TEMP_DIR%\fullLib.wixobj -dpylibSource=..\pythonlib\full
53+
candle %INST_TEMP_DIR%\fullLib.wxs -o %INST_TEMP_DIR%\fullLib.wixobj -dpylibSource=..\pythonlib\full -arch %MSI_ARCH%
5254
if NOT [%ERRORLEVEL%]==[0] (
5355
goto error
5456
)
@@ -60,7 +62,7 @@ if NOT [%ERRORLEVEL%]==[0] (
6062
)
6163

6264
echo Compiling python pyd lib WiX source
63-
candle %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\fullLib_dll%NAME_ADDON%.wixobj -dpylibSource=..\pythonlib\full_dll%NAME_ADDON%
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%
6466
if NOT [%ERRORLEVEL%]==[0] (
6567
goto error
6668
)
@@ -72,7 +74,7 @@ if NOT [%ERRORLEVEL%]==[0] (
7274
)
7375

7476
echo Compiling extra lib WiX source
75-
candle %INST_TEMP_DIR%\extra.wxs -o %INST_TEMP_DIR%\extra.wixobj -dpylibSource=..\pythonlib\extra
77+
candle %INST_TEMP_DIR%\extra.wxs -o %INST_TEMP_DIR%\extra.wixobj -dpylibSource=..\pythonlib\extra -arch %MSI_ARCH%
7678
if NOT [%ERRORLEVEL%]==[0] (
7779
goto error
7880
)
@@ -84,7 +86,7 @@ if NOT [%ERRORLEVEL%]==[0] (
8486
)
8587

8688
echo Compiling extra lib WiX source
87-
candle %INST_TEMP_DIR%\extra_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\extra_dll%NAME_ADDON%.wixobj -dpylibSource=..\pythonlib\extra_dll%NAME_ADDON%
89+
candle %INST_TEMP_DIR%\extra_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\extra_dll%NAME_ADDON%.wixobj -dpylibSource=..\pythonlib\extra_dll%NAME_ADDON% -arch %MSI_ARCH%
8890
if NOT [%ERRORLEVEL%]==[0] (
8991
goto error
9092
)
@@ -96,7 +98,7 @@ if NOT [%ERRORLEVEL%]==[0] (
9698
)
9799

98100
echo Compiling tcl lib WiX source
99-
candle %INST_TEMP_DIR%\tcl.wxs -o %INST_TEMP_DIR%\tcl.wixobj -dpylibSource=..\pythonlib\tcl
101+
candle %INST_TEMP_DIR%\tcl.wxs -o %INST_TEMP_DIR%\tcl.wixobj -dpylibSource=..\pythonlib\tcl -arch %MSI_ARCH%
100102
if NOT [%ERRORLEVEL%]==[0] (
101103
goto error
102104
)
@@ -108,7 +110,7 @@ if NOT [%ERRORLEVEL%]==[0] (
108110
)
109111

110112
echo Compiling tcl lib WiX source
111-
candle %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wxs -o %INST_TEMP_DIR%\tcl_dll%NAME_ADDON%.wixobj -dpylibSource=..\pythonlib\tcl_dll%NAME_ADDON%
113+
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%
112114
if NOT [%ERRORLEVEL%]==[0] (
113115
goto error
114116
)
@@ -120,38 +122,38 @@ if NOT [%ERRORLEVEL%]==[0] (
120122
)
121123

122124
echo Compiling Sample Scripts WiX source
123-
candle %INST_TEMP_DIR%\sampleScripts.wxs -o %INST_TEMP_DIR%\sampleScripts.wixobj -dscriptSource=..\scripts\Samples
125+
candle %INST_TEMP_DIR%\sampleScripts.wxs -o %INST_TEMP_DIR%\sampleScripts.wixobj -dscriptSource=..\scripts\Samples -arch %MSI_ARCH%
124126
if NOT [%ERRORLEVEL%]==[0] (
125127
goto error
126128
)
127129

128130

129131
echo Generating WiX information for ..\PythonScript\python_tests
130-
heat dir ..\PythonScript\python_tests -ag -cg CG_UnitTests -dr D_PythonScript -var var.unittestSource -t changeDirTests.xsl -o %INST_TEMP_DIR%\unittests.wxs
132+
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%
131133
if NOT [%ERRORLEVEL%]==[0] (
132134
goto error
133135
)
134136

135137
echo Compiling Unit test WiX source
136-
candle %INST_TEMP_DIR%\unittests.wxs -o %INST_TEMP_DIR%\unittests.wixobj -dunittestSource=..\PythonScript\python_tests
138+
candle %INST_TEMP_DIR%\unittests.wxs -o %INST_TEMP_DIR%\unittests.wixobj -dunittestSource=..\PythonScript\python_tests -arch %MSI_ARCH%
137139
if NOT [%ERRORLEVEL%]==[0] (
138140
goto error
139141
)
140142

141143
echo Generating WiX information for ..\docs\build\html
142-
heat dir ..\docs\build\html -ag -cg CG_HtmlDocs -dr D_PythonScript -var var.htmldocsSource -t changeDirHtmlDoc.xsl -o %INST_TEMP_DIR%\htmldoc.wxs
144+
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%
143145
if NOT [%ERRORLEVEL%]==[0] (
144146
goto error
145147
)
146148

147149
echo Compiling Html doc WiX source
148-
candle %INST_TEMP_DIR%\htmldoc.wxs -o %INST_TEMP_DIR%\htmldoc.wixobj -dhtmldocsSource=..\docs\build\html
150+
candle %INST_TEMP_DIR%\htmldoc.wxs -o %INST_TEMP_DIR%\htmldoc.wixobj -dhtmldocsSource=..\docs\build\html -arch %MSI_ARCH%
149151
if NOT [%ERRORLEVEL%]==[0] (
150152
goto error
151153
)
152154

153155
echo Compiling main PythonScript installer
154-
candle pythonscript.wxs -o %INST_TEMP_DIR%\pythonscript.wixobj -dversion=%PYTHONSCRIPTVERSION% -dbaseDir=.. -dpythonDir=%PYTHONBUILDDIR% -dvariantDir=%PYTHONSCRIPTDLLDIR%
156+
candle pythonscript.wxs -o %INST_TEMP_DIR%\pythonscript.wixobj -dversion=%PYTHONSCRIPTVERSION% -dbaseDir=.. -dpythonDir=%PYTHONBUILDDIR% -dvariantDir=%PYTHONSCRIPTDLLDIR% -dPlatform=%MSI_ARCH% -arch %MSI_ARCH%
155157
if NOT [%ERRORLEVEL%]==[0] (
156158
goto error
157159
)

installer/buildReleaseZips.bat

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,46 +67,48 @@ rd /s /q %INST_TEMP_DIR%\release
6767
echo Creating directories
6868
mkdir %INST_TEMP_DIR%\release\Full\plugins\PythonScript\lib
6969
mkdir %INST_TEMP_DIR%\release\Full\plugins\PythonScript\scripts
70-
mkdir %INST_TEMP_DIR%\release\Full\plugins\doc\PythonScript
70+
mkdir %INST_TEMP_DIR%\release\Full\plugins\PythonScript\doc
7171
mkdir %INST_TEMP_DIR%\release\Min\plugins\PythonScript\lib
7272
mkdir %INST_TEMP_DIR%\release\Min\plugins\PythonScript\scripts
73-
mkdir %INST_TEMP_DIR%\release\Min\plugins\doc\PythonScript
73+
mkdir %INST_TEMP_DIR%\release\Min\plugins\PythonScript\doc
7474
mkdir %INST_TEMP_DIR%\release\Extra\plugins\PythonScript\lib
7575
mkdir %INST_TEMP_DIR%\release\Tcl\plugins\PythonScript\lib
7676

7777
echo Copying Python27.dll
78-
copy %PYTHONBUILDDIR%\python27.dll %INST_TEMP_DIR%\release\Full
79-
copy %PYTHONBUILDDIR%\python27.dll %INST_TEMP_DIR%\release\Min
78+
copy %PYTHONBUILDDIR%\python27.dll %INST_TEMP_DIR%\release\Full\plugins\PythonScript
79+
copy %PYTHONBUILDDIR%\python27.dll %INST_TEMP_DIR%\release\Min\plugins\PythonScript
8080

8181
echo Copying PythonScript.dll
82-
copy ..\%PYTHONSCRIPTDLLDIR%\release\PythonScript.dll %INST_TEMP_DIR%\release\Full\plugins
83-
copy ..\%PYTHONSCRIPTDLLDIR%\release\PythonScript.dll %INST_TEMP_DIR%\release\min\plugins
82+
copy ..\%PYTHONSCRIPTDLLDIR%\release\PythonScript.dll %INST_TEMP_DIR%\release\Full\plugins\PythonScript
83+
copy ..\%PYTHONSCRIPTDLLDIR%\release\PythonScript.dll %INST_TEMP_DIR%\release\Min\plugins\PythonScript
8484

8585
echo Copying Help
86-
xcopy /s /q ..\docs\build\html\*.* %INST_TEMP_DIR%\release\full\plugins\doc\PythonScript
87-
xcopy /s /q ..\docs\build\html\*.* %INST_TEMP_DIR%\release\min\plugins\doc\PythonScript
86+
xcopy /s /q ..\docs\build\html\*.* %INST_TEMP_DIR%\release\Full\plugins\PythonScript\doc
87+
xcopy /s /q ..\docs\build\html\*.* %INST_TEMP_DIR%\release\Min\plugins\PythonScript\doc
8888

8989
echo Copying Scripts
90-
xcopy /s /q ..\scripts\*.* %INST_TEMP_DIR%\release\full\plugins\PythonScript\scripts
91-
copy ..\scripts\startup.py %INST_TEMP_DIR%\release\min\plugins\PythonScript\scripts
90+
xcopy /s /q ..\scripts\*.* %INST_TEMP_DIR%\release\Full\plugins\PythonScript\scripts
91+
copy ..\scripts\startup.py %INST_TEMP_DIR%\release\Min\plugins\PythonScript\scripts
9292

9393
echo Copying Lib directories
94-
xcopy /s /q ..\PythonLib\full\*.* %INST_TEMP_DIR%\release\full\plugins\PythonScript\lib
95-
xcopy /s /q ..\PythonLib\full_dll%NAME_ADDON%\*.* %INST_TEMP_DIR%\release\full\plugins\PythonScript\lib
96-
xcopy /s /q ..\PythonLib\min\*.* %INST_TEMP_DIR%\release\min\plugins\PythonScript\lib
94+
xcopy /s /q ..\PythonLib\full\*.* %INST_TEMP_DIR%\release\Full\plugins\PythonScript\lib
95+
xcopy /s /q ..\PythonLib\full_dll%NAME_ADDON%\*.* %INST_TEMP_DIR%\release\Full\plugins\PythonScript\lib
96+
xcopy /s /q ..\PythonLib\min\*.* %INST_TEMP_DIR%\release\Min\plugins\PythonScript\lib
9797

9898
echo Copying Extra lib directory
99-
xcopy /s /q ..\PythonLib\extra\*.* %INST_TEMP_DIR%\release\extra\plugins\pythonscript\lib
100-
xcopy /s /q ..\PythonLib\extra_dll%NAME_ADDON%\*.* %INST_TEMP_DIR%\release\extra\plugins\pythonscript\lib
99+
xcopy /s /q ..\PythonLib\extra\*.* %INST_TEMP_DIR%\release\Extra\plugins\pythonscript\lib
100+
xcopy /s /q ..\PythonLib\extra_dll%NAME_ADDON%\*.* %INST_TEMP_DIR%\release\Extra\plugins\pythonscript\lib
101101

102102
echo Copying Tcl directory
103103
xcopy /s /q ..\PythonLib\tcl\*.* %INST_TEMP_DIR%\release\tcl\plugins\pythonscript\lib
104104
xcopy /s /q ..\PythonLib\tcl_dll%NAME_ADDON%\*.* %INST_TEMP_DIR%\release\tcl\plugins\pythonscript\lib
105105

106+
mkdir %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%
106107

108+
cd %INST_TEMP_DIR%\release\Full\plugins\PythonScript
109+
%SEVENZIPEXE% a -r -tzip %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%_PluginAdmin.zip .
107110

108111
cd %INST_TEMP_DIR%\release\Full
109-
mkdir %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%
110112
%SEVENZIPEXE% a -r -t7z %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.7z .
111113
%SEVENZIPEXE% a -r -tzip %INSTALLERDIR%\build\%PYTHONSCRIPTVERSION%\PythonScript_Full_%PYTHONSCRIPTVERSION%%NAME_ADDON%.zip .
112114

0 commit comments

Comments
 (0)