You are here

[Outdated] PortableApps.com Launcher 2.0 Beta 2

79 posts / 0 new
Last post
Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
[Outdated] PortableApps.com Launcher 2.0 Beta 2

This thread is outdated; 2.0 Beta 3 is now available.

The PortableApps.com Launcher is your PAL in making applications portable. It's a universal launcher for which you don't need to write code. Instead, it's configured with an INI file (which goes in App\AppInfo\Launcher\AppNamePortable.ini), and uses a splash screen in App\AppInfo\Launcher\splash.jpg.

Download the PortableApps.com Launcher 2.0 Beta 2 [630KB download / 1.3MB installed]
(MD5: 493182db50d03459b429017a4813464e)

Download the PortableApps.com Application Template 2.0 Beta 2 [115KB download / 195KB extracted]
(MD5: f58081d20bf55c360f674e4d68b91702)

To get a custom build of the PortableApps.com Launcher with custom icon and name (recommended), download the main PortableApps.com Launcher package and Unicode NSIS Portable and install them next to one another. Then run the PortableApps.com Launcher Generator and select your directory. (While you can make a non-Unicode build of the PortableApps.com Launcher currently, Unicode is the way we're headed and eventually we'll be requiring Unicode NSIS.) You will probably want the Unicode build of the PortableApps.com Installer, available from the Unicode NSIS development thread above.

Known Issues:

  • Restarts / Multiple Instances / Secondary EXEs Unsupported - If an app restarts itself (for updates or plugins), allows multiple instances (and the first could be closed first) or you have secondary EXEs set to be waited for, the launcher will quit early. This is due to a bug in the Unicode handling of checking for running processes. This will be fixed in the next release shortly. Until then, you can compile an ANSI build yourself that will function properly. Or, if multiple instances is the only issue affecting your app, disable multiple instances for now. Update: you can also now build from the tip of the repository and the issue should be fixed.

Links:

Release Notes:

  • 2.0 Beta 2 (2010-03-16): Unicode build, various bug-fixes and a few new features (better language switching in particular). See comments in the 1.0 Beta 1 thread or help.html.

Discussion, notification of some changes and earlier release notes are available in the 1.0 Beta 1 thread.

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
Thanx for sorting all that

