You are here

[Outdated] Chris's PortableApps.com Launcher Test 5 (2009-05-25)

85 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] Chris's PortableApps.com Launcher Test 5 (2009-05-25)

This has become the PortableApps.com Launcher.

Chris's PortableApps.com Launcher is your PAL in making portable apps Smile It is configured with an INI file which goes in App\ChrisLauncher\AppNamePortable.ini, and uses a splash screen in App\ChrisLauncher\AppNamePortable.jpg.

Download Chris's PortableApps.com Launcher Test 5 [339KB download / 314KB installed]
(MD5: af77bfd9374e42590222c7f25009545e)

Using Chris's PortableApps.com Launcher:
Install it somewhere, and then copy PortableApps.comLauncher.exe into your portable app's directory, named e.g. AppNamePortable.exe. Configure it with an AppNamePortable.ini file in your portable app's App\ChrisLauncher directory, and also copy the splash screen to App\ChrisLauncher\AppNamePortable.jpg. You can look at the included ChrisPortableApps.comLauncher.ini file, or read help.html which has pretty complete documentation of what everything does, including a couple of examples, like this one for 7-Zip which does everything that the current 7-Zip Portable launcher does, and updates drive letters as well:

[AppDetails]
PortableAppLongName=7-Zip Portable
AppLongName=7-Zip
ProgramDirectory=7-Zip
ProgramExecutable=7zFM.exe

[LiveMode]
CopyData=true

[Registry]
7zip_portable=HKEY_CURRENT_USER\Software\7-Zip

Also this Code::Blocks one:

[AppDetails]
PortableAppLongName=Code::Blocks Portable
PortableAppShortName=CodeBlocksPortable
AppLongName=Code::Blocks
ProgramDirectory=CodeBlocks
ProgramExecutable=codeblocks.exe

[LaunchDetails]
DefaultCommandLineArguments=--no-check-associations --no-dde --no-splash-screen

[LiveMode]
CopyData=true

[DirectoriesMove]
personalities=%APPDATA%\codeblocks
UserTemplates=%APPDATA%\codeblocks
share=%APPDATA%\codeblocks

[DirectoriesCleanupIfEmpty]
1=%APPDATA%\codeblocks

[DriveLetterUpdate]
1=%DATADIR%\personalities\default.conf

