does any one have an example or know of an app that uses this function in the launcher.ini for PA.c Launcher 2.0
i only ask cause i am having a hard time understanding the manual and an example of how it is used would allow me to see how it is used.
thanks in advanced.
Almost all of the new apps released in the last few months are using PAL and the majority of PAL apps will use [FileWriteN] sections, for drive letter replacement most commonly. What are you trying to do? [FileWriteN] can do several quite different things.
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
It's best to specify your problem and what you have tried so far. The variety of possible solutions might be more confusing as they differ in quite some way.
what i need to do is change some values in a config file so that they update every time the device is moved from one machine to the next. now i understand how the type, file, entry, value, replace, find work, but its the section header in the launcher.ini that i am confused about....specificly the N in [FileWriteN]
now i am not sure if i am replacing values in the config file or if just using ConfigWrite will work for the changes that need to be implemented. does ConfigWrite replace values that are already in a config file?
The N in the [FileWriteN] is changed as follows...[FileWrite1], [FileWrite2], etc. depending on the current number of [FileWriteN]. You could use either configwrite or replace depending on what needs to be written to the file. For example:
I have not used ConfigWrite alot, but I believe that is the method of doing so. Correct me if I am wrong
this wasn't explained in the PAL manual... knowing that i need a separate [FileWrite#] for each entry i intend to change in the config file makes sense.
you know, having a base example for the entire launcher.ini (like what openplatform posted) as part of the manual would be a MAJOR help in some situations.
Ok, that problem was not to be forseen,
But did you see this part of the manual? The first example (scribus) shows how FileWriteN (e.g. FileWrite1, FileWrite2 ...) works.
It's worth mentioning that that part of the manual ("apps using PAL") doesn't exist in the 2.0 documentation (as only one (or was it two?) apps had been released officially with it, being the first release), only the 2.1 Beta documentation.
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
Ok, wasn't aware of that since I only use the beta.
But I crosschecked and the example is there, too, just at another position (examples on the first page). Your manual was really good, then, though the 2.1 version even better.
I'll be killing that bit off at some point, actually. It's somewhat out of date and I think that the list of examples will tend to be more helpful.
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
in my launcher.ini i am using both FileMove and FileWrite. now my files are not being written to nether before nor after the filemove. any one know why?
here is an example of my launcher.ini...
[Don't use <pre><code>, just <pre> - mod Chris]
FileWrite happens before the files get moved, so PAL is trying to write to %PAL:AppDir%\app\config.cfg after that file has been moved to %PAL:DataDir%\settings. Try changing
File=%PAL:AppDir%\app\config.cfg
to
File=%PAL:DataDir%\settings\config.cfg
in your FileWrite sections and that should work.
[Corrected "after" to "before" - mod Chris]
"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."
i just realized that my config file needs to have double backslashes in the paths. since the information isnt in the online manual for PAL how do i use %VARIABLE:DoubleBackslash% in my launcher.ini?
Previously known as kAlug.
ok, i have some sort of problem or miscommunication on filewrite.
according to my previous posts i have everything correct, but when the launcher writes the file i end up with empty entries where i am suppose to have proper paths....for example:
ROMPath=""
instead of:
ROMPath="h:\\portableapps\\appnameportable\\data\\roms\\"
and yes i need to have the quotes on this line.
any one know what i am missing?
here is a sample of my code:
*EDIT*
NeverMind....figured it out for my self.
it seems that filewrite was writing:
ROMPathh:\\portableapps\\appnameportable\\data\\roms
to the file. it turns out that i need to add the = to the entry and to double quote my value to get it to write properly....
You need to understand the differences between the ConfigWrite and INI types. ConfigWrite purely does string matching and appending. This makes it suitable for anything. Say for example in Apache config files you get lines like "DocumentRoot X:\path" - that would be something like
Entry="DocumentRoot "
,Value=%PAL:Drive%\path
. If you have an INI file with sections and keys, which is more common than an INI-style file without headings. Check the [FileWriteN] Type INI.When you have matching quotes at the start and end of an INI string, they are interpreted specially (otherwise there would be no way to get leading or trailing whitespace). Be careful of this.
Value="..."
will not write quotes to the string. UseValue='"..."'
if you want to write quotes.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
In general I would recommend avoiding quotes which will be cut out by the INI parser; it can make it slightly confusing. Only include them when you need literal quotes - and then do it as Key='"Value"' (""Value"" would work just as well, but '""' is neater).
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
From what i am understanding from your previous posts it is my understanding that i can use single quotes (') to encapsulate my statement that needs double quotes around it instead of double quotes (") in my Value= statement. Correct?
i ask cause i think i had tried this before realizing that i needed to add my equals sign to my Entry= statement, but i honestly didnt think that using a single quotes would allow it to work.
I provide some information on it in the latest version of the manual - INI files; Keys.
After the equals sign, everything is just taken literally with whitespace trimmed and then a common start and end quote removed if they exist, so you can include other equals signs with no problems. So a ConfigWrite with
Entry=KeyName=
will work fine. (And it will be just the same asEntry="KeyName="
, but there is no benefit in having the quotes and standard INI convention does not include quotes unless made necessary by leading or trailing whitespace or common quotes.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