Thanx for sorting all that earlier !
Some minor things, but I want to write them immediately. Intend to forget otherwise.

  1. [Fixed] In Language.nsh, line 21:

    	${IfThen} $0 == "" ${|} ${SetEnvironmentVariable} PortableApps.comLanguageCode en-us ${|}
    

    I believe 'en-us' is wrong, as PortableApps.comLanguageCode uses 'en' in PAM

  2. [TODO] If I'm using WinampPortable out side PAM environment, the language will get reset to English, at every startup. All users not using PAM, would end up with portable apps only in English !
  3. [Won't implement] Could the lang-switching issues get solved by adding an option to [FileWrite?]
    [FileWrite1]
    Type=INI
    File=%PAL:DataDir%\settings\winamp.ini
    Section=Winamp
    Key=langpack
    Value=%PAL:LanguageCustom%
    IfEmptyValueDoNotWrite=true
    
  4. [Fixed] In ExecString.nsh, any chance on adding ${ParseLocations} to the 'Get additional parameters from user INI file' part. I really need it for Winamp, and do it now within customcode, but is really a bit of a hack that way. It's probably just 1 line extra and I suppose other apps could need it too.
    I'm using it cause Winamp has a real issue with relative paths in passed parameters !
  5. [Fixed] Personaly, when I'm using the PALgenerator, I would prefer the option of locating 'PortableApps.comLauncherDebug.nsh' in the source folder of the app I'm generating the launcher for, like the way you set it up for 'PortableApps.comLauncherCustom.nsh'

Formerly Gringoloco
Windows XP Pro sp3 x32

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
\
  1. Correct, apparently it's changed since 1.5. Fixed.
  2. The thing needed here is a way of using ReadINIStr, ConfigRead or ReadRegStr to override the language choice. I'm doing that soon.
  3. No. Biggrin (if Value is blank it'll currently delete the key; but a neater solution would be to do the above point.)
  4. Done. I thought I'd had that in.
  5. You won't be using PortableApps.comLauncherDebug.nsh at all soon (#). Till then... OK. You've got it.

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

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
[Fixed] And now for a real problem !!!

Whenever I switch the language manually within Winamp, winamp restarts it self, and PAL just finishes. So winamp will be sitting there without PAL to cleanup after it !
I did include:

WaitForOtherInstances=true

But still the same problem happens ?
Unicode NSIS Portable is also experiencing the same problem with 'WaitForEXE='. But is working fine with PAL Alpha 4 !
It must be something you changed recently.
[edit: it's Wraithdu's ProcFunc.nsh compiled in NSISu, it's not working]
[edit2: Done a quick (temporarily) fix, and I think it's just ${ProcessWaitClose} what you're using. Anyway a strange problem in !macro ProcFuncs_,what's use by ${GetProcessPID}
Patch for line 343-450 : http://pastebin.com/BtbBH3E9
There are bound to be additional problems with Wraithdu's script
It would even be more usefull if there would be a ${ChildProcessWaitClose}

Formerly Gringoloco
Windows XP Pro sp3 x32

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Hmm...

I thought about that when thinking about future-proofing for Unicode NSIS but thought that the w stuff should work fine with Unicode NSIS - as that's what it is. I've emailed Erik to see what he reckons.

The removing W for the WCHAR edition seems strange... and using an array of ANSI characters rather than WCHARs... whether it works or not all your fixes seem to be doing it the wrong way round. (ANSI NSIS uses Unicode strings, Unicode NSIS uses ANSI strings!?)

So I'll wait till Erik comments before doing anything, I think.

And in the meantime, cave: waiting for processes in Unicode NSIS builds probably doesn't work.

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

wraithdu
Offline
Last seen: 11 years 5 months ago
Developer
Joined: 2007-06-27 20:22
Yeah, I don't like that patch

Yeah, I don't like that patch at all.

I don't have NSISu, so I'll need either of you to do some debugging. Can you tell me where in the GetProcessPID process it is failing?

And some Q's about NSISu...

- Are the System plugin types / parameters the same? Particularly the string types 'w' and '&w'.
- Is the ${NSIS_MAX_STRLEN} variable the same? What is its value in NSISu?
- Does logiclib work the same? Particularly the string test '=='.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
In the FAQs

You can get Unicode NSIS Portable for testing.

The System plug-in is the same, just things like TCHAR becomes a WCHAR automatically. In theory anyway.

NSIS_MAX_STRLEN is 8196.

LogicLib functions the same.

See the Unicode NSIS FAQs for more details.

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

wraithdu
Offline
Last seen: 11 years 5 months ago
Developer
Joined: 2007-06-27 20:22
I think I've got it. Try

I think I've got it. Try changing every occurrance of '&w520' to '$w260'. That structure param is an array of TCHARs, MAX_PATH in length. MAX_PATH = 260.

However in ANSI NSIS, the &wN parameter specifies BYTES of unicode text, whereas in NSISu it specifies the number of CHARACTERS of unicode text.

If that doesn't work, let me know and I'll keep looking.

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
It's getting some where,

It's getting some where, getting the first string properly [system process].
For the rest there are unreadable strings.

I really got to go to sleep, thought

Formerly Gringoloco
Windows XP Pro sp3 x32

wraithdu
Offline
Last seen: 11 years 5 months ago
Developer
Joined: 2007-06-27 20:22
Sorry, typo, should have been

Sorry, typo, should have been '&w260'. Anyway, my fix works. Here's the changes that need to be made:

1) Line 180 add:

!ifdef NSIS_UNICODE
	!define WSTRING "&w260"
!else
	!define WSTRING "&w520"
!endif

2) Replace all occurrances of '&w520' or '&w260' with '${WSTRING}'.

This is a bad bug and NEEDS to be fixed in ANSI NSIS.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Thanks

I've committed ProcFunc.nsh v2.2 so it's now ready for proper testing.

I'm glad I asked you to do it rather than trying it myself. I'd still be stuck. Well done working it out.

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

OliverK
OliverK's picture
Offline
Last seen: 3 years 5 months ago
Developer
Joined: 2007-03-27 15:21
Means update time for

Means update time for AutoClose, huh?

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Qt registry key cleanup

I've just added a Qt registry key cleanup section. Example usage (to fix a Lightscreen Portable bug).

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

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
[Alternative solution implemented] ForEachINIPair.nsh

Ability to deal with utf-16Le ini files !!!
http://pastebin.com/xPNv9WKf
Give it a look over, and modify it if you like !
Just wanted to let you know !
[edit:added an extra line to reset $_FEIP_Bom value]
[edit2:as I'm improving the script a bit, http://pastebin.com/tprH9HUB
See for yourself if you will use it, probably it's not that important, jet !]

Formerly Gringoloco
Windows XP Pro sp3 x32

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
[Fixed] Reword error for RunAsAdmin=force

When attempting to run an app without admin using RunAsAdmin=force, the error returned is "Unable to run as administrator, error 1223. Some features of Revo Uninstaller Portable will not work if you do not run as administrator."

That's fine for RunAsAdmin=try, but as far as RunAsAdmin=force goes the intent is to not load the program at all. It should instead notify the user that the app cannot be loaded rather than tell the user it has limited functionality.

EDIT: Also, can you add the ability to suppress the error messages in the .ini file? I'm working on Speccy Portable right now and it has its own error message, so having two errors pop up about running without admin is redundant and might frustrate the user.

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
I left it for you in IRC, but

I left it for you in IRC, but just in case, when selecting no to running Revo Uninstaller Portable elevated:

Debug message at line 230.10.30.9

Segment: RunAsAdmin
Hook: .onInit

UAC_RunElevated return values:
$0=1223
$1=0
$2=1223
$3=0

Unknown Error (1223)

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Got it

I thought I'd been getting 1223 and 1233 confused in my mind... the reason is that somehow at some point I had copied 1233 in the source rather than 1223.

I've fixed it now.

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

judeah666
Offline
Last seen: 10 years 6 months ago
Joined: 2009-03-28 15:53
[Invalid] teracopy launcher

hi i'm trying to portabilized teracopy and i want it to just sit in the system tray and take over the windows normal copy and paste. how would i do this using your launcher. sorry if this is the wrong section for this

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Not with this

Any system tray stuff and clipboard hooking is nothing to do with this Launcher: it's just to launch things portably, not to do such things as that.

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

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
[Fixed] Bug?

I use the latest source pulled from the mercurial rep using Wraithdu's app.
It seems that there is something wrong with ForEachINIPair.nsh as it only moves the first file and not the second one. My ini is as follows:

[Launch]
ProgramExecutable=JPEGView\JPEGView.exe
WorkingDirectory=%PAL:AppDir%\JPEGView
LaunchAfterSplashScreen=true
SinglePortableAppInstance=true

[FilesMove]
JPEGView.ini=%PAL:AppDir%\JPEGView
ParamDB.db=%PAL:AppDir%\JPEGView

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Unicode

This is probably a side-effect of the Unicode switch. Could you try putting in a blank line after that? I've got a hunch that'll fix it. If not I'll take a look at it.

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

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
ANSI

Didnt help.
I used the old ANSI version of NSIS. Ill repost back after trying with the new Unicode NSIS.

EDIT:
No. Compiling the Launcher (with the debug option) with NSIS Unicode didnt help. It still only copies the ini.

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
ForEachINIPair.nsh , seems to

ForEachINIPair.nsh , seems to miss 'ClearErrors' (line 29)

	${IfNot} ${Errors} ; right section
		${Do}
			ClearErrors
			FileRead $_FEIP_FileHandle $_FEIP_Line

			StrCpy $_FEIP_LineLength $_FEIP_Line 1
			${If} ${Errors} ; end of file

MoveFiles.nsh segment sets the error-flag, and without clearing the error-flag again, ForEachINIPair behaves like it's end of file !

Formerly Gringoloco
Windows XP Pro sp3 x32

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Hmm.

Thanks. It just so happens that I don't need that now as I've got ForEachINIPair2 working with the shell API call.

I've committed this change though before I change the file radically just in case I want the old method again.

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

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
[Alternative solution implemented] Just an idea....

You got me thinking, about you not wanting to including to many plug-ins.
There is the possibility of adding the EnumINI plug-in routine to another plug-in, which would possibly just add 1 or 2 kilobytes to the other plug-in!
Or even combining a series of plug-ins into one multi plug-in.
It could save a fair amount of kilobytes, as all plug-ins basically use several of the same routines. If you are interested I could give it a try and see how many kilobytes will be saved !
[edit:after having a closer look at the EnumINI plug-in, I realized it just returns the keys. But with adding 4 extra lines to the source I got it to return the values as well. The main fallback is that it has to reload the file at every enumeration ! As you probably realized with your implementation of GetPrivateProfileSection()]

Formerly Gringoloco
Windows XP Pro sp3 x32

wraithdu
Offline
Last seen: 11 years 5 months ago
Developer
Joined: 2007-06-27 20:22
If you really want an INI

If you really want to work on an INI plugin, you should look at implementing SimpleIni

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
[Invalid] More RunAsAdmin problems.

For Speccy Portable:

With RunAsAdmin=try, the program won't load at all if you select no to run as admin. Sad

I'm posting it in a minute, but noting this problem.

When loading Speccy itself, I'm 95% sure that I remember loading it on my work computer (where I do not have admin) and it loaded without problem (though some features are not available). You might want to test it though, as I don't go back to campus for a week.

[Invalid, Speccy issue on Vista/7]

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Works fine without admin

Chris Morgan It's working just fine for me without admin on XP. The usual prompts, warnings etc. and then it runs fine (Speccy also warns about the lack of admin).

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

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
More improvements

I've committed some more improvements recently.

  • The Manual is now up to scratch for a first release where it's better than help.html. (And the choice-of-monospace-font issue has been fixed.)
  • ForEachINIPair is now using GetPrivateProfileSection which should be more reliable and more accurate than the earlier line-by-line read solution. A limit of ${NSIS_MAX_STRLEN} / ${NSIS_CHAR_SIZE} (i.e. 1K in ANSI, 4K in Unicode) per section (after whitespace stripping) has been applied due to this but that should be fine; it'll warn you if it runs out of space for it. Reading from Unicode-formatted INI files also works properly.

Barring any more issues, I think I'm ready for Beta 3.

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

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
Are you going to implement

Are you going to implement RunAsAdmin(2000|XP|Vista|7) for B3?

Also, I've thought of that a bit more and that doesn't take into account versions of Windows Server (so will that also be added?)

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 48 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
No

I believe Chris said this is being held for 2.1. We're trying to get 2.0 out without further feature-creep (and the possible introduction of bugs and then further betas). The goal of 2.0 is to work with a majority of apps, not all, and then add features as time goes on. Apps that require admin at all are already specialty/niche apps that won't be used by most users. As we discussed in IRC, keep it to force for now for all OSes. Your app won't be official in the near-term as we still need publisher permission.

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

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
Yeah, I wasn't sure whether

Yeah, I wasn't sure whether or not he made a final decision to put it in now.

I understand it'll be in testing for awhile, and that, if/when Piriform apps go official, Nathan and my launchers likely won't be the ones to go official.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 48 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Why Not?

Why wouldn't they? At the very least, they may be the starting point and you'll still be credited.

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

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
From the talk we had in IRC,

From the talk we had in IRC, it sounded like you were saying they wanted to do their own.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Chris You are A Genius

Chris just wanted to say Thanks I know you have been working so hard on this new development and appreciate your helping me with the old one.

Problem is is that by the time I learn that one this one will be ready. Oh well Thanks again!

Smile Wink
Smile

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
[Resolved] another bug?

The [FilesMove] thing works now thanks to gringolocos patch but I have another problem. It only works if I set MoveFiles to
JPEGView.ini=%PAL:AppDir%\JPEGView

and not if its set to what the help.html suggests:
settings\JPEGView.ini=%PAL:AppDir%\JPEGView

If i put "settings\JPEGView.ini=%PAL:AppDir%\JPEGView" in toe launcher.ini, it still copies the file to /Data/JPEGView.ini

(EDIT): Nope. No bug. My mistake. I had put the settings file in /App/DefaultData and not in /App/DefaultData/settings. Works now as expected.

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
Timing ForEachINIPair.nsh 1 & 2

I'm actually quite surprised how fast ForEachINIPair 1 is !!!
For my tests I used the example PortableApps.comLauncher.ini (3KB) which comes along when I clone from the Development repository. I used the [Environment] section and done the tests from the local HDD . Even timed it excluding the buffer creation & freeing!
When scanning this section right in the top of the ini file, ForEachINIPair1 is even 12 times faster, then the newer version.
When I locate the section where the registry sections are it's 2,5 times faster, but any lower into the ini file it becomes less & less.
Still thought, even when the [Environment] section is located in it's original location (almost in the bottom) it still is a small bit faster.
TimeNSISFunctions.nsi (just for ansi NSIS, due to the time plug-in)
[edit: Anyway probably we are still talking about 0.005 sec. to read an ini section of 4 lines, for the newest ForEachINIPair.nsh. What isn't bad !]

Found a bug in the newest ForEachINIPair.nsh !!!

; GetPrivateProfileSection guarrantees there will be an = on each line

This doesn't count for my computer ! (Windows XP sp3)
Whenever there is a line without the '=' character, the macro will go into an endless loop !

Formerly Gringoloco
Windows XP Pro sp3 x32

wraithdu
Offline
Last seen: 11 years 5 months ago
Developer
Joined: 2007-06-27 20:22
Some easier timer code, value

Some easier timer code, result is in milliseconds:

System::Call 'kernel32::GetTickCount(v)i.R8'
; your code here
System::Call 'kernel32::GetTickCount(v)i.R9'
IntOp $R9 $R9 - $R8 ; result in $R9 in ms
Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
Thanx, and I just spend my

Thanx, and I just spend my last hour re-compiling the time plug-in ! Wink
But really thanx
With the new timing, the old ForEachINIPair is still 2.5 times faster with the section located in the end of the ini file . (I wonder why thought ?)

Formerly Gringoloco
Windows XP Pro sp3 x32

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
=, time

In my testing there was absolutely always an = sign on every line; a line without an = sign was not included in the output. This isn't the case for you? If not I'll need to put a few lines back in.

The thing is that version 2 is the "correct" way of doing it. It also makes sure that it handles Unicode data properly. I think I'd be inclined to use GetPrivateProfileSection anyway for this even if it is a tad slower.

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

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Possible Bug?

I am packaging a program that has it's own help.chm file in its AppDir. Problem is it appears to not hook the hh.exe file from the localhost computer to open the file. If I just run the file alone it works without a hitch, just when I Launch it with the launcher do I have an issue. FYI I also had the issue with P.A.L.

tyvm

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
?

I don't understand what you're talking about; are you trying to use a chm file as the ProgramExecutable? If so that's not supported behaviour; only an executable should be launched there.

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

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
No Sir

In the program there is a help option. When running without the Launcher it opens appropriately. When I use the Launcher too run the program, the program opens and functions, however the help file fails to open.

Hope that makes better sense?

The help file is a chm format which requires hh.exe from the LocalHost computer ( Usually located in C:\windows)

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 48 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Working Directory

I can pretty much guarantee that is a working directory issue.

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

aamiel
aamiel's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2008-11-03 04:53
Thanks

I saw the launcher a while back and though it was a lot of trouble and I would have to change everything and I didn't want to use it.
Then yesterday I spent half an hour looking at it and converted wxDev-C++ Portable to use it.


[Launch]
AppName=WxDev-C++ Portable
ProgramExecutable=Dev-Cpp\devcpp.exe
CommandLineArguments=-c %PAL:DataDir%\settings

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\settings\devcpp.ini
Find=%PAL:LastDrive%
Replace=%PAL:Drive%

Now I see the power of it. Great work thanks a lot.

The only thing I was missing was more examples on how to use it so I put the code above.

Once again thanks. I am now going to use it on other projects...

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Comments
  • AppName would be just wxDev-C++ if you were to use it, but you should not set this value at all as it's not necessary (refer to the manual).
  • I imagine that the %PAL:DataDir%\settings should probably be quoted to make sure it works fine in paths with spaces.
  • It might be worth while considering putting in a slash (whether / or \) in the replace. I don't know if it would be valid to have text like Secret in other values, but I reckon it's generally a good idea to limit it as much as possible to avoid potential problems.

Examples and a tutorial are what I'm working on next in the Manual.

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

aamiel
aamiel's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2008-11-03 04:53
How do I?

The application I want to move to the launcher has its config file in $DOCUMENTS.

Up to now, I used to do the following:
1) Make a back up of the config in $DOCUMENT, just in case
2) Move the portable config to $DOCUMENTS
3) Run the application
4) Move back the config file
5) Restore the backup if needed

