You are here

Generating multiple Exe with the launcher

4 posts / 0 new
Last post
gillesg
Offline
Last seen: 1 week 2 days ago
Joined: 2018-07-23 05:50
Generating multiple Exe with the launcher

Hello,

I do not know if I post at the right place, sorry if not.

I am using portableApps Launcher generatir successfully, but I ran into a difficulty.

I would like to generated 2 Portable App based on the same directory structure.
The difference between the 2 portable Exe is the entry point

[Launch]
;ProgramExecutable=\..\..\@AppName-Dev-Test\AppName.exe
ProgramExecutable=Basedir\Binaries\Win64\App_DX12.exe
ProgramExecutableX=Basedir\Binaries\Win64\App.exe

Is is possible to have such a behavior with the launcher Generator ?

If it is possible what are the appinfo and laucher.ini like ?

Thank for your time and help

regards

John T. Haller
John T. Haller's picture
Offline
Last seen: 11 hours 11 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Quite Supported

The PA.c Launcher itself doesn't support multi-exe apps. The multi-exe apps are things like LibreOffice and OpenOffice that have a single PA.c Launcher and then some stub EXE files that call the PA.c Launcher with an additional argument (-writer to start the LibreOffice Writer directly, for example).

As for your specific app, it depends on how you want it to work. Would it be selectable by the user or better to automatically run the DirectX 12 version when it's available and the other when it is not? Likely, detecting whether the OS is Windows 10 or later and using D12 and if it is earlier launch the other would be the way to go in custom code.

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

gillesg
Offline
Last seen: 1 week 2 days ago
Joined: 2018-07-23 05:50
Thanks for the info. I looked

Thanks for the info. I looked into OpenOffice. It looks complex in regards to what I would like to achieve.

I would like to be able to have 2 ini files for launcher. One for each of the StartX entry of the appinfo.ini
I am moving towards having a script that change appinfo.ini and launch a compilation.

John T. Haller
John T. Haller's picture
Offline
Last seen: 11 hours 11 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Little Different
This would be a bit different from LibreOffice if it was automatic as I suggested above. You'd set the ProgramExecutable within your launcher.ini to App\AppName\Binaries\Win64\App.exe and then swap between the two binaries using a custom.nsh for the launcher. It'd look like this:
${SegmentFile}

${SegmentInit}
	ReadRegStr $2 HKLM "Software\Microsoft\Windows NT\CurrentVersion" "CurrentBuild"
	
	${If} $2 < 10000 ;Windows 7/8
		${If} ${FileExists} "$EXEDIR\App\AppName\Binaries\Win64\App_DX12.exe"
			Rename "$EXEDIR\App\AppName\Binaries\Win64\App.exe" "$EXEDIR\App\AppName\Binaries\Win64\App_NoDX12.exe"
			Rename "$EXEDIR\App\AppName\Binaries\Win64\App_DX12.exe" "$EXEDIR\App\AppName\Binaries\Win64\App.exe"
		${EndIf}
	${Else}
		${If} ${FileExists} "$EXEDIR\App\AppName\Binaries\Win64\App_NoDX12.exe"
			Rename "$EXEDIR\App\AppName\Binaries\Win64\App.exe" "$EXEDIR\App\AppName\Binaries\Win64\App_DX12.exe"
			Rename "$EXEDIR\App\AppName\Binaries\Win64\App_NoDX12.exe" "$EXEDIR\App\AppName\Binaries\Win64\App.exe"
		${EndIf}
	${EndIf}
!macroend
So, on Windows 10/11, it'll look to see if App_DX12.exe exists and rename it to App.exe so that'll get used while renaming the existing App.exe to App_NoDX12.exe. And on Windows 7/8 it'll look to see if App_NoDX12.exe exists and rename it to App.exe so that'll get used while renaming the existing App.exe to App_DX12.exe.

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

Log in or register to post comments