You are here

Move Directory on Registry on Launcher

4 posts / 0 new
Last post
juniorfga
Offline
Last seen: 9 years 8 months ago
Joined: 2007-01-01 21:41
Move Directory on Registry on Launcher

Hi
I´ve been working on a portable app, but i´m stuck on moving a directory from a registry key, that contains double back slash in the string, this is the launcher i've created:

[Launch]
ProgramExecutable=ThumbsPlus\Bin\thumbs8.exe
DirectoryMoveOK=yes

[Activate]
Registry=true

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\settings\ThumbsPlus.reg
Find=="%PAL:LastDrive%%PAL:LastPackagePartialDir%\\
Replace=="%PAL:AppDir%\\

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\ThumbsPlus\Thumbs8.ini
Find==%PAL:LastDrive%%PAL:LastPackagePartialDir%\Data\
Replace==%PAL:DataDir%\

[FileWrite3]
Type=Replace
File=%PAL:DataDir%\ThumbsPlus\Thumbs8.ini
Find==%PAL:LastDrive%%PAL:LastPackagePartialDir%\App\ThumbsPlus\
Replace==%PAL:AppDir%\ThumbsPlus\

[DirectoriesMove]
ThumbsPlus=%APPDATA%\ThumbsPlus

[RegistryKeys]
ThumbsPlus1=HKEY_CURRENT_USER\SOFTWARE\Cerious Software Inc.
ThumbsPlus=HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ThumbsPlus SQLite3 ODBC Driver

the problem is that the filewrite1 never works, the reg file is:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ThumbsPlus SQLite3 ODBC Driver]
"UsageCount"=dword:00000001
"Driver"="C:\\Datos\\new\\thumbsplus\\App\\ThumbsPlus\\Odbc\\sqlite3odbc.dll"
"Setup"="C:\\Datos\\new\\thumbsplus\\App\\ThumbsPlus\\Odbc\\sqlite3odbc.dll"

I need to replace the string "C:\\Datos\\new\\thumbsplus\\" for something like "%PAL:LastDrive%%PAL:LastPackagePartialDir%\\" or "%PAL:LastDrive:DoubleBackslash%%PAL:LastPackagePartialDir:DoubleBackslash%\\"

could you please help me on solving this?

thanks in advance

[Code formatted and whatnot - mod Chris]

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Try this

EDIT: Is the HTML or there's a space between C:\\Datos\\new\\thumbsplus and \\App\\...?

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\settings\ThumbsPlus.reg
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%
Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%

Also, your [FileWrite]s need some fixing. I don't know what would be the best way to do what you're trying, but Chris should be able to help you.

@ChrisMorgan: what's the current equivalent to %PAL:LastDataDir% (considering Live mode)?

Previously known as kAlug.

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

There is no equivalent at present; I intend to add a mechanism to deal with in 2.2 (I'd forgotten to add it to my TODO list - thanks for reminding me). For the moment, replacing on drive and partial directory (and generally doing them separately will be better, as the drive will often appear without being followed by the package path) is the way to do 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

juniorfga
Offline
Last seen: 9 years 8 months ago
Joined: 2007-01-01 21:41
Please feel free to suggest

Please feel free to suggest anything you consider that I can improve on the launcher.
thanks for your reply, It could be nice if examples like this were added to the PAL Launcher manual.

Log in or register to post comments