How do I do that with the launcher [FilesMove] seems to be only a part of the solution.

Thanks for the help.

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
%DOCUMENTS%
[FilesMove]
settings\configfile.conf=%DOCUMENTS%

if that's not enough here is a whole list of additional env.vars which PAL uses !
PAL should take care of the backup & restore, if needed !

Formerly Gringoloco
Windows XP Pro sp3 x32

aamiel
aamiel's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2008-11-03 04:53
I tried that but...

I tried that but Documents is c:\Users\...\my Documents on the host PC.
The PAL overwrites a file if it was there (case where the program is also installed on the host PC) and the PAL does not move the file back.

Any help welcome

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Tried it?

That should work. Backup and restore should work perfectly, it's part of what FilesMove does. (it's just I've been careless and not documented that. Hang on...) Have you actually tried it when the file is there already? If so what happened?

As for the environment variables, this page in the manual is the authoritative source. (Any suggestions for improvements are most welcome!)

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

aamiel
aamiel's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2008-11-03 04:53
Tried a bit more

and as recommended read the environment variables page. I was using $DOCUMENTS instead of %DOCUMENTS%.

It seems to work now.

Thanks for putting me back on the right track

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
I just tried using the

I just tried using the Launcher Generator; it completely failed on me. Here's the log it gave me: http://pastebin.com/yF80BBVg
I don't really have time to try debugging, unfortunately; I'll just see if I can manually recompile PAL.
Also, making Unicode NSIS Portable an online installer is a really, really bad idea IMHO; I've got somewhere around a dozen apps, and needing to re-download NSISu Portable every time is going to drive me crazy. (Alternately, could you let us specify the path to NSISu? That would be a nice, clean solution)

