[Launch]
ProgramExecutable=PokerTH\pokerth.exe
DirectoryMoveOK=yes
SupportsUNC=yes

[Activate]
XML=true

[FilesMove]
settings\pokerth\config.xml=%APPDATA%\pokerth

[DirectoriesCleanupIfEmpty]
1=%APPDATA%\pokerth\cache
2=%APPDATA%\pokerth\data
3=%APPDATA%\pokerth\log-files
4=%APPDATA%\pokerth

[FileWrite1]
Type=XML attribute
File=%PAL:DataDir%\settings\pokerth\config.xml
XPath=/PokerTH/Configuration/Language
Attribute=value
Value=%PAL:LanguageCustom%

[FileWrite2]
Type=XML attribute
File=%PAL:DataDir%\settings\pokerth\config.xml
XPath=/PokerTH/Configuration/AppDataDir
Attribute=value
Value=%PAL:AppDir%\PokerTH\data\

[FileWrite3]
Type=XML attribute
File=%PAL:DataDir%\settings\pokerth\config.xml
XPath=/PokerTH/Configuration/UserDataDir
Attribute=value
Value=%PAL:DataDir%\settings\pokerth\data\

[FileWrite4]
Type=XML attribute
File=%PAL:DataDir%\settings\pokerth\config.xml
XPath=/PokerTH/Configuration/LogDir
Attribute=value
Value=%PAL:DataDir%\settings\pokerth\log-files\

[FileWrite5]
Type=XML attribute
File=%PAL:DataDir%\settings\pokerth\config.xml
XPath=/PokerTH/Configuration/CacheDir
Attribute=value
Value=%PAL:DataDir%\settings\pokerth\cache\

[FileWrite6]
Type=Replace
File=%PAL:DataDir%\settings\pokerth\config.xml
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir%\
Replace=%PAL:Drive%%PAL:PackagePartialDir%\

[FileWrite7]
Type=Replace
File=%PAL:DataDir%\settings\pokerth\config.xml
Find=%PAL:LastPortableAppsBaseDir%\
Replace=%PAL:PortableAppsBaseDir%\

[FileWrite8]
Type=Replace
File=%PAL:DataDir%\settings\pokerth\config.xml
Find=%PAL:LastDrive%\
Replace=%PAL:Drive%\

[Language]
Base=%PortableApps.comLanguageCode%
Default=en
CheckIfExists=%PAL:AppDir%\PokerTH\data\translations\pokertn_%PAL:LanguageCustom%.qm

[LanguageStrings]
pt-br=ptbr
pt=ptpt
zh-cn=zhcn
cs=cz

[LanguageFile]
Type=XML attribute
File=%PAL:DataDir%\settings\pokerth\config.xml
XPath=/PokerTH/Configuration/Language
Attribute=value