You are here

Need help with PAL and HLSW

4 posts / 0 new
Last post
Gremlin
Offline
Last seen: 20 hours 35 min ago
Joined: 2010-07-02 04:48
Need help with PAL and HLSW

Hi all,

I am trying to make HLSW portable but have some troubles with it: the hlsw.exe creates registry entries by itself I cannot delete via the Portable Apps Launcher. That's with Windows XP SP3 and HLSW version 1.3.3.7b. My launcher.ini is as follows:

[Launch]
ProgramExecutable=HLSW\hlsw.exe
;CommandLineArguments='"-PATH:%PAL:AppDir%\HLSW\"' '"-INSTDIR:."' '"-DATADIR:..\..\Data\userfiles\appdata\HLSW"' '"-URL:%1"'
WorkingDirectory=%PAL:AppDir%\HLSW
SinglePortableAppInstance=true

[Activate]
Registry=true

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\registry\hlsw_portable.reg
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\

[RegistryKeys]
registry\hlsw_portable=HKCU\Software\HLSW

[RegistryValueWrite]
HKCU\Software\HLSW\Settings\LastServerList=REG_SZ:%APPDATA%\HLSW\serverlist.sl32

[RegistryCleanupForce]
1=HKCU\Software\HLSW
2=HKCU\Classes\.sl00
3=HKCU\Classes\.sl01
4=HKCU\Classes\.sl02
5=HKCU\Classes\.sl03
6=HKCU\Classes\.sl04
7=HKCU\Classes\.sl05
8=HKCU\Classes\.sl06
9=HKCU\Classes\.sl07
10=HKCU\Classes\.sl08
11=HKCU\Classes\.sl09
12=HKCU\Classes\.sl10
13=HKCU\Classes\.sl11
14=HKCU\Classes\.sl12
15=HKCU\Classes\.sl13
16=HKCU\Classes\.sl14
17=HKCU\Classes\.sl15
18=HKCU\Classes\.sl16
19=HKCU\Classes\.sl17
20=HKCU\Classes\.sl18
21=HKCU\Classes\.sl19
22=HKCU\Classes\.sl20
23=HKCU\Classes\.sl21
24=HKCU\Classes\.sl22
25=HKCU\Classes\.sl23
26=HKCU\Classes\.sl24
27=HKCU\Classes\.sl25
28=HKCU\Classes\.sl26
29=HKCU\Classes\.sl27
30=HKCU\Classes\.sl28
31=HKCU\Classes\.sl29
32=HKCU\Classes\.sl30
33=HKCU\Classes\.sl31
34=HKCU\Classes\.sl32
35=HKCU\Classes\.sslf
36=HKCU\Classes\hlsw
37=HKCU\Classes\HLSW Server List

[DirectoriesMove]
userfiles\appdata\HLSW=%APPDATA%\HLSW

[DirectoriesCleanupForce]
1=%APPDATA%\HLSW

In the RegistryCleanupForce sectionI can delete only the first entry but not the others starting with HKCU\classes. Originally they are saved in the HKEY_CLASSES_ROOT section of the registry but per the instructions in the PAL manual I changed that to HKCU\classes. But they do not get deleted by HLSWPortable.exe whne exiting HLSW.

Could someone point me in the right direction what I could have done wrong?

Also I have a question about the command line function which is not working for me. In the above launcher.ini you can see the commented out CommandLineArguments line and I am not sure if I got the Syntax right when using more than one command line argument with spaces in the paths.

Cheers
Gremlin

[What is HLSW?
HLSW is a software that facilitates online gamers the world-wide locating of game servers as well as game server owners or operators the maintenance and administration of their servers]

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

[RegistryCleanupForce] is something that should almost never be used; I think I may remove it some time. It has problems with portability in that it doesn't back up a local key of that name. What you want is those things in [RegistryKeys] with a key name of -. That's equivalent to "no filename". Also another two points: you shouldn't have [RegistryKeys] and [RegistryCleanupForce] on the same key, and you shouldn't have "registry\" in the [RegistryKeys] key - just include the base part of the filename.

It's possible that you're running as admin and it's applied those file type registrations to all users rather than just the current user; take a look in HKLM\Classes for those keys.

As for your CommandLineArguments, consider how INI strings are parsed. Here's a quote from a document in the manual in 2.1 in a document explaining INI in some detail:

INI files The value can be quoted; if its first and last characters are the same, as a single or double quote, ' or ". If this is the case, the quotes are removed. It is purely a character check, though, not a full quoted string validation, so something like Key='It's going to work' will work fine. If you escape the character as \' or anything like that, it will remain like that, and will be read as It\'s going to work. Regarding which type of quotation mark to use, the author prefers in such situation to use the quote style which is not used (or used less) in the string, so Key="It's going to work" (read as It's going to work) or Key='"quoted string"' (read as "quoted string"). This last point is most important for the PortableApps.com Launcher; for example, it is mentioned in [Launch]:CommandLineArguments, as quoting paths in that can be very important for making sure apps will work in paths with spaces.

See if that makes sense to you.

What it means is that what you've got will be read as "-PATH:%PAL:AppDir%\HLSW\"' '"-INSTDIR:.". I'll leave it to you to work out what you do want.

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

Gremlin
Offline
Last seen: 20 hours 35 min ago
Joined: 2010-07-02 04:48
Chris, thanks for the

Chris, thanks for the hints.

I am running my Windows XP as admin. You are right. The keys are also to be found in HKLM. Unfortunately putting -=HKLM\Classes\.sl00 etc. in the [RegistryKeys] section does not remove those keys after HLSW has been finished.

Also another two points: you shouldn't have [RegistryKeys] and [RegistryCleanupForce] on the same key, and you shouldn't have "registry\" in the [RegistryKeys] key - just include the base part of the filename.

I have my .reg files in Data/settings/registry/ to keep them away from other files. Just a personal preference. Normaly I would put them in Data/registry/ but the Launcher expects them to be in the Data/settings/ tree.

I have to mess a little bit more with the CommandLineArguments feature. It would be nice not to move the user files HLSW uses into C:\Documents and Settings\Application Data\HSLW\ but rather to use the command line argument to point HLSW to Data\settings\userfiles\appdata\HLSW\. That would save me one step when starting and exiting HLSW Portable.

Cheers

Gremlin

Kliklou
Offline
Last seen: 4 years 11 months ago
Joined: 2012-09-18 13:36
On GitHub

I found a DOS Batch script that makes HLSW portable and it works pretty well Smile
Try to contact the author to work with him!
It's on GitHub : [link to illegal software site removed by mod JTH]

Log in or register to post comments