EDIT: what gives with NSISu? I got two messages when I tried to recompile PAL for WorldClock:

  !warning: Unable to get AppID from appinfo.ini; it should have a line AppID=AppNamePortable in it. Used value PortableApps.comLauncher instead. (D:\DOCS\Programming\PAF\WorldClock\WorldClock (3)\Other\Source\PortableApps.comLauncher.nsi:191)
  !warning: Unable to get Name from appinfo.ini; it should have a line Name=App Name Portable in it. Used value PortableApps.com Launcher instead. (D:\DOCS\Programming\PAF\WorldClock\WorldClock (3)\Other\Source\PortableApps.comLauncher.nsi:199)

Despite what NSISu says, though, my appinfo.ini sure as heck has both a Name and an AppID line; here's my appinfo.ini. http://pastebin.com/fJfzVTP1

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
hg tip?

That error looks to me typical of an earlier version before I fixed it so it worked with spaces. I think you're not using the latest version from the hg repository.

I don't know quite what you're going on about with Unicode NSIS Portable and online installers. Install Unicode NSIS Portable once and it all works nicely. The path to makensis.exe can be specified in Data\settings.ini (as it tells you if it doesn't find it).

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

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
hg ftw

Chris MorganThat error looks to me typical of an earlier version before I fixed it so it worked with spaces. I think you're not using the latest version from the hg repository.

You're right; that was stupid of me. I was using the version posted here.
I'll go grab the latest version from the hg repo.

Chris MorganI don't know quite what you're going on about with Unicode NSIS Portable and online installers. Install Unicode NSIS Portable once and it all works nicely. The path to makensis.exe can be specified in Data\settings.ini (as it tells you if it doesn't find it).

I'm probably screwing myself up again, but here's what I did.
* Install PAL to D:\DOCS\Programming\PAF\WorldClock\WorldClock Portable (3)
* Set up PAL to work with WorldClock
* Run the included LauncherGenerator.exe and point it to D:\DOCS\Programming\PAF\WorldClock\WorldClock Portable (3)
* LauncherGenerator.exe returned an error, saying it couldn't find UnicodeNSISPortable (it was looking in ..\UnicodeNSISPortable)
* Installed UnicodeNSISPortable to D:\DOCS\Programming\PAF\WorldClock\UnicodeNSISPortable
* Ran LauncherGenerator.exe again; it gave the error I described.
* Copied NSISu to the appropriate spot for NISEdit
* Tried to recompile PAL manually, and got the error I described.
* Posted here, looking for some guidance (sorry if I came off badly, I was quite frustrated at not being able to #1 get this working and #2 take some time to debug it)

The problem, the way I'm seeing things, is not being able to specify the location of NSISu; however, I hadn't seen or tried to change anything in Data\settings, so I'll go take a look. If I can figure out how to get NSISu to recognize my AppID and Name lines, I won't even need to worry about that as NISEdit will do the "dirty" work for me.
Success, thanks to Gringoloco!
One problem I did have, though, is that manual recompilation of PAL turned out WorldClock.exe instead of WorldClockPortable.exe; is that a problem with my appinfo.ini, or is that something with the PAL code?

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Separate package

Now, PAL should be installed in a directory of its own. It's a separate package of its own, just like the PortableApps.com Installer is a package of its own. Don't install it in the same directory with a package you're making. Try all that out and see how it goes.

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

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
Now you tell me

after I just spent ~1 hour recompiling all my apps' launchers Blum
Seriously, that's not a big deal; thanks for telling me, though.

EDIT: oh, it looks like LauncherGenerator.exe is doing exactly what I accomplished by manually recompiling PAL. I guess I'll leave my launchers alone for now.

EDIT 2: LauncherGenerator apparently doesn't handle warnings from NSISu very well! It worked ok with "standard" NSIS, but as soon as I set it up to use NSISu it generated the launcher and then hung. I had to use Process Explorer to kill it.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 48 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Hg Fix Doesn't Mean It's Fixed

Chris, people won't be using latest from Hg tip. Everything we discuss in the forums should be concerning the current release, currently 2.0 Beta 2. If it's not released, you have to assume people don't have it. If it's fixed in tip, you can say that it "will be fixed in the next release" and, if you're feeling adventurous, you can download it all and compile it and it should be working (but it may have other bugs). We don't expect people packaging apps to install, configure and learn to use Hg.

The bottom line is that it's not "fixed" until the fix is in a posted, released version.

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

Mark Sikkema
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-07-20 14:55
the appinfo is an NSIS 2.45 thing...

NSIS 2.45 has a problem using !searchparse on an INI file what contains empty lines !
That's why Chris built in a safety feature so you're able to compile and 'just' get the warnings !
Anyway, if you take the empty lines out of your appinfo.ini it works like a charm !

BTW: Sorry about Unicode NSIS being an online installer, but really I wanted to test the Unicode NSIS online installer & extracting feature and it saves me a lot of hassle with uploading !
Why do you need to re-download Unicode NSIS anyway ??? Nevermind !

Formerly Gringoloco
Windows XP Pro sp3 x32

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
NSISu

GringolocoNSIS 2.45 has a problem using !searchparse on an INI file what contains empty lines !
That's why Chris built in a safety feature so you're able to compile and 'just' get the warnings !
Anyway, if you take the empty lines out of your appinfo.ini it works like a charm !

Yep, you're dead-on! Manual recompilation is working now! Biggrin

GringolocoBTW: Sorry about Unicode NSIS being an online installer, but really I wanted to test the Unicode NSIS online installer & extracting feature and it saves me a lot of hassle with uploading !

That's not a problem anymore; sorry if I worried you.

Thanks for the help!

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
Launcher Doesn't work - I'm probably doing something stupid

Any time I try to run the launcher (after naming it according to the manual and creating the App\AppInfo\Launcher\Console2Portable.ini) I get this error message:

PortableApps.com Launcher cannot be started. You may wish to re-install to fix this issue. (Error: ......App\AppInfo\appinfo.ini cannot be found).

Thanks for any info.

Dave

Axel Foley
Offline
Last seen: 5 years 1 month ago
Joined: 2006-09-11 17:17
same problem

Same problem here.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Perhaps

Looks like I see the issue, Did you rename the Launcher to Console2Portable.exe? or to some other name? The ini and the exe file need to be named the same except the file extension.

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
Yes, I renamed it to the exact same name as the ini

Yes, I renamed it to the exact same name as the ini

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Sorry I misread

Actually script was right there are 2 ini file the one for the launcher is in app\appinfo\launcher that is the one for hte launcher and should have same name as the launcher.

The second one is in app\appinfo and should contain the info about the program this is a separate file and remains named appinfo.ini The appinfo.ini should look something like this:

[Format]
Type=PortableApps.comFormat
Version=1.0

[Details]
Name=PortableApps.com Launcher
AppID=PortableApps.comLauncher
Publisher=PortableApps.com
Homepage=PortableApps.com/development
Category=Utilities
Description=The PortableApps.com Launcher is a universal launcher, configured by INI options, to make almost anything portable.
Language=Multilingual

[License]
Shareable=true
OpenSource=true
Freeware=true
CommercialUse=true

[Version]
PackageVersion=1.9.9.2
DisplayVersion=2.0 Beta 2

[Control]
Icons=1
Start=PortableApps.comLauncherGenerator.exe

Of coures with your info in it.

The Console2Portable.ini file should look something like this with your specs:

[Launch]
ProgramExecutable=Console2Portable\Console2Portable.exe

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
Thanks! That works! One question, though...

If I want to create another launcher for another program in the same directory structure, how do I go about that? Is it even possible?

(The console set up python portable for me, But I want to create another link to IDLE, Python editor)

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
Well, I got it to work

I created one appinfo.ini file but to different launchers. In the appinfo.ini I put the details of both programs (two appID.. etc). Everything seems to work fine.

One niggle is that I can't find how to create different splash screens for each program. The launcher seems to be looking for a file named splash.jpg and that's it.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 48 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
One App

That's because it's one app per directory. One splash per app. Even an app like OO.o with multiple things, it's still one app, so it gets one splash.

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

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
Read the error.

You need the App/AppInfo/appinfo.ini file.

Read this.

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
I tried creating an appinfo file

and adding appid=myapp inside because someone on the forum mentioned it. Didn't work. Even though the file was right there it kept claiming it can't finds it.

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
Can you host your project

Can you host your project anywhere for us to take a look?

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
vf2nsr found the problem (this one at least)

What I'm trying to do is create a version of python that is portable & current since http://portablepython.com seems pretty much dead. Once I manage to do that I will post the steps necessary so anyone could reproduce them.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
hmm

http://www.portablepython.com/ that is what I use although it is not in PA format it did load the correct version. Remember there is PortablePython and PythonPortable

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
Yes, but his Python 3 version is still 3.0.1

Which has a problem with very slow IO (the IO module was written in Python).

scriptdaemon
Offline
Last seen: 5 years 3 days ago
Developer
Joined: 2008-10-10 17:40
Have you taken a look at this

Have you taken a look at this package? I haven't used it, but I think it does just what you're trying to do.

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
Yep.

Thanks, but It's python version 2.6, not 3.1. Also I add my own packages and IDE's.

vf2nsr
vf2nsr's picture
Offline
Last seen: 8 years 1 month ago
Developer
Joined: 2010-02-13 17:10
Good Luck

Good luck in your endeavor, if you put something together I would love to take a look, are you including py2exe?

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

dave.berk
Offline
Last seen: 14 years 7 months ago
Joined: 2009-03-19 15:52
Sadly, no. as it hasn't been ported to Python 3 yet

Once I get it all working I will write a short guide how to do it if there is interest. Though it is not that hard to be honest. I expect I'll hit the real problems when I'll try to create a portable version of QtCreator...

aamiel
aamiel's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2008-11-03 04:53
Registry problems

As MaximaPortable hasn't been updated for a while I made my own. It seems to work fine on most computers but it left registry settings on two I have tried so far. The both run XP SP2. The registry was handled fine on windows 7 and XP SP3 computers.

The ini file is:

[Launch]
ProgramExecutable=Maxima\wxMaxima\wxMaxima.exe

[Activate]
Registry=true

[RegistryKeys]
maxima_portable=HKEY_CURRENT_USER\Software\wxMaxima

[Environment]
MAXIMA_PREFIX=%PAL:AppDir%\Maxima
MAXIMA_TEMPDIR=%TEMP%\MaximaPortable
MAXIMA_USERDIR=%PAL:DataDir%\settings

If I can be of some help on this, let me know.

[Use <pre> rather than <code> for blocks of code - mod Chris]

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
TEMP

MAXIMA_TEMPDIR should just be %TEMP%, or more likely left out. Assigning a contained temp directory is handled by the launcher and you don't need to worry about the %TEMP%\MaximaPortable bit (or rather, you shouldn't as it may cause it to not work).

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

Topic locked