You are here

Force32 in PAF launcher

8 posts / 0 new
Last post
rbon
Offline
Last seen: 11 hours 1 min ago
Joined: 2011-04-30 13:26
Force32 in PAF launcher

Hi John,
I switched to Notepad++ v8.9.3 by PortableApps and installed the 64-bit version with 32-bit support (dual install).
My Notepad++'s plugins subfolders (32 and 64 bit) contain different plugins.
The previous version of Notepad++ Portable, created by another developer, allowed the following parameter to be set in the 'Notepad++Portable.ini' file:

Force32=true *

to start Notepad++ 32 bit (forcing) and use the related plugins.

*
(or 'false' if you will run Npp to 64 bit).

Unfortunately the previous developer do not had insert the file 'C:\PortableApps\Notepad++Portable\App\AppInfo\Launcher\Custom.nsh' which I suspect is responsible for force Noterpad++ to run 32-bit on a 64-bit system.

I have no experience programming on the PAF launcher and therefore I cannot create a my custom version of Notepad++.

Do you have any suggestions for me?
Thanks in advance.

JLim
Offline
Last seen: 1 day 8 hours ago
Joined: 2013-07-17 01:30
Who is the "previous

Who is the "previous developer"?

rbon
Offline
Last seen: 11 hours 1 min ago
Joined: 2011-04-30 13:26
Sorry, I can't write the name

Sorry, I can't write the name of the previous developer here.

ANTICHRISTUS REX
ANTICHRISTUS REX's picture
Offline
Last seen: 1 day 5 hours ago
Translator
Joined: 2019-07-19 07:09
https://www.youtube.com/watch?v=67tT2PbiWcI

Voldemort? or Those We Don't Speak Of?

AFAIK. The dual architecture was implemented by John, there is no 32+64 bit NP++ before his upgrade (officially & in this website).

'Life is a strategy game, where roles are already distributed'
― Neo Buddha ―

JLim
Offline
Last seen: 1 day 8 hours ago
Joined: 2013-07-17 01:30
Developer not from

Developer not from Portableapps.com. Otherwise he would tell who is.

JLim
Offline
Last seen: 1 day 8 hours ago
Joined: 2013-07-17 01:30
Notepad++ v8.9.3 mod

https://www.upload.ee/files/19251100/NotepadPlusPlusPortable_8.9.3_mod.p...

Files modified:
Custom.nsh
PortableApps.comInstallerCustom.nsh
AppNamePortable.ini/Notepad++Portable.ini

rbon
Offline
Last seen: 11 hours 1 min ago
Joined: 2011-04-30 13:26
Hi JLim,

Hi JLim,
Thank you very much for your work.
I tested your modified version of Notepad++ v8.9.3 and it works very well.
I looked in the 'custom.nsh' file and found an 'If-Then-Else' loop that I absolutely couldn't do on my own.
I also noticed a lot of care in the custom.nsh file.
If I ever get around to it, I'll try to repay you, however I can.
Thanks again.

John T. Haller
John T. Haller's picture
Online
Last seen: 39 min 18 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Simpler and Consistent Way

For most apps, adding these 4 lines to the start of SegmentInit is all that is needed:

${ReadUserConfig} $1 AlwaysUse32Bit
${If} $1 == true
    StrCpy $Bits 32
${EndIf}

This is much simpler and keeps consistency with apps like Firefox Portable which have this functionality built in and use the same INI setting. This would yield a complete custom.nsh of:

${SegmentFile}

Var strCustomFullAppDir

${SegmentInit}
	${ReadUserConfig} $1 AlwaysUse32Bit

	${If} $1 == true
		StrCpy $Bits 32
	${EndIf}
	
    ${If} $Bits = 64
		StrCpy $strCustomFullAppDir "$EXEDIR\App\Notepad++64"	
    ${Else}
		StrCpy $strCustomFullAppDir "$EXEDIR\App\Notepad++"
    ${EndIf}
	${SetEnvironmentVariablesPath} FullAppDir $strCustomFullAppDir
!macroend

${SegmentPrePrimary}
	${If} ${FileExists} "$strCustomFullAppDir\session.xml"
		${GetSize} "$strCustomFullAppDir" "/M=session.xml /S=0B /G=1" $0 $1 $2
		${If} $0 < 200
			${If} ${FileExists} "$EXEDIR\Data\Config\session.xml"
				Delete "$strCustomFullAppDir\session.xml"
			${EndIf}	
		${EndIf}
	${EndIf}
	${If} ${FileExists} "$EXEDIR\Data\Config\plugins\config\*.*"
		Delete "$EXEDIR\Data\Config\plugins\config\nppPluginLis*.dll"
		${If} $Bits = 64
			CopyFiles /SILENT "$EXEDIR\App\DefaultData\Config\plugins\Config\nppPluginList64.dll" "$EXEDIR\Data\Config\plugins\config"
			Rename "$EXEDIR\Data\Config\plugins\config\nppPluginList64.dll" "$EXEDIR\Data\Config\plugins\config\nppPluginList.dll"
		${Else}
			CopyFiles /SILENT "$EXEDIR\App\DefaultData\Config\plugins\Config\nppPluginList32.dll" "$EXEDIR\Data\Config\plugins\config"
			Rename "$EXEDIR\Data\Config\plugins\config\nppPluginList32.dll" "$EXEDIR\Data\Config\plugins\config\nppPluginList.dll"
		${EndIf}
	${EndIf}
	CreateDirectory "$EXEDIR\App\Notepad++\cloud"
	CreateDirectory "$EXEDIR\App\Notepad++64\cloud"
	Delete "$EXEDIR\App\Notepad++\cloud\choice"
	;CopyFiles /SILENT "$EXEDIR\App\choice" "$EXEDIR\App\Notepad++\cloud"
	FileOpen $0 "$EXEDIR\App\Notepad++\cloud\choice" w
	FileWrite $0 "$EXEDIR\Data\Config"
	FileClose $0
	Delete "$EXEDIR\App\Notepad++64\cloud\choice"
	CopyFiles /SILENT "$EXEDIR\App\Notepad++\cloud\choice" "$EXEDIR\App\Notepad++64\cloud"
	
	${If} $Bits = 64
		${IfNot} ${FileExists} "$EXEDIR\App\Notepad++64\localization"
			Rename "$EXEDIR\App\Notepad++\localization" "$EXEDIR\App\Notepad++64\localization"
		${EndIf}
	${Else}
		${IfNot} ${FileExists} "$EXEDIR\App\Notepad++\localization"
			Rename "$EXEDIR\App\Notepad++64\localization" "$EXEDIR\App\Notepad++\localization"
		${EndIf}
	${EndIf}
!macroend

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments