Is there a way to get the PortableApps Launcher to generate a nsi file?
I have an old program I am trying to make portable for myself. Everything is working great, except that for in an ini file, I need to put in the short path (i.e. PROGRA~) instead of the full path.
If the launcher could output a nsi file, I could just add the /SHORT option and re-compile, but I wasn't sure if this was even possible.
You'll need to do this with custom code (using PAL 2.1, App\AppInfo\Launcher\Custom.nsh), using
GetFullPathName /SHORT
; here's one way you might do it:Then you could use this in launcher.ini like this:
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Thanks Chris that worked perfectly! Great job on the launcher too - great tool!
Reviving the original question, can we get the source NSI for the generated launcher?
Is there an option in launcher.ini that I'm not aware of? I pored through the docs but can't find any mention of an option that would do that.
I'd like to read through the source before executing the compiled EXE just to make sure it's doing everything correctly.
What is there is there. Not many options are determined at compile-time, etiher; most of launcher.ini is evaluated at runtime.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Ahhh, OK. so the launcher in this case is just an interpreter. I thought it actually created the NSI then compiled it.
I'll guess I'll go back to manually creating the NSI then.
Is there something you're wanting to do that isn't possible with the launcher?
Nothing in particular, but I was debugging my launcher.ini this morning trying to figure out what I was doing wrong, having the source NSI would have allowed me to see, step by step, what it was trying to do. I would have found the problem sooner.
It's all fixed now though.
You could always try debugging step by step if you didn't already do that. That should give a good impression of what the launcher does at every single step.
The launcher's NSI is compiled when you generate your launcher. Some of it is determined at runtime (whether to include certain plugins, name, icon, etc) but much of it is interpreted.
Please do not create new custom NSIS launchers for apps you would like to get to official release. PAL is more powerful, more stable and FAR easier to maintain.
Sometimes, the impossible can become possible, if you're awesome!
I don't plan to submit any, the apps I make launchers for are usually non-FOSS.