[Launch]
ProgramExecutable=CherryTree\bin\cherrytree.exe
DirectoryMoveOK=yes
SupportsUNC=yes

[DirectoriesMove]
cherrytree=%LocalCTAppDir%

[FilesMove]
recently-used.xbel=%LOCALAPPDATA%

[Language]
Base=%PortableApps.comLocaleglibc%
CheckIfExists=%PAL:AppDir%\CherryTree\share\locale\%PAL:LanguageCustom%\LC_MESSAGES\*.*
DefaultIfNotExists=en
;language switching is done in Custom.nsh

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\cherrytree\config.cfg
Find=DEFAULTSAVEDIR
Replace=%PAL:DataDir%\

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\cherrytree\config.cfg
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir%\
Replace=%PAL:Drive%%PAL:PackagePartialDir%\

[FileWrite3]
Type=Replace
File=%PAL:DataDir%\cherrytree\config.cfg
Find=%PAL:LastPortableAppsBaseDir%\
Replace=%PAL:LastPortableAppsBaseDir%\

[FileWrite4]
Type=Replace
File=%PAL:DataDir%\cherrytree\config.cfg
Find=%PAL:LastDrive%\
Replace=%PAL:Drive%\

[FileWrite5]
Type=Replace
File=%PAL:DataDir%\recently-used.xbel
Find=file:///%PAL:LastDrive%%PAL:LastPackagePartialDir:ForwardSlash%/
Replace=file:///%PAL:Drive%%PAL:PackagePartialDir:ForwardSlash%/

[FileWrite6]
Type=Replace
File=%PAL:DataDir%\recently-used.xbel
Find=file:///%PAL:LastPortableAppsBaseDir:ForwardSlash%/
Replace=file:///%PAL:LastPortableAppsBaseDir:ForwardSlash%/

[FileWrite7]
Type=Replace
File=%PAL:DataDir%\recently-used.xbel
Find=file:///%PAL:LastDrive%/
Replace=file:///%PAL:Drive%/