diff --git a/np3portableapp/Notepad3Portable/App/AppInfo/installer.ini b/np3portableapp/Notepad3Portable/App/AppInfo/installer.ini index b012d1d32..c4da66665 100644 --- a/np3portableapp/Notepad3Portable/App/AppInfo/installer.ini +++ b/np3portableapp/Notepad3Portable/App/AppInfo/installer.ini @@ -6,6 +6,10 @@ RemoveAppDirectory=true RemoveDataDirectory=false RemoveOtherDirectory=true [OptionalComponents] +OptionalComponents=true +OptionalSectionTitle=Additional Notepad3Portable.cmd Launcher +OptionalSectionDescription=Extracts additional launcher for Notepad3 +OptionalFile1=Notepad3Portable.cmd [CopyLocalFiles] [DownloadFiles] [Languages] diff --git a/np3portableapp/Notepad3Portable/App/AppInfo/installer_template.ini b/np3portableapp/Notepad3Portable/App/AppInfo/installer_template.ini index 90f74bac7..f1a416c4a 100644 --- a/np3portableapp/Notepad3Portable/App/AppInfo/installer_template.ini +++ b/np3portableapp/Notepad3Portable/App/AppInfo/installer_template.ini @@ -31,6 +31,10 @@ RemoveOtherDirectory=true ;OptionalSectionInstalledWhenSilent=true ;OptionalDirectory1= ;OptionalFile1= +OptionalComponents=true +OptionalSectionTitle=Additional Notepad3Portable.cmd Launcher +OptionalSectionDescription=Extracts additional launcher for Notepad3 +OptionalFile1=Notepad3Portable.cmd [CopyLocalFiles] ;CopyLocalFiles=true diff --git a/np3portableapp/Notepad3Portable/Notepad3Portable.cmd b/np3portableapp/Notepad3Portable/Notepad3Portable.cmd new file mode 100644 index 000000000..163857cad --- /dev/null +++ b/np3portableapp/Notepad3Portable/Notepad3Portable.cmd @@ -0,0 +1,24 @@ +@echo off + +:: Thanks to "Wilenty" for this "Additional Notepad3Portable.cmd Launcher". + +If not exist "%~dp0\Data\settings\" ( + If exist "%~dp0\App\DefaultData\settings\" ( + mkdir "%~dp0\Data\settings" + copy /y "%~dp0\App\DefaultData\settings" "%~dp0\Data\settings" >nul 2>&1 + For /f "delims=" %%W in (' dir /b /a:d "%~dp0\App\DefaultData\settings" ') do mkdir "%~dp0\Data\settings\%%~nW"&© /y "%~dp0\App\DefaultData\settings\%%~W" "%~dp0\Data\settings\%%~nW" >nul 2>&1 + ) +) + +set ErrorLevel=-1 + +If exist "%~dp0\Data\settings\" ( + set "NOTEPAD3_PORTABLE_SETTINGS=%~dp0\Data\settings" + If exist "%WinDir%\SysNative" ( + start "Notepad3 Portable" /b "%~dp0\App\Notepad3\x64\Notepad3.exe" %* + ) else ( + start "Notepad3 Portable" /b "%~dp0\App\Notepad3\x86\Notepad3.exe" %* + ) +) + +exit /b %ErrorLevel% diff --git a/np3portableapp/Notepad3Portable/Other/Source/Notepad3Portable.cmd b/np3portableapp/Notepad3Portable/Other/Source/Notepad3Portable.cmd index d852d06d4..163857cad 100644 --- a/np3portableapp/Notepad3Portable/Other/Source/Notepad3Portable.cmd +++ b/np3portableapp/Notepad3Portable/Other/Source/Notepad3Portable.cmd @@ -1,6 +1,6 @@ @echo off -:: Thanks to "Wilenty" for this "Alternative Notepad3Portable Launcher". +:: Thanks to "Wilenty" for this "Additional Notepad3Portable.cmd Launcher". If not exist "%~dp0\Data\settings\" ( If exist "%~dp0\App\DefaultData\settings\" ( diff --git a/np3portableapp/Notepad3Portable/Other/Source/PortableApps.comInstallerCustom.nsh b/np3portableapp/Notepad3Portable/Other/Source/PortableApps.comInstallerCustom.nsh deleted file mode 100644 index d2f5c7140..000000000 --- a/np3portableapp/Notepad3Portable/Other/Source/PortableApps.comInstallerCustom.nsh +++ /dev/null @@ -1,9 +0,0 @@ -# -# Thanks to "jooseng" for this little macro "Custom_Code_Post_Install". -# -!macro CustomCodePostInstall - ${If} ${FileExists} "$INSTDIR\Other\Source\Notepad3Portable.cmd" - CopyFiles /SILENT "$INSTDIR\Other\Source\Notepad3Portable.cmd" "$INSTDIR\Notepad3Portable.cmd" - ${EndIf} -!macroend - diff --git a/np3portableapp/build_np3portableapp.cmd b/np3portableapp/build_np3portableapp.cmd index 2c6dcf4ec..e474434a9 100644 --- a/np3portableapp/build_np3portableapp.cmd +++ b/np3portableapp/build_np3portableapp.cmd @@ -17,8 +17,6 @@ chcp 65001 >nul 2>&1 :: :: Prerequisites: (portable) intallation of: :: ----------------------------------------- -:: + PortableApps.com App Compactor (https://portableapps.com/apps/utilities/appcompactor) -:: :: + PortableApps.com Launcher (https://portableapps.com/apps/development/portableapps.com_launcher) :: (needed to create the Notepad3Portable.exe Launcher from the sources) :: @@ -31,11 +29,11 @@ set NP3_LANGUAGE_SET=af-ZA be-BY de-DE el-GR en-GB es-ES es-MX fr-FR hi-IN hu-HU :: =================================================================================================== :: --- Environment --- -if exist D:\PortableApps\PortableApps.comInstaller\ ( - set PORTAPP_ROOT_DIR=D:\PortableApps +if exist %~d0\PortableApps\PortableApps.comInstaller\ ( + set PORTAPP_ROOT_DIR=%~d0\PortableApps ) else ( - if exist D:\Rizonesoft\PortableApps\PortableApps\PortableApps.comInstaller\ ( - set PORTAPP_ROOT_DIR=D:\Rizonesoft\PortableApps\PortableApps + if exist %~d0\Rizonesoft\PortableApps\PortableApps\PortableApps.comInstaller\ ( + set PORTAPP_ROOT_DIR=%~d0\Rizonesoft\PortableApps\PortableApps ) else ( goto :END ) @@ -179,6 +177,11 @@ del /f /q "%NP3_PORTAPP_INFO%_tmp.ini" :: --------------------------------------------------------------------------------------------------- +:: - Copy "Additional Notepad3Portable.cmd Launcher" to "Notepad3Portable PAF [ROOT]" - +if exist "%NP3_PORTAPP_DIR%\Other\Source\Notepad3Portable.cmd" ( +copy /B "%NP3_PORTAPP_DIR%\Other\Source\Notepad3Portable.cmd" "%NP3_PORTAPP_DIR%\Notepad3Portable.cmd" /Y /V +) + :: --- build Launcher and Installer Package --- :: - build Launcher -