You are here

[Outdated] PortableApps.com Launcher 1.0 Alpha 4

215 posts / 0 new
Last post
John T. Haller
John T. Haller's picture
Online
Last seen: 23 min 21 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Don't Worry About...

Don't worry about detecting disk removal directly. Simply have the launcher always copy it's launcher.ini into the %PLUGINSDIR% on launch after instantiating it and then work off that copy. Also have any temp INI you use working from there as well. When running with the platform, the platform detects a disk removal and then will close out running apps but not launchers, allowing the launchers to clean up as normal. When running directly, the app will either crash or exit normally when done, and then the launcher can do its usual cleanup. You don't necessarily need to handle anything differently on the launcher's end because you can let CopyFiles and other operations just fail on the nonexistant drive. Or you could have it explicitly detect existence of it on app exit and then act accordingly.

For disable services, we don't need that fully sorted to go beta, I don't think.

And the documentation can wait until everything is finalized. A quick readme is fine at the moment.

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

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Mainly doing what's quick

I've disabled services (25KB smaller compiled now).

The biggest problem with cleanup is where an application copies from Data to App - this will really blow up in your face if the disk fails. When it's the CopyFiles and RMDir I'm happy to just let the CopyFiles cause errors... it's not serious. But when I'm using Rename, I've got to be able to fix it back up. I'm about to work on that now.

I just fixed TEMP handling when a PAL-powered app starts another one (so that the modified TEMP doesn't get inherited by PAL, put in another variable PAL:_TEMP to be detected by PAL). That this would be an issue occurred to me while riding home from Uni a couple of days ago.

Documentation is a work in progress. I'd like it to be at least at the stage where it's better than the current help.html before PAL becomes official. For the Beta however it's definitely not a prerequisite.

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
Online
Last seen: 23 min 21 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
On Launch

The launcher should check on launch to see whether data is copied back. Obviously on exit, if the drive has been pulled (or the PC has crashed), nothing can be done at all. So checking on launch whether a given directory or file exists in the destination (App directory) should take precedent.

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

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Started, continue next week

I've started on this, and will continue next week. I propose to post Beta 1 after doing 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

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

I've made quite a bit of progress on this; I've put in a "Status" flag to cope with it, which, if detected in Init, skips Pre* and Exec and goes straight to Post. However as MaienM pointed out if the user changes computer then local files may not be there - so I've improved FilesMove and DirectoriesMove so that they won't mess up portable settings if the local counterparts aren't there (before it would remove the portable ones, then try to copy over the... local ones... oh; whoops, shouldn't have deleted that).

Next I'm putting the launcher INI file into $PLUGINSDIR and working on 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

computerfreaker
computerfreaker's picture
Offline
Last seen: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
%EXEDIR%

There's a %PAL:AppDir% variable, and a %PAL:DataDir% variable, but I don't see a %PAL:EXEDir% variable anywhere; that's fairly important for multiple launchers, IMHO, since launcher1 has to call launcher2.
I'm adding support for that right now so I can finish up with REAL Studio; would you be interested in adding that to the official source?

EDIT: looks like %PAL:AppDir% and %PAL:DataDir% never get set unless RunLocally is on. Here's a patch (untested, but it should do it) that fixes that and adds a PAL:EXEDir variable:

Var EXEDir

${SetEnvironmentVariablesPath} PAL:AppDir $EXEDIR\App
${SetEnvironmentVariablesPath} PAL:DataDir $EXEDIR\Data
${SetEnvironmentVariablesPath} PAL:EXEDir $EXEDIR

"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: 8 years 9 months ago
Joined: 2007-04-15 21:08
Considered it but decided not to

I thought about it for the reason you list, but decided not to, for two main reasons:

  1. The reasons why you would want to put in a call to the first launcher with the second are limited - mainly insofar as I can see, setting an environment variable or passing something on the command line. If it's an environment variable, tough luck. If however it's a command line argument, you should not use a second copy of the launcher, you should just use [Control]:Start1 in appinfo.ini (yes, it does allow command line arguments, and that is by design).
  2. If you run a second Launcher inside the first, things may get messed up if they're closed out of order (particularly any data in contained temp). Also the waiting for other instances stuff isn't properly designed to have one directly launching another (for the sub application to do it is OK, but not having another launcher directly as the ProgramExecutable).