Release Notes:

  • Test 5 (2009-05-25):
    • Made AssignContainedTempDirectory work with WiatForProgram=false
    • Improved Java support (not just CommonFiles)
    • INI Change: [LaunchDetails]:RequiresJava is now [CommonFiles]:Java=require (=require or find)
  • Test 4 (2009-05-24):
    • Remove newadvsplash.dll with WaitForProgram=false
    • Fixed major bug with ForEachINIPair, should all work fine now.
    • Added read-only attribute removal with Live mode.
  • Test 3 (2009-05-23): decent Java support, changed DirectoriesMove behaviour, fixed minor documentation issues.
  • Test 2 (2009-05-21): another release, live mode, rather different INI format, loads of improvements, bugfixes, debugging mode, read the documentation for it all - no time to update everything now.
  • 0.9.9.1 a.k.a. Test 1 (2009-05-07): Initial release
  • Still to do:

    • Language handling (via environment variables and ConfigWrite for starters)
    • "Live" mode (configurable with just two INI options, whether program data needs to be, and whether the program directory needs to be, copied to the local hard drive.) Done in Test 2
    • Examine all the launchers I can get my hands on and implement anything I can think of
    • Suggestions very welcome - please suggest things!

    Questions for other developers:

    • New question: should we go for a logical workflow-oriented layout, so that after a certain point, you can have logical structure to suit an application, line by line doing each action, instead of each thing in its own INI section? This would make e.g. BPBible possible easily - replace DataPath= with AugmentPath=, AugmentPath=%DATADIR%\resources with DataPath=%DATADIR%\resources, write INI string DataPath=%DATADIR%\resources (see BPBible launcher's source code for more details on how and why)
    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    This is awesome!

    One feature I'd like to request would be a substitution for ProgramData. This folder exists in Vista and later and many casual games (notably PopCap's) use it to store user data. I love PopCap's newest game, Plants vs. Zombies, and I'd love it even more if I could make it portable with this, but to do that I need to have a variable for ProgramData (I could hardcode it to use C:\ProgramData of course, but the folder may be named something different on different language versions of Windows).

    For reference, the environment variable with the location of ProgramData is %ALLUSERSPROFILE%.

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Update

    I just used it to portabilize PvZ, with the following INI:

    [AppDetails]
    PortableAppShortName=PlantsVsZombiesPortable
    AppLongName=Plants vs. Zombies
    ProgramDirectory=PlantsVsZombies
    ProgramExecutable=PlantsVsZombies.exe
    
    [LaunchDetails]
    DefaultCommandLineArguments=
    SetOutPath=$PROGRAMDIR
    AssignContainedTempDirectory=true
    
    [Registry]
    Key1=HKEY_CURRENT_USER\Software\PopCap\PlantsVsZombies
    Cleanup1=HKEY_CURRENT_USER\Software\PopCap\PlantsVsZombies
    Cleanup2=HKEY_CURRENT_USER\Software\PopCap
    
    [LocalFiles]
    SourceDirectory1=userdata
    TargetDirectory1=C:\ProgramData\PopCap Games\PlantsVsZombies

    ...and it works mostly flawlessly, except for one small issue: The local PlantsVsZombies folder (specified by TargetDirectory1) gets deleted afterwards. This can't be correct behavior, as I didn't specify it as a cleanup entry and the folder wasn't empty to start with (my local copy's user data was in there! :[). Is this a bug, or did I do something wrong?

    Update: I found another bug. If Data/settings doesn't exist before running the launcher, it won't be created automatically and therefore the launcher won't be able to save registry keys and the last drive letter.

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Chris

    Any updates on the above bugs? I'm assuming you missed this report due to the threading, so hopefully this will get your attention...

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

    No, I didn't miss it, it's just I'm busy with more than this. The Data\settings thing is something which would not happen if there was DefaultData, but that's not required so I've added a line to create Data\settings if it doesn't exist. I think also that I've fixed the moving bug, but I'm not absolutely sure (the code had changed quite a bit before you posted the report).

    Test 2 should be coming soon with these things fixed, and the suggestions to developers at the bottom of the main post (compacting of format) implemented, name updated, Live mode implemented (copy nothing, application, data, or both) and a few other things. I've also added your ALLUSERSPROFILE variable, and a couple of other variables. I've also forgotten about a few other things I've added, but ah well Wink

    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

    reederda
    Offline
    Last seen: 3 years 8 months ago
    Joined: 2009-02-12 19:59
    The Point:

    Just curious, what exactly is the difference between this and the regular launcher?

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

    The key feature of my launcher is that it gets configured with an INI file - take a look at the NSIS source code from some of the other launchers, for example 7-Zip's, and compare it with the INI file for my launcher.

    My launcher is not as powerful as NSIS by itself, but will do everything perfectly (hopefully!) for running a portable application - backing up anything already there, putting things where they're needed, etc. As time goes on, more and more features will be added to it so that it does everything we need. At the moment, I think it could replace just about all of our apps' launchers, with the exception of language handling. Some, such as my own BPBible Portable, have of necessity more complex scripting. They need a bit more planning and work for the launcher before they'll be completely ready to go with a generic launcher. (See my comment at the bottom for an explanation of BPBible's more complex launcher features.)

    I personally think that one of the biggest wonders of it all is the size... my launcher is still under 100KB compiled, and yet it can do more than e.g. 7-Zip's can, which from memory is about 120KB, with digital signature - normally a few kilobytes...

    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

    John T. Haller
    John T. Haller's picture
    Offline
    Last seen: 10 hours 1 min ago
    AdminDeveloperModeratorTranslator
    Joined: 2005-11-28 22:21
    Splash

    Don't forget that the splash is compiled in. With the new solution, it'll be 50KB in addition to the launcher.

    Sorry I haven't been in touch about the official launcher and working together yet. I've been a bit distracted by some family stuff. But I should be able to get it to you next week with the additional features I mentioned.

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

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    Ah yes, the splash

    I'd forgotten about that.

    Thanks for the status update Smile

    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

    EspaÑaks (not verified)
    Unfortunately no...

    but to do that I need to have a variable for ProgramData (I could hardcode it to use C:\ProgramData of course, but the folder may be named something different on different language versions of Windows).

    Nope. It was likely strange when I was trying to install spanish old apps with old installers in a spanish vista & it wanted to get installed in "C:\Program Files" & then it got shown up in "c:\Archivos de Porgrama". There is some function running in the windows explorer, that show a different name for system folders when localized. I had to use Xenon to figure this out.

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

    I think he was just meaning as a temporary thing; of course, using the proper variables is what should be done, and that's now supported in the latest version.

    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

    John T. Haller
    John T. Haller's picture
    Offline
    Last seen: 10 hours 1 min ago
    AdminDeveloperModeratorTranslator
    Joined: 2005-11-28 22:21
    Some Changes

    Chris, let's call this "Chris' PortableApps.com Launcher Test" as "PortableApps.com Launcher" will be the name of the official one (and it won't start at version 1.9.9.1). And, for now, have the filename be ChrisPortableApps.comLauncher.exe and have it use App\ChrisLauncher for now so we don't have collisions later with the official one.

    The official one uses some different configs and getting the two confused will cause people headaches.

    I like your use of LogicLib as it's far more readable. If you'd like to join forces and possibly maintain the official one (which will likely be a mix of mine and yours anyway), just drop me an email.

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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Quick note

    It really shouldn't be using App\Launcher at all; IMO, the launcher settings should be in AppInfo.

    Edit: Also, why rename App\Launcher to App\ChrisLauncher? That's like saying Windows\Fonts should be named Windows\WindowsFonts... it's redundant.

    OliverK
    OliverK's picture
    Offline
    Last seen: 3 years 5 months ago
    Developer
    Joined: 2007-03-27 15:21
    What about IntelliLaunch?

    What about IntelliLaunch?

    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
    Forgotten

    I'd completely forgotten about it after having seen it once in your blog a long time ago...

    Having looked at it again, and seen its INI format, I really think mine is a lot nicer and more powerful. I haven't looked at your code though.

    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
    But of course. On the other

    But of course.

    On the other hand, mines handles HKLM as well as HKCU. I don't have multiple reg support yet. I haven't studied yours enough to figure out how you pulled it off, yet.

    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
    Anywhere in the registry

    Mine will work with any place in the registry, as it passes the string into the registry plugin directly. If you specify HKEY_LOCAL_MACHINE\Software\Something, then it'll do it if the user has the requisite permissions. (Incidentally, Test 1 only has a single "failed" flag, which means it will misbehave slightly if you have one which it can't do, and another which it can, for example an HKEY_CURRENT_USER key and an HKEY_LOCAL_MACHINE key - that's fixed for Test 2 though by a WriteINIStr and ReadINIStr with a temporary file to say what failed.)

    HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_CURRENT_CONFIG, they should all work. Even HKEY_USERS would work, but it should nevr be used as no two user IDs should be the same.

    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
    Fair enough, I haven't played

    Fair enough, I haven't played with yours at all. I assume you're gonna chnage the icons as well?

    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
    No?

    Why would I change the icons? The icon used is the PortableApps.com icon, and that's what it's meant to be. The PortableApps.com Platform will use the icons in App\AppInfo\appicon*.ico, not the one inside the launcher executable, so that's no trouble.

    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

    NathanJ79
    NathanJ79's picture
    Offline
    Last seen: 4 years 9 months ago
    Joined: 2007-07-31 15:07
    Wow

    Would I be correct in assuming that this launcher basically makes apps which are mostly portable to start with portable to PortableApps.com standards? Like for example CCleaner Portable, nevermind there's a launcher for it, but would I be correct in assuming I could install this, dump CCleaner Portable in the appropriate folder, configure the .INI, and be good to go?

    If I'm reading this right, awesome job. If not, I'm sure it's still pretty impressive.

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    No, it's more than that.

    This is for applications which leave data lying around on the host computer, or in the registry, or have issues because they don't update drive letters, or need command line arguments passed to them to tell them where to get their data, or... the list goes on. See, as an example of usage, the 7-Zip launcher.ini file for it. The launcher reads that, and then goes and does the rest.

    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

    NathanJ79
    NathanJ79's picture
    Offline
    Last seen: 4 years 9 months ago
    Joined: 2007-07-31 15:07
    Few questions

    OK, I see where this is going, I think.

    Can ProgramExecutable= point inside a folder, or just to the one folder? Can I say, for example, "ProgramExecutable=System\DeusEx.exe", in order to make your launcher call that game's EXE from another level down?

    You say it can pass command-line arguments - that's great, the game's put into a cheat-allowed mode with a command line switch (-hax0r). Can it also do batch functions too? For example - same game - there are gameplay mods which require 2 files to be swapped out. Can the launcher be made to go in, rename the original 2 files to some temp name, swap in the mod files, and upon exit, reverse those changes? There are a few other things I'd like it to do, but if it can do that, it can surely do the others.

    Lastly, is this released under a license that would allow me to distribute a set of the launchers pre-configured for the game (non-commercially, of course)? The game's publisher (Eidos) doesn't really care what the mod community does as long as nobody's making a profit - and as long as the game's not being pirated, of course.

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

    I've implemented copying of files as well as directories now.

    It is, like everything here, released under the GPL. If the game is not under the GPL or a GPL-compatible license though, you may run into legal issues though.

    Edit: didn't answer your first question Blum
    ProgramDirectory and ProgramExecutable are used in conjunction for running things, but separately for variable replacement. Thus I recommend that you have ProgramDirectory=DeusEx and ProgramExecutable=System\DeusEx.exe; then, the replacement variable "$PROGRAMDIR" will be the App\DeusEx directory - meaning that you can stick on System\... or whatever you need.

    This is going to be particularly relevant to apps with a *nix heritage, which use bin, share etc. directories inside the installation directory.

    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

    NathanJ79
    NathanJ79's picture
    Offline
    Last seen: 4 years 9 months ago
    Joined: 2007-07-31 15:07
    Awesome

    Thanks for the clarification and the warning. I'll see what I can do with this next time I get a couple days off.

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

    is now out.

    Release notes are scanty, as I've changed so much... look at the included help.html.

    As is popular with early releases of open source software, configuration files are now almost universally incompatible Smile It's all in a good cause though.

    Test 3 should have language support added, but it's not there yet.

    I'd particularly like opinions on my latest question... should we go for a logical workflow-oriented layout, so that after a certain point, you can have logical structure to suit an application, line by line doing each action, instead of each thing in its own INI section? This would make e.g. BPBible possible easily - replace DataPath= with AugmentPath=, AugmentPath=%DATADIR%\resources with DataPath=%DATADIR%\resources, write INI string DataPath=%DATADIR%\resources (see BPBible launcher's source code for more details on how and why) E.G.

    FindReplaceFile=%DATADIR%\settings\sword.conf
    Find=DataPath=
    Replace=AugmentPath=
    
    FindReplaceFile=%DATADIR%\settings\sword.conf
    Find=AugmentPath=%DATADIR%\resources
    Replace=DataPath=%DATADIR%\resources
    
    WriteINIFile=%DATADIR%\settings\sword.conf
    Section=Install
    Key=DataPath
    Value=%DATADIR%\resources
    

    Maybe even XML with some XML plugin, which would make it easier to work with in some ways.

    Umm... enjoy Smile

    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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Just tried Test 2

    For some reason DirectoriesMove isn't being honored. I looked at the source and I don't see any reason why this shouldn't be working:

    [AppDetails]
    PortableAppLongName=Plants vs. Zombies Portable
    AppLongName=Plants vs. Zombies
    ProgramDirectory=PlantsVsZombies
    ProgramExecutable=PlantsVsZombies.exe
    
    [LaunchDetails]
    SetOutPath=%APPDIR%\PlantsVsZombies
    AssignContainedTempDirectory=true
    SinglePortableAppInstance=true
    SingleAppInstance=true
    WaitForProgram=true
    
    [LiveMode]
    CopyApp=true
    CopyData=true
    
    [RegistryKeys]
    PlantsVsZombiesPortable=HKEY_CURRENT_USER\Software\PopCap\PlantsVsZombies
    
    [RegistryCleanupIfEmpty]
    1=HKEY_CURRENT_USER\Software\PopCap\PlantsVsZombies
    2=HKEY_CURRENT_USER\Software\PopCap
    
    [DirectoriesMove]
    userdata=%ALLUSERSPROFILE%\PopCap Games\PlantsVsZombies
    
    [DirectoriesCleanupIfEmpty]
    1=%ALLUSERSPROFILE%\PopCap Games\PlantsVsZombies
    2=%ALLUSERSPROFILE%\PopCap Games
    

    I receive no debug messages (Is there any way to disable those, by the way?) about userdata being backed up or restored, the local userdata is left as-is and therefore the game just uses whatever is already on the machine. Much less destructive than Test 1 (which deleted the local folder entirely), but still a major roadblock.

    Also, a quick note: The sample launcher INI has RegistryCleanup and DirectoriesCleanup, which confused me at first since it was inconsistent with the docs. I finally found out that CleanupIfEmpty was correct, but you might want to fix that since it'll confuse other people too, I'm sure.

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Also

    Please recompile this with John's Win7 NSIS patch. The "This program didn't install correctly" warnings on W7 on exit are annoying. Sad

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

    OK, you've yanked my leg enough Wink

    I finally got round to downloading and using it. Test 3 will be built with 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

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    The directory must exist for

    The directory must exist for files to be moved, i.e. Data\userdata must exist so that it can copy it to %ALLUSERSPROFILE%\PopCap Games\PlantsVsZombies - do note that in Test 2 it will be copied as %ALLUSERSPROFILE%\PopCap Games\PlantsVsZombies\userdata - is this what you want? You may need to have it called Data\PlantsVsZombies. This is something I've been thinking about, if you needed to copy something to e.g. USERPROFILE and ALLUSERSPROFILE, with the same name, you couldn't do it. For that reason, I've now changed the behaviour, so that %DATADIR%\from\*.* will get copied to to\*.* (formerly it would have been copied to to\from\*.*). I've now added a debug message for if it doesn't exist, notifying the developer that they may want default data.

    I think T3 should fix your issues.

    Debug messages are only shown if DEBUG is defined. I accidentally left this on in the build I released. Test 3 will have it turned off.

    I missed the INI sample file bit, thanks for picking it up Smile

    Due to these things and also the fact I've added Java support, Test 3 will be coming out very soon, and language support will be moved to the next milestone.

    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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    ...

    I figured it might have something to do with the directory not exising, so I tested that too. But even when I created an empty userdata folder, it still didn't work for some reason. I'll test again with Test 3 and see what happens.

    And yes, I'm aware of the directory bit. %ALLUSERSPROFILE%\PopCap Games\PlantsVsZombies\userdata is correct. One request though: Plants vs. Zombies only uses %ALLUSERSPROFILE% under Vista and later. Under XP and earlier, the userdata is stored directly in the app's directory (par for the course for XP apps--they just assume all users can write to Program Files). Any way I could handle this without making a custom launcher?

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Nope

    Test 3 still doesn't work. I've looked through the code, but I haven't found the source of the glitch yet. On further inspection, it's not only the DirectoriesMove INI section that isn't being honored, but the FilesMove, Environment, and RegistryKeys sections too (the debug messages--or rather, lack thereof--indicates this as well). The Cleanup sections /are/ being honored, though...

    In an effort to find the bug, I stuck a few extra DebugMsg lines in the code, and the ones outside the INI loops are executed, but none of the messages inside the loops are ever triggered, even when there is stuff in those INI sections. Now I'm wondering if it's a problem with the ForEachINIPair macro...

    Update: Yep, that was it. ForEachINIPair is still looking for App\Launcher\launcher.ini when it should be looking for App\ChrisLauncher\[launcher filename].ini. Looks like it's time for Test 4! Wink

    Update 2: Oh dear. Fixing ForEachINIPair myself was... enlightening. The macro is buggy as hell. For some strange reason it's reading environment variables from [AppDetails], and I'm seeing weird operations like the following, apparently from poor INI handling in said macro:
    "Copying file from Plants vs. Zombies Portable\PortableAppLongName to L:\PortableApps\PlantsVsZombiesPortable\Data\PortableAppLongName"

    Nevermind the fact that it's trying to copy a file when I don't even have a FilesMove section, the file name it's trying to use is obviously nonsensical. What the heck?

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

    That's probably what comes of moving it into a separate file early on in development: I forgot to fix some of the fairly major changes in it...

    Thanks for unearthing this! Test 4 will now be a priority update, along with a minor thing about leaving the splash DLL behind if WaitForApp=false (e.g. Java apps). Smile

    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
    Got it :-)

    The problem was that it was checking for the error flag, but it had not reset it. I added in a ClearErrors line and now it all seems to be working fine.

    To prevent the file thing happening again, same with the splash, I've added a define, LAUNCHERDIR, which is currently ChrisLauncher, and the splash function uses that. Everything using the launcher INI file now uses $LAUNCHERINI (I'd missed the ForEachINIPair macro which I moved out before using a variable...).

    Thanks, I think I've got it all now Smile

    Expect Chris's PortableApps.com Launcher Test 4 within the hour...

    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
    Test 3

    is out. Language handling is now Milestone-4±5 ;-).

    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
    Test 4 is out

    I believe that I've fixed all the issues in it now.

    Special thanks to Bruce for being the chief bug finder Smile

    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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Test 4 works great!

    Just tested with Plants vs. Zombies, no issues I can see. Registry gets backed up and restored properly, directory moves work as designed...

    Now do you promise you won't change the INI format again? Smile I'm now going to switch over all my Test 1 apps to Test 4, so I don't want to have go through all that again.

    Anyway, I do have a request. Could you make it so changes in [RegistryKeyWrite] are restored afterwards? To portabilize RPG Maker VX for my nephew, I have to write the RTP path to a specific key in HKLM (yes, I know this requires admin privileges). However, if RMVX is already installed, this key will contain the location of the local RTP. I'd like that to be restored after the portable version closes...

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    Can't promise; for things already managed

    No, I can't promise: see my question for developers about a more logical structure. Until such a time though all new releases should be completely backwards-compatible back to Test 3, i.e. just new added features such as languages which I've now got basic handling for in my source code.

    RegistryKeyWrite was designed for inside things which are already managed - see for example the Audacity launcher, or App\ChrisLauncher\AudacityPortable.ini. Sure you can't do it something like that?

    Maybe I'll put in a RegistryKeyWriteWithRestore section. I'll need to investigate the Registry plugin though to see how it's best to do it.

    Thanks for testing 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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Ah

    I understand now. I guess I could add the HKLM key in question to RegistryKeys, then. RegistryKeyWrite is processed after the registry has been backed up, right? Otherwise that won't work...

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

    RegistryKeys gets processed before RegistryKeyWrite.

    In my experience, everything that a portable app uses is the child of a key which you can move. I've never come across something where an app uses e.g. HKEY_LOCAL_MACHINE\Software\SomethingWhichIsShared\Value... it's practically always something like HKEY_LOCAL_MACHINE\Software\Company\Application\Value. If you can do it that way, then do Smile

    About the most complex I've come across so far is with Sweet Home 3D, which uses the Java preferences class/whatever (util.prefs.something I think it was... that was yesterday I was looking at it :P) HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\eteks\sweethome3d. My launcher (due for release later today, God willing) handles that, and then does RegistryCleanupIfEmpty on eteks, then com, then Prefs, then JavaSoft. Messy Smile

    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

    Bart.S
    Offline
    Last seen: 5 months 3 weeks ago
    Developer
    Joined: 2008-07-23 07:56
    shared registry keys

    In my experience, there are several apps using shared registry keys. Well, 2 of my apps do that.
    FreeMat, MuseScore and the already official ConvertAll Portable use "HKCU\Software\Trolltech\OrganizationDefaults\Qt\customColors". I haven't checked other Qt apps, but I think some others use that key too. Other devs here haven't bothered to find a common solution, so the only workaround is: "Don't use them at the same time"

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

    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

    App Guy
    Offline
    Last seen: 11 years 1 month ago
    Joined: 2008-03-16 14:24
    Limewire

    Is it possible that you could post the .ini code for a Limewire portable launcher? It is java and I am very new with portablizing java software. I mean I could ask for a portable version but this launcher you have created looks so much easier.

    May the Shwartz be with you

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    I'm pretty sure

    You can throw the LimeWire binaries into the FrostWire Portable package here (search around, I don't have the link handy) and it'll work. Even the latest 5.x versions worked when I tested.

    I'd have portabilized LimeWire myself using this actually, but doing so requires setting a bunch of environment variables and I'm not familiar with them all.

    App Guy
    Offline
    Last seen: 11 years 1 month ago
    Joined: 2008-03-16 14:24
    INI?

    Could I look at your ini file because the only part I am having trouble with is the DefaultCommandLineArguments.

    May the Shwartz be with you

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

    Take a look at my own GanttProject Portable and Sweet Home 3D Portable, which are both Java apps using CPALT. Both demonstrate usage of the Java system properties user.home and java.io.tmpdir, and Sweet Home 3D demonstrates usage of java.util.prefs.Preferences (the registry bit).

    I don't know exactly how Limewire works, but if it launches it with an executable, run it and then look at the execution string it runs, e.g. in Process Explorer. I can't remember exactly how you do it just now, but my memory is that you right click on the process (javaw.exe or e.g. limewire.exe), and click Properties or similar, and there'll be a field with the command line it was started with (i.e. process path followed by command line arguments passed to it). With GanttProject, there was a batch file to launch it, but with Sweet Home 3D I had to analyse what it did.

    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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Like I said

    I didn't actually make an INI for LimeWire because I'm not sure of all the environment variables/Java parameters it uses.

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    Great Program!

    Hi chris morgan, thank you for making this app! Smile

    i just like to ask you if it will be possible to have two or more registry keys for a single application? say i like to copy an HKLM, HKCU, and another HKCU, in [RegistryKeys],i tried adding variables 1 and 2, but it doesn't work.

    and is it possible to have an option to change icon on launcher, so it would look good in launchers.

    thanks!

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

    If you read the documentation, it'll tell you how you should be doing registry keys, for example:

    [RegistryKeys]
    appname_settings=HKEY_CURRENT_USR\Software\AppName\settings
    appname_hkcu=HKEY_CURRENT_USER\Software\SomethingElse
    appname_hklm=HKEY_LOCAL_MACHINE\Software\AnotherSomethingElse
    

    The icon which is compiled into it should not change. If you want a different icon (which you should) it should go in App\AppInfo\appicon.ico, as per the PortableApps.com Format specification. Currently that's what will be displayed, with the next release it will give preference to appicon_16.png.

    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

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    Thanks!

    hi chris morgan,

    thank you, i missed that one.

    will it be possible to change the icon in the compiled launcher? without recompiling it, sort of icon changer for chris's portableapps.com launcher.

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

    As I've said, no. This is not an option. Users will normally be launching it from the PortableApps.com Platform, which will display the correct, app-specific, icon. And changing the icon in the executable without recompiling it would break it (CRC).

    There is no need, and this will not be hapening with my launcher as it is now, or the official launcher when we've got that going.

    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

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    Thanks

    i see, well again thanks for making this launcher, really easy to use, looking forward to the release of the final version. cant wait!

    update,
    sorry to bother you again chris, but i followed what you said earlier about appname_hklm, appname_hkcu, and it doesnt show in the data\settings, only the first one which is appname_settings is there. is it really like that? i also check the appname_settings and it doesnt contain the hklm, or the other hkcu keys.

    thanks

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    Let's see... For starters,

    Let's see...

    For starters, make sure that they don't have the same name. That's sure to be a killer. After that, have a try turning the debug flag on: edit Other\Source\ChrisPortableApps.comLauncherTest.nsi and remove the ; from the start of the ;!define DEBUG line and then recompile it. Then see if it tells you about 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

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    Debug report

    hi chris morgan, i dont know what i should get from the debug, but here are the things i see peculiar.

    before the application starts, it only loads the reg in the data folder which is the appname_settings, the first key in the ini. it doesnt load the second which is appname_hklm, probably because its not in the settings folder

    after closing the application. i can see that it saves the first key to appname_settings.reg and also can see that its saving regstry key hkey_local_machine\software\applicationname\ to appname_hklm.reg

    but when i check it on data\settings only appname_settings.reg is present.

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

    Thanks for doing that, I'll take a look into it when I get an opportunity, if I find what's wrong I'll post a new release along with some other changes/improvements I've been making.

    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

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    Any Update?

    any update? :0

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    No(t yet)

    I'm not sure whether I'll be putting another update here, as the official PortableApps.com Launcher is coming soon. I'm still waiting on John to get what he's done, so that we can work together on 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

    John T. Haller
    John T. Haller's picture
    Offline
    Last seen: 10 hours 1 min ago
    AdminDeveloperModeratorTranslator
    Joined: 2005-11-28 22:21
    This Weekend

    I've blocked off some time this weekend now that I got other things in-line. So, expect a note in the forums by Tuesday about it.

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

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    Looking forward to this!

    Good Luck to both of you! Smile

    horusofoz
    horusofoz's picture
    Offline
    Last seen: 1 year 2 months ago
    Joined: 2008-04-03 22:45
    Ditto = )

    Ditto = )

    PortableApps.com Advocate

    denash
    Offline
    Last seen: 15 years 1 month ago
    Joined: 2007-04-08 12:14
    why is the file not beeing moved?
    
    [AppDetails]
    PortableAppLongName=AkelPad Portable
    AppLongName=AkelPad
    ProgramDirectory=AkelPad
    ProgramExecutable=AkelPad.exe
    
    [LaunchDetails]
    ;DefaultCommandLineArguments=--data-directory=%DATADIR%\settings
    SetOutPath=%APPDIR%\AkelPad
    AssignContainedTempDirectory=true
    SinglePortableAppInstance=false
    SingleAppInstance=true
    WaitForProgram=true
    WaitForOtherInstances=true
    RequiresJava=false
    ; If you need to run "javaw.exe %APPDIR%\Some\thing.jar", use ProgramExecutable=javaw.exe and DefaultCommandLineArguments=%APPDIR%\Some\thing.jar
    
    [LiveMode]
    CopyApp=true
    CopyData=true
    
    [RegistryKeys]
    AkelPad_portable=HKEY_CURRENT_USER\Software\Akelsoft\AkelPad\Options
    
    [RegistryCleanupIfEmpty]
    1=HKEY_CURRENT_USER\Software\Akelsoft\AkelPad\Options
    2=HKEY_CURRENT_USER\Software\Akelsoft
    
    
    [FilesMove]
    %APPDIR%\AkelPad\AkelPad.ini=%DATADIR%\settings\AkelPad.ini 
    
    [FileDriveLetterUpdate]
    Backslash1=%DATADIR%\settings\data.conf
    Forwardslash1=%DATADIR%\settings\data.conf
    
    [Environment]
    PATH=%APPDIR%\AppName;{&}
    HOME=%DATADIR%\settings
    ForwardslashTest=%/DATADIR%/settings
    DoubleBackslashTest=%\\DATADIR%\\settings
    
    

    I highlighted by problem. I am trying to move "akelpad.ini" from AkelpadPortable\App\AkelPad\ TO AkelPadPortable\Data\Settings\

    do u know how I am get this to work? thank you for your help in advance

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    settings\AkelPad.ini=%APPDIR%\AkelPad
    settings\AkelPad.ini=%APPDIR%\AkelPad

    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

    denash
    Offline
    Last seen: 15 years 1 month ago
    Joined: 2007-04-08 12:14
    thank you very much it worked

    thank you very much it worked Smile and the launcher is awesome, thank you for all your work on it Biggrin

    I got one more question... is it possible to change the icon of the launcher? like to the icon of the app I made portable?

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

    See # and #,

    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

    denash
    Offline
    Last seen: 15 years 1 month ago
    Joined: 2007-04-08 12:14
    thank you for all your help

    thank you for all your help Smile

    denash
    Offline
    Last seen: 15 years 1 month ago
    Joined: 2007-04-08 12:14
    another question....

    how would I redirect this:
    "C:\Documents and Settings\username\Contacts

    I know Ihave to put the this under:

    [DirectoriesMove]
    

    but I dont know what to put there to make it redirect...

    thank you for ur help Smile

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

    This isn't currently implemented. USERPROFILE is something which will need to be added. I think I'll wait for the official launcher though. Two things you could do in the meantime though, modify ChrisPortableApps.comLauncherTest.nsi to add it (pretty easy) or use %DOCUMENTS%\..\Contacts which may or may not work, depending on the app.

    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

    denash
    Offline
    Last seen: 15 years 1 month ago
    Joined: 2007-04-08 12:14
    thank you very much, i hope

    thank you very much, i hope you will be able to implement in in a future release Smile

    PollieXmas
    Offline
    Last seen: 13 years 6 months ago
    Joined: 2006-05-10 16:03
    Translating complex java parameters

    Hi Chris,

    I'm hoping that you can give me some pointers here...

    The (java) App I use is run using a relatively complex bat file. It's already stored on my portable HDD and making use of the portable java. However I would like to make this a proper portable app using your launcher.

    My first stumbling block is the complex commands to set the classpath command line arguments.

    What I think needs to be done is...

    [AppDetails]
    PortableAppLongName=Pentaho Data Intergration Portable
    AppLongName=Pentaho Data Intergration
    ProgramDirectory=PentahoDataIntergration
    ProgramExecutable=javaW.exe
    
    [LaunchDetails]
    DefaultCommandLineArguments=--%OPT%
    
    [CommonFiles]
    Java=require
    
    [DirectoriesMove]
    settings=%APPDATA%
    
    [DirectoriesCleanupIfEmpty]
    1=%APPDATA%\.kettle
    2=%APPDATA%\.pentaho
    
    [DirectoriesCleanupForce]
    1=%APPDATA%\.kettle
    2=%APPDATA%\.pentaho
    
    [Environment]
    CLASSPATH={&};libswt\runtime.jar;libswt\jface.jar;libswt\common.jar;libswt\commands.jar;libswt\win32\swt.jar
    OPT=-Xmx256m -cp %CLASSPATH% -Djava.library.path=libswt\win32\ -DKETTLE_HOME="%KETTLE_HOME%" -DKETTLE_REPOSITORY="%KETTLE_REPOSITORY%" -DKETTLE_USER="%KETTLE_USER%" -DKETTLE_PASSWORD="%KETTLE_PASSWORD%" -DKETTLE_PLUGIN_PACKAGES="%KETTLE_PLUGIN_PACKAGES%" -DKETTLE_LOG_SIZE_LIMIT="%KETTLE_LOG_SIZE_LIMIT%"
    

    The bat file that launches the application is as follows...

    @echo off
    
    REM **************************************************
    REM Check for Windows 2000, since the command line length is limited
    REM **************************************************
    ver | find "Windows 2000" >nul
    if errorlevel 1 goto nowin2k
    echo Attention: You are using Windows 2000. Please see
    echo http://wiki.pentaho.org/display/EAI/Windows+2000
    echo when Spoon does not start. After fixing the problem
    echo you can delete the pause line in your Spoon.bat file.
    pause
    :nowin2k
    
    REM **************************************************
    REM ** Set console window properties                **
    REM **************************************************
    REM TITLE Spoon console
    REM COLOR F0
    
    REM **************************************************
    REM ** Make sure we use the correct J2SE version!   **
    REM ** Uncomment the PATH line in case of trouble   **
    REM **************************************************
    
    set PATH=P:\PortableApps\CommonFiles\Java\bin;.;%PATH%
    
    REM **************************************************
    REM ** Libraries used by Kettle:                    **
    REM **************************************************
    
    set CLASSPATH=.
    
    REM ******************
    REM   KETTLE Library
    REM ******************
    
    set CLASSPATH=%CLASSPATH%;lib\kettle-core.jar
    set CLASSPATH=%CLASSPATH%;lib\kettle-db.jar
    set CLASSPATH=%CLASSPATH%;lib\kettle-engine.jar
    set CLASSPATH=%CLASSPATH%;lib\kettle-ui-swt.jar
    
    REM **********************
    REM   External Libraries
    REM **********************
    
    REM Loop the libext directory and add the classpath.
    REM The following command would only add the last jar: FOR %%F IN (libext\*.jar) DO call set CLASSPATH=%CLASSPATH%;%%F
    REM So the circumvention with a subroutine solves this ;-)
    
    FOR %%F IN (libext\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\JDBC\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\webservices\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\commons\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\web\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\pentaho\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\spring\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\jfree\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\mondrian\*.jar) DO call :addcp %%F
    FOR %%F IN (libext\salesforce\*.jar) DO call :addcp %%F
    
    
    goto extlibe
    
    :addcp
    set CLASSPATH=%CLASSPATH%;%1
    goto :eof
    
    :extlibe
    
    REM **********************
    REM   Collect arguments
    REM **********************
    
    set _cmdline=
    :TopArg
    if %1!==! goto EndArg
    set _cmdline=%_cmdline% %1
    shift
    goto TopArg
    :EndArg
    
    
    REM *****************
    REM   SWT Libraries
    REM *****************
    
    set CLASSPATH=%CLASSPATH%;libswt\runtime.jar
    set CLASSPATH=%CLASSPATH%;libswt\jface.jar
    set CLASSPATH=%CLASSPATH%;libswt\common.jar
    set CLASSPATH=%CLASSPATH%;libswt\commands.jar
    set CLASSPATH=%CLASSPATH%;libswt\win32\swt.jar
    
    REM ******************************************************************
    REM ** Set java runtime options                                     **
    REM ** Change 256m to higher values in case you run out of memory.  **
    REM ******************************************************************
    
    set OPT=-Xmx256m -cp %CLASSPATH% -Djava.library.path=libswt\win32\ -DKETTLE_HOME="%KETTLE_HOME%" -DKETTLE_REPOSITORY="%KETTLE_REPOSITORY%" -DKETTLE_USER="%KETTLE_USER%" -DKETTLE_PASSWORD="%KETTLE_PASSWORD%" -DKETTLE_PLUGIN_PACKAGES="%KETTLE_PLUGIN_PACKAGES%" -DKETTLE_LOG_SIZE_LIMIT="%KETTLE_LOG_SIZE_LIMIT%"
    
    REM ***************
    REM ** Run...    **
    REM ***************
    
    start javaw %OPT% org.pentaho.di.ui.spoon.Spoon %_cmdline%
    

    The win2k test and command line arguments can be ignored for now.

    The %KETTLE_...% arguments are set the first time you run the app and is stored in "kettle properties" a ".kettle" folder in the windows user's documents and settings folder.

    There is also .pentaho directory that is created. I'm assuming by specifying "settings" in directories to move, it will move all the directories it can find in the settings directory?

    Any pointers would be appreciated.

    Thanks
    Paul

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

    First of all, I'll just help you to replicate it as nearly as possible. CPALT doesn't support arbitrary environment variables (the official launcher may in the future, it's not simple but it's possible without too much difficulty). So the command line arguments can't be passed as an environment variable, they've got to be in there.

    The real problem area is the adding of everything to classpath. There's no way that can be done with CPALT. So long as it's a fixed set of files, you can add them manually.

    The executable should really be "javaw.exe", but it shouldn't be case sensitive.

    ...
    
    [LaunchDetails]
    DefaultCommandLineArguments=-Xmx256m -cp ".;lib\kettle-core.jar;lib\kettle-db.jar;lib\kettle-engine.jar;lib\kettle-ui-swt.jar;*** EXTRA JAR FILES IN LIBEXT ***;libswt\runtime.jar;libswt\jface.jar;libswt\common.jar;libswt\commands.jar;libswt\win32\swt.jar" -Djava.library.path=libswt\win32\ -DKETTLE_HOME="%KETTLE_HOME%" -DKETTLE_REPOSITORY="%KETTLE_REPOSITORY%" -DKETTLE_USER="%KETTLE_USER%" -DKETTLE_PASSWORD="%KETTLE_PASSWORD%" -DKETTLE_PLUGIN_PACKAGES="%KETTLE_PLUGIN_PACKAGES%" -DKETTLE_LOG_SIZE_LIMIT="%KETTLE_LOG_SIZE_LIMIT%" org.pentaho.di.ui.spoon.Spoon
    
    ...
    
    [Environment]
    PATH=%JAVADIR%\bin;.;{&}
    

    As for the KETTLE_* variables, I'm not clear about how they're fetched, they don't seem to be handled by that batch file.

    Settings management: this should be settings=%APPDATA%\.pentaho (or whatever) so that Data\settings\* will be copied to %APPDATA%\.pentaho\*. However, from your description, it sounds like they're in C:\Documents and Settings\user\.pentaho etc.? If so, try adding in (before the other -D parameters) -Duser.home="%DATADIR%\settings". This is likely to catch all settings with no need to resort to moving back and forth.

    ---

    I think I've answered all your questions, if not, just ask again, I'll try to catch them all again...

    try:
        answer_questions()
    catch (MissedAQuestionException):
        answer_questions_again()
    finally:
        panic()
    

    ---

    Edit: I thought of an easier way of catching everything (except the PATH bit); change the start javaw line to an echo line and then pause after it and copy it down (using Quick Select mode of course... you'll have to join the lines but that's a small job :P).

    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

    PollieXmas
    Offline
    Last seen: 13 years 6 months ago
    Joined: 2006-05-10 16:03
    Thanks

    Hi Chris,

    Thanks for the response.

    The .kettle and .pentaho directories are in fact in the C:\Documents and Settings\user directory. Can you have two commands in the move directories section?

    The contents of these files are read by the app once it have started. That's why it does not appear in the bat file. You'll also notice that they are blank/null when using the bat file as the files currently does not contain any information.

    Then I tried the following. I used the pause you suggested and simply copied the entire argument line.

    [AppDetails]
    PortableAppLongName=Pentaho Data Intergration Portable
    AppLongName=Pentaho Data Intergration
    ProgramDirectory=PentahoDataIntergration
    ProgramExecutable=javaw.exe
    
    [LaunchDetails]
    DefaultCommandLineArguments=-Xmx256m -cp .;lib\kettle-core.jar;lib\kettle-db.jar;lib\kettle-engine.jar;lib\kettle-ui-swt.jar;libext\dom4j-1.6.1.jar;libext\edtftpj-2.0.2.jar;libext\jackcess-1.1.18.jar;libext\jakarta-oro-2.0.8.jar;libext\janino.jar;libext\javadbf.jar;libext\jaxen-1.1.1.jar;libext\jcifs-1.3.3.jar;libext\js.jar;libext\jsch-0.1.38.jar;libext\jug-lgpl-2.0.0.jar;libext\junit-4.1.jar;libext\jxl.jar;libext\kettle-version-checker-0.1.0.jar;libext\ldapjdk.jar;libext\log4j-1.2.8.jar;libext\mail.jar;libext\ognl-2.6.9.jar;libext\saxon8.jar;libext\SNMP4J.jar;libext\trilead-ssh2-build213.jar;libext\JDBC\db2jcc.jar;libext\JDBC\db2jcc_license_cu.jar;libext\JDBC\derby.jar;libext\JDBC\derbyclient.jar;libext\JDBC\h2.jar;libext\JDBC\hsqldb.jar;libext\JDBC\ifxjdbc.jar;libext\JDBC\iijdbc.jar;libext\JDBC\infobright-core-2.4.jar;libext\JDBC\interclient.jar;libext\JDBC\jaybird-full-2.1.0.jar;libext\JDBC\jt400.jar;libext\JDBC\jtds-1.2.2.jar;libext\JDBC\kingbasejdbc.jar;libext\JDBC\LucidDbClient.jar;libext\JDBC\monetdb-1.7-jdbc.jar;libext\JDBC\mysql-connector-java-3.1.14-bin.jar;libext\JDBC\ojdbc14.jar;libext\JDBC\orai18n.jar;libext\JDBC\postgresql-8.3-603.jdbc3.jar;libext\JDBC\rdbthin.jar;libext\JDBC\sapdbc.jar;libext\JDBC\sqlitejdbc-v037-nested.jar;libext\JDBC\unijdbc.jar;libext\JDBC\vertica_2.5_jdk_5.jar;libext\JDBC\xdbjdbc.jar;libext\webservices\jsr173_api.jar;libext\webservices\qname.jar;libext\webservices\wsdl4j.jar;libext\webservices\wstx-asl-3.2.0.jar;libext\commons\commons-beanutils-1.7.0.jar;libext\commons\commons-codec-1.3.jar;libext\commons\commons-collections-3.1.jar;libext\commons\commons-dbcp-1.2.1.jar;libext\commons\commons-digester-1.8.jar;libext\commons\commons-fileupload-1.0.jar;libext\commons\commons-httpclient-3.0.1.jar;libext\commons\commons-lang-2.2.jar;libext\commons\commons-logging-1.1.jar;libext\commons\commons-net-1.4.1.jar;libext\commons\commons-pool-1.3.jar;libext\commons\commons-validator-1.3.1.jar;libext\commons\commons-vfs-2.0-20090205.jar;libext\web\activation.jar;libext\web\jetty-6.1.9.jar;libext\web\jetty-plus-6.1.9.jar;libext\web\jetty-util-6.1.9.jar;libext\web\servlet-api-2.5-6.1.9.jar;libext\web\simple-jndi-0.11.1.jar;libext\pentaho\libbase-1.0-SNAPSHOT.jar;libext\pentaho\libformula-1.0-SNAPSHOT.jar;libext\pentaho\pentaho-database-2.1-SNAPSHOT.jar;libext\pentaho\pentaho-formula-editor-0.0.1.jar;libext\pentaho\pentaho-versionchecker.jar;libext\pentaho\pentaho-vfs-browser-i18n.jar;libext\pentaho\pentaho-vfs-browser.jar;libext\pentaho\pentaho-xul-core-2.5.4.jar;libext\pentaho\pentaho-xul-swt-2.5.4.jar;libext\spring\spring-core.jar;libext\jfree\jcommon-1.0.14.jar;libext\jfree\jfreechart-1.0.1.jar;libext\mondrian\commons-math-1.0.jar;libext\mondrian\eigenbase-properties.jar;libext\mondrian\eigenbase-resgen.jar;libext\mondrian\eigenbase-xom.jar;libext\mondrian\javacup.jar;libext\mondrian\mondrian.jar;libext\mondrian\saxon8-xom.jar;libext\salesforce\axis.jar;libext\salesforce\commons-discovery-0.2.jar;libext\salesforce\jaxrpc.jar;libext\salesforce\saaj.jar;libext\salesforce\salesforce-1.0.jar;libswt\runtime.jar;libswt\jface.jar;libswt\common.jar;libswt\commands.jar;libswt\win32\swt.jar -Djava.library.path=libswt\win32\ -DKETTLE_HOME="" -DKETTLE_REPOSITORY="" -DKETTLE_USER="" -DKETTLE_PASSWORD="" -DKETTLE_PLUGIN_PACKAGES="" -DKETTLE_LOG_SIZE_LIMIT="" org.pentaho.di.ui.spoon.Spoon
    
    [CommonFiles]
    Java=require
    
    [Environment]
    PATH=%JAVADIR%\bin;.;{&}
    

    It still does not work, but now just to make sure I understand how to use your app.

    The ini and jpg files go in PentahoDataIntegrationPortable\Apps\ChrisLauncher and the app I want to launch goes in PentahoDataIntegrationPortable\Apps\PentahoDataIntegration

    Once that is done you simply launch you exe in PentahoDataIntegrationPortable?

    I can see the splash screen come up, but that's it.

    Can you spot something that I'm doing wrong?

    Thanks
    Paul

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

    The working directory will need to be set correctly. This is done with a [LaunchDetails]:SetOutPath=%APPDIR%\PentahoDataIntegration

    The files should be App\ChrisLauncher and App\PentahoDataIntegration. Also you may wish to switch from PentahoDataIntegration to Pentaho (I don't know) just to make it shorter. And then remember to rename ChrisPortableApps.comLauncherTest.exe to PentahoPortable.exe and have the INI and JPG files named PentahoPortable.*.

    As for settings, before -DKETTLE_HOME="" put in -Duser.home="%DATADIR%\settings", and your settings should magically stay on your USB drive Smile

    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

    PollieXmas
    Offline
    Last seen: 13 years 6 months ago
    Joined: 2006-05-10 16:03
    Still no luck

    Hi Chris,

    I'm still not having any luck and posted on the PDI forum to see if we can get some help.

    Something I picked up there is that we can specify the following -DKETTLE_HOME="%DATADIR%\settings" in stead of -Duser.home="%DATADIR%\settings".

    I thought that it might be that java_home is not set but then my "portable" spoon.bat file would also have failed.

    Let's see if someone over there gives us some pointers.

    Regards
    Paul

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    any update?

    any update? i found a somewhat similar app x-launcher in winpenpack, but this is easier to use.

    John T. Haller
    John T. Haller's picture
    Offline
    Last seen: 10 hours 1 min ago
    AdminDeveloperModeratorTranslator
    Joined: 2005-11-28 22:21
    It's Coming

    It's coming. We're still catching up on some other releases.

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

    dudekracked
    Offline
    Last seen: 8 years 8 months ago
    Joined: 2008-08-05 11:28
    looking forward!

    thanks john for the update!

    dinosoep
    Offline
    Last seen: 13 years 11 months ago
    Joined: 2009-12-14 15:12
    awesome!!!! thanks for this

    awesome!!!!
    thanks for this Smile

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    ...

    I found a bug recently: When CopyApp is set to true but CopyData is false (I want to do this for Plants vs. Zombies because it takes ages to load directly from flash), and RunLocally is on, managed directories and files aren't copied properly to the local machine.

    What it looks like is happening is that it's trying to fetch the data from the wrong spot (i.e. the launcher folder as opposed to Data) and this results in nothing being copied, and therefore the app starts with default settings.

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

    Just so you all know, this is not dead!

    I expect to do a release tomorrow or Friday but I'll see how I go. Tomorrow I go to enrol at Monash Uni. The next release will be branded "PortableApps.com Launcher 1.0 Pre-Alpha 1", then John'll put his work into it and we plan on going to beta.

    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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    ?

    Did you fix the bug I mentioned above? I couldn't find any mention of it on the page you linked to.

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

    I plan on looking at it later today.

    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
    Postponed

    I've analysed it more now and I can see exactly why it's happening. I need two types of parsing for App and Data I can see, source and destination. I think that for this release I'll leave it be, as it's fairly complex to fix and in my opinion there's not much benefit in it (and I'm working on a far better path parsing method). I think that I'll probably make it so that Data will always be copied and you only get choice about App, yes, unless I can think of a very good reason to do otherwise, I'll do that. The user specifying RunLocally=true will imply CopyData=true at the developer's end and you as the developer can choose whether or not to CopyApp.

    Then there's also the question of whether we want Live mode at all... Songbird definitely won't work with it and so won't most apps due to the directory-level moving (see my blog post for a proposed solution to it; I could integrate that with Live mode).

    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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Huh?

    My setup was this:

    CopyApp=true
    CopyData=false

    And then RunLocally=true in the INI. The reason for this setup is that Plants vs. Zombies takes ages to load from a flash drive, but I still want to keep my save data, however when I specify CopyData=true, it works as expected but discards the new data when the app quits.

    Chris Morgan
    Chris Morgan's picture
    Offline
    Last seen: 9 years 5 months ago
    Joined: 2007-04-15 21:08
    In that case you're using it

    In that case you're using it for what it's not intended. RunLocally is designed only for use from a read-only medium. I may put in another option after my next release to make it run faster, but there's this issue of directory-level moving which isn't supported by many applications too which I need to deal with.

    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

    Bruce Pascoe
    Offline
    Last seen: 12 years 10 months ago
    Joined: 2006-01-15 16:14
    Regardless

    The behavior I'm getting from it isn't correct. It's trying to fetch the data from the wrong location when CopyApp=true but CopyData=false. Since that scenario is possible with the current setup, it should work properly, otherwise you need to rethink the setup.

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

    I know it's possible with the current setup. That's why I'm making it so it'll be impossible with the next release Biggrin

    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