You are here

Write default data with environment substitutions?

2 posts / 0 new
Last post
DrDinosaur
Offline
Last seen: 4 years 9 months ago
Joined: 2020-02-17 06:20
Write default data with environment substitutions?

I need to write this XML file on first launch and every launch after:
https://pastebin.com/5U9fsaF1

This doesn't work first launch, as defaultdata doesn't use environment substitutions.

Whats the best way to do this? Just remove all the root URLs and home path then write in the launcher?
Im going to have to write with the launcher anyway to update paths at startup.

Thanks.

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 1 hour 33 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
Use the launcher.ini for your substitutions

What you need to do is set an identifiably unique string in the default data file(s), then create replace rules in your launcher.ini for each of those strings.

As an example this is what I did for LAN Messenger Portable...

In the default data:
StoragePath=DEFAULTFILESDIR

In the launcher.ini:
[FileWrite6]
Type=Replace
File=%PAL:DataDir%\Roaming\LAN Messenger.ini
Find=DEFAULTFILESDIR
Replace=%PAL:DataDir:DoubleBackslash%\\Received Files

Log in or register to post comments