If you really want it to be doing practically the same thing, you'll need to duplicate the INI file. But I would also recommend that you explain more fully here what you're trying to do so that I can give you the best solution (exactly what the lecturer's been telling us in FIT1029 :D).

In regards to your edit, PAL:AppDir and PAL:DataDir are always set. See Other/Source/Segments/RunLocally.nsh, line 39. That's not inside any If block; the values $(App|Data)Directory will have depends on the If block above, but not the setting of the environment variables.

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: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
Thanks for pointing that out

Thanks for pointing that out with RunLocally; I hadn't noticed it wasn't in an If block. I'll have to actually look at the code for longer than 5 seconds next time.

I'm working on REAL Studio again; it's got a toolbar button that launches the REAL Studio Feedback app. Of course, I can't let the non-portable feedback.exe handle that - FeedbackPortable.exe, on the other hand, both can & should handle that.

On a side note, how can I set a Registry key's default value? REAL Studio gets the path to the Feedback app from HKEY_CLASSES_ROOT\feedback\shell\open\command\(Default value); I've tried about a dozen ways of putting the right path in, but none of them has worked; I always end up with a value named "command" under the Open key.

"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: 8 years 9 months ago
Joined: 2007-04-15 21:08
computerfreakerOn a side

computerfreakerOn a side note, how can I set a Registry key's default value? REAL Studio gets the path to the Feedback app from HKEY_CLASSES_ROOT\feedback\shell\open\command\(Default value)

It what!? (I'm almost tempted to set my post to Full HTML and make the text four times as big as it would otherwise be). That is a stupid, stupid, stupid way for them to do it...

That is most certainly a stupid place to get such a value.

The default value should be able to be set by just having a trailing slash... now I think about it though, I think ${GetParent} manages to "cope" with trailing slashes... in which case I need to put in a check for the last character. (Again, it's one of these things which I haven't tested :-()

[Post to be continued, off to a lecture 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

computerfreaker
computerfreaker's picture
Offline
Last seen: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
Chris MorganIt what!? (I'm

Chris MorganIt what!? (I'm almost tempted to set my post to Full HTML and make the text four times as big as it would otherwise be). That is a stupid, stupid, stupid way for them to do it...

Sure, they could have picked a better place, but this does make partial sense. The REAL Studio feedback app registers itself to open feedback:// links; if that key's not there, Feedback isn't registered to open feedback:// links and it's reasonably safe to say Feedback isn't installed. Of course, if another app decides to register itself for feedback:// links...

Chris MorganThe default value should be able to be set by just having a trailing slash... now I think about it though, I think ${GetParent} manages to "cope" with trailing slashes... in which case I need to put in a check for the last character. (Again, it's one of these things which I haven't tested :()

Nope, I tried a trailing slash with the same results as without one. I'll see about patching PAL to cover that.

Chris Morgan[Post to be continued, off to a lecture now]

OK, np.

"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."

computerfreaker
computerfreaker's picture
Offline
Last seen: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
[RegistryValueWrite] leaves stuff behind

I just found out - the hard way - that [RegistryValueWrite] leaves all the stuff it writes behind. There's not even a PostPrimary segment for RegistryValueWrite.

I created a quick-and-dirty (emphasis on dirty) patch; it's about as ugly as it gets, but it seems to mostly work.

http://pastebin.com/TzRLEP1x

http://pastebin.com/QLYmGkbb

It leaves one entry under the root, though; for example, when taking out HKEY_CLASSES_ROOT\feedback\shell\open\command, HKEY_CLASSES_ROOT\feedback gets left. I haven't been able to figure out why it's getting left or how to stop it; hopefully someone else will. (I strongly suspect a bug in the Registry plugin, but idk how to prove that)

Anyway, here's how the patch works/what I was thinking while I wrote it.
Just deleting the entries in the INI won't work - some of those entries create others (for example, setting HKEY_CLASSES_ROOT\feedback\shell\open\command creates HKEY_CLASSES_ROOT\feedback, HKEY_CLASSES_ROOT\feedback\shell, and HKEY_CLASSES_ROOT\feedback\shell\open before getting to the key in the INI), and it can get even hairier than that. IMHO, the best way of handling this is to delete the key passed in the INI, then move back up the tree, calling DeleteKeyEmpty at every step along the way. That should (in theory, anyway) just clip off the entries from the INI.

"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: 8 years 9 months ago
Joined: 2007-04-15 21:08
By design

This is by design. It is intended to be used in conjunction with a [RegistryKeys], [RegistryValueBackupDelete] or [RegistryCleanupForce] value. Now I realise that I haven't noted this in the documentation; I'll do that at some point.

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: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
Oh, that makes much more

Oh, that makes much more sense. Thanks for the explanation!
I'm using [RegistryValueBackupDelete] with [RegistryValueWrite] for HKEY_CLASSES_ROOT\feedback now, but that's not working correctly either - when HKEY_CLASSES_ROOT\feedback doesn't exist, it's apparently backed up anyway. "Restoring", or deleting it, never takes place, so HKCR\feedback gets left behind.

EDIT: ok, it looks like [RegistryValueBackupDelete] entirely ignores Registry keys and only backs up Registry values. I'd like to request that as a new feature, since having to use [RegistryKeys] with a bunch of temp values is pretty darn ugly.

Unfortunately, [RegistryKeys] doesn't clean up properly either - HKCR\feedback is still being left behind, probably because the Registry keys don't exist before running the launcher.

"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: 8 years 9 months ago
Joined: 2007-04-15 21:08
RegistryKeys should work

RegistryKeys should be working perfectly; I can't work out why it would not work (and I just took another look at the code). Could you try turning on debugging and see what it says? (!define DEBUG_SEGMENT_RegistryKeys in PortableApps.comLauncherDebug.nsh next to PortableApps.comLauncher.nsi).

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: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
Gotta love debug

You're right, RegistryKeys is working perfectly - the deletion line is apparently called, since I got the message "deleting HKEY_CLASSES_ROOT\feedback". The appropriate .reg file is created, too, and its contents are correct.
However, that troublesome key and all its subkeys are still there, and I have no idea what to make of this. RegEdit can delete the key with no trouble, so what's going on with NSIS?

UPDATE: the weirdness deepens. I put in another ${DebugMsg} call, this time to show the value of the return register ($R9); the normal value appears to be 0, but the HKCR\feedback deletion returns -1.
Also, the permissions look good for REALStudioPortable.exe - they appear to be identical to RegEdit's. Let's try something else: handling HKCR\feedback first instead of last.

UPDATE 2: nope, putting HKCR\feedback first made no difference (I had hoped something was getting fried by an earlier Registry call, but apparently not). I'll see what I can get from Process Monitor.

UPDATE 3: absolutely insane. According to Process Monitor, there wasn't even an attempt to delete HKCR\feedback or any of its subkeys. I know ProcMon is working just fine, though, because it caught all kinds of events - including the attempted deletion of another HKCR key. Looks like something's seriously borked in the Registry plugin.

UPDATE 4: is HKCR magical, or what? PAL's attempt at moving HKCR\feedback to HKCU\Software\PortableApps.com\Values\HKCR\feedback turns into a copy, as apparently HKCR\feedback can't be deleted. The .reg file PAL loads doesn't replace HKCR\feedback, either. Something is seriously screwed up, and I have no ideas at this point.

UPDATE 5: the problem isn't specific to HKCR\feedback. I had PAL create a dummy entry, HKCR\testing123, with one value and no subkeys; PAL created it properly, but couldn't seem to delete it for some reason. This is getting really weird - HKCU keys work, HKLM keys work, why not HKCR?
I'm thinking there's a bug in the Registry plugin, but I can't prove 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
Online
Last seen: 23 min 21 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Don't Use HKCR!

The simple answer is: you're doing it wrong. HKCR is a *VIRTUAL* hive in the registry. See wikipedia for details. You should be working with either HKCU\Software\Classes or HKLM\Software\Classes, NOT with HKCR.

Chris: Let's error on HKCR write and adjustment attempts at the launcher level so no one else can make this mistake.

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

computerfreaker
computerfreaker's picture
Offline
Last seen: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
Can't help it

REAL Studio needs a HKCR value to check for the presence of its feedback app - I don't have a choice on this.
I'll see if I can get something into HKCR without actually writing there, but I'm not particularly optimistic.

UPDATE: well, this is partly working. I'm writing to HKCU\Software\Classes\feedback now, and the HKCR key is properly created, but once again the stupid thing isn't deleted properly. The HKCU key goes away, but its HKCR copy won't.

UPDATE 2: Not sure what just happened - all I did was delete the existing settings files for REAL Studio Portable - but it's completely working now. Thanks, John!

"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: 8 years 9 months ago
Joined: 2007-04-15 21:08
Done

Now in hg. I've decided to have HKLM/HKCU the preferred format rather than HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER.

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 2 months ago
Joined: 2006-01-15 16:14
Comments

Just checked out the the latest PAL from Mercurial and I like the changes for the most part, except for the new structure for the launchers. Having AppNamePortable.ini for the launcher settings seems to be a step backwards, as that's how CPAL did it. Also, I'm pretty sure the PAF spec specifically calls for launcher.ini directly under AppData, or am I mistaken?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Not in PAF spec

The PortableApps.com Launcher files are not yet in the PortableApps.com Format specification.

I myself find it hard to decide what's best. Very few applications will require more than one launcher executable, but some may. One possibility was launcher.ini and launcher-*.ini to override it (or possibly even launcher.ini and launcher\*.ini), another was going back to Launcher\*.ini. For the moment at least that's the way we've gone. I imagine we're willing to think more about it... at least until it's Beta. Such changes are part of the reason why this isn't to Beta yet; Beta should be fairly stable.

And just because CPAL did something which got changed in PAL doesn't mean that the old is automatically bad Blum

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 2 months ago
Joined: 2006-01-15 16:14
...

The PortableApps.com Launcher files are not yet in the PortableApps.com Format specification.

From the PAF 1.0 spec: "[AppInfo] may also contain the launcher.ini configuration file used for the PortableApps.com Launcher."

In any case, now that I've had time to reflect, I think my main beef with it is the subfolder being called just "Launcher". Like you, I'm a perfectionist, and I think naming it "LauncherData" or something similar and moving it up to App\, like in CPAL, would make its intent clearer. I don't like to read any more documentation than I have to, so I tend to prefer a system that's as self-documenting as possible.

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

John put that in without me knowing about it, then. (And no version number increment or note in the release notes? :-()

I think AppInfo\Launcher is pretty clear - info about the app launcher. AppInfo contains the details of what the Platform should do to run the application (appinfo.ini, [Control] section), so it's quite reasonable that it should contain the intricate details of what the launcher does too.

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 2 months ago
Joined: 2006-01-15 16:14
How about a compromise?

Since I technically still prefer launcher.ini, here's a compromise: You search for the Launcher subfolder by default, but if it doesn't exist, fall back on launcher.ini. There, best of both worlds! Smile

Edit: Nah, nevermind--I can live with the new scheme. Probably for the best not to add a bunch of cruft to the code, anyway. NSIS is confusing enough as it is. Blum

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

I had it doing launcher-*.ini and falling back to launcher.ini before.

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: 12 years 6 months ago
Developer
Joined: 2009-08-11 11:24
Having AppNamePortable.ini

Having AppNamePortable.ini for the launcher settings is a big step forward, IMHO, since it allows you to use multiple launchers.
Also, I'm pretty sure parts of the PAF specs are being redesigned to match PAL; idk for sure, though.

"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."

Simeon
Simeon's picture
Offline
Last seen: 9 years 5 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Disable Splash etc

Is there support for ini files like the other launchers have where you can add custom command line arguments, disable the ini file etc?

I couldn't find any documentation on that.

"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: 8 years 9 months ago
Joined: 2007-04-15 21:08
Partial

DisableSplashScreen and AdditionalParameters are supported; support for custom values with a default is coming (it will be of somewhat limited use though, I'll 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

Mark Sikkema
Offline
Last seen: 12 years 6 months ago
Developer
Joined: 2009-07-20 14:55
Hi Chris

I'm not exactly sure what your problem is with:

got to sort out the null byte issue with dependencies.

But to make a null byte in an NSIS string, it is possible to use:

$\0

But as you know, it's a hard one to manage with NSIS.
I'm willing to help, but don't have a clue in what context you need to use it ???

Formerly Gringoloco
Windows XP Pro sp3 x32

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Dependencies list: null separated, double null terminated string

That's why I need it. I've been told it should be able to be done with buffers in the System plug-in etc. but I have yet to investigate it. Now I've got my Windows VM set up I can actually try it out, which is good.

Haven't heard of $\0.

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: 12 years 6 months ago
Developer
Joined: 2009-07-20 14:55
Sorry, $\0 is not working !

I was confused with C !

But 'How to Read REG_MULTI_SZ Values', in the NSIS usermanual (appendix D.5) is dealing with reading NULL separated, double NULL terminated strings.

I got some experience with the writing of these strings as well. Since I wrote a code to do this, for Unicode NSIS Portable (I think, DT2).

Do you have to WRITE or READ the string???

[edit: just hold on, I'm making a script what probably suits your needs]

Formerly Gringoloco
Windows XP Pro sp3 x32

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

I didn't expect anything like that to work; I've tried everything I can think of in the actual code, nothing works, the null byte vanishes every time.

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: 12 years 6 months ago
Developer
Joined: 2009-07-20 14:55
Have a look if this can help a bit

http://pastebin.com/60WzdMtv

The macros make use of 'handles' and delimiters in your string (I used '$\n' for this example)!
macro WriteNullString: just replaces '$\n' with a null, and places a double null on the end.
macro ReadNullString : reads every string separate, and places '$\n' in between.

It's done fast, and it's not up for Unicode NSIS, jet.

But first I have to make sure this is what you mean.

Formerly Gringoloco
Windows XP Pro sp3 x32

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

That looks as though it's the sort of thing I was going to try to work out. I hope this is under the zlib license so we can use it most easily?

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: 12 years 6 months ago
Developer
Joined: 2009-07-20 14:55
This was just an example.

ReadNullString : just copied over from the NSIS usersmanual (zlib license)
WriteNullString : a piece of code I just wrote yesterday

There could be a few (slightly) different approaches to handling the null byte,
It would be helpful if I know the code your actually trying to use this in. So I could make it as sufficient(=faster) as possible.

Ps.: The whole trick is using the handles instead of variables containing the string, so the null byte does not vanishes every time.
The actual writing of the NULL : System::Call "*$2(&i1 0)"
where :
$2 = the location
&i1 = amount of bytes to write. i=integer
0 = the actual value to write, so this could be your delimiter as well.
The location is calculated by : HANDLE + StrLen = $2
So in theory we could make a much faster script for handling this.

Other approaches could be:

  1. to write each string one by one so a null byte gets added automatically, then move the location up one position before to write the next string to the handle.
    Using: System::Call "*$2(&t$3 r4)"
    &t$3 = amount of chars to write. t=text/TCHAR
    r4 = $4, the actual string to write
    Then finish by writing the terminating null
  2. or, probably it would be possible and potentially much easier and faster, to write the string as a REG_MULTI_SZ value using the registry plugin, then to get a handle to it by reading this value using the system plugin.
    System::Call "${RegQueryValueEx}....."
    This solution could rule out any Unicode NSIS issues.

Formerly Gringoloco
Windows XP Pro sp3 x32

Pages

Topic locked