[Launch]
ProgramExecutable=Calibre\calibre.exe
WorkingDirectory=%PAL:AppDir%\Calibre
WaitForEXE1=ebook-viewer.exe
DirectoryMoveOK=yes
SupportsUNC=yes
MinOS=Vista

[Environment]
CALIBRE_CONFIG_DIRECTORY=%PAL:DataDir%\settings\config
PATH=%PATH%;%PAL:AppDir%\Calibre
CALIBRE_NO_DEFAULT_PROGRAMS=1

[Activate]
Registry=true

[RegistryKeys]
calibrePortable=HKCU\Software\KovidsBrain
-=HKCU\Software\calibre

[QtKeysCleanup]
1=Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterface:
2=Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterfaceV2:
3=Qt Factory Cache 4.8\com.trolltech.Qt.QImageIOHandlerFactoryInterface:
4=Qt Plugin Cache 4.8.false

[DirectoriesMove]
settings\fontconfig=%TEMP%
settings\calibre-cache=%LOCALAPPDATA%\calibre-cache
settings\calibre-ebook.com=%LOCALAPPDATA%\calibre-ebook.com

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\settings\config\dynamic.pickle.json
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:ForwardSlash%/
Replace=%PAL:Drive%%PAL:PackagePartialDir:ForwardSlash%/

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\settings\config\dynamic.pickle.json
Find=%PAL:LastPortableAppsBaseDir:ForwardSlash%/
Replace=%PAL:PortableAppsBaseDir:ForwardSlash%/

[FileWrite3]
Type=Replace
File=%PAL:DataDir%\settings\config\dynamic.pickle.json
Find=%PAL:LastDrive%/
Replace=%PAL:Drive%/

[FileWrite4]
Type=Replace
File=%PAL:DataDir%\settings\config\global.py.json
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%\\

[FileWrite5]
Type=Replace
File=%PAL:DataDir%\settings\config\global.py.json
Find=%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\
Replace=%PAL:PortableAppsBaseDir:DoubleBackslash%\\

[FileWrite6]
Type=Replace
File=%PAL:DataDir%\settings\config\global.py.json
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\

[FileWrite7]
Type=Replace
File=%PAL:DataDir%\settings\config\global.py.json
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:ForwardSlash%/
Replace=%PAL:Drive%%PAL:PackagePartialDir:ForwardSlash%/

[FileWrite8]
Type=Replace
File=%PAL:DataDir%\settings\config\global.py.json
Find=%PAL:LastPortableAppsBaseDir:ForwardSlash%/
Replace=%PAL:PortableAppsBaseDir:ForwardSlash%/

[FileWrite9]
Type=Replace
File=%PAL:DataDir%\settings\config\global.py.json
Find=%PAL:LastDrive%/
Replace=%PAL:Drive%/

[FileWrite10]
Type=Replace
File=%PAL:DataDir%\settings\config\global.py.json
Find=INITIALLIBRARYPATH
Replace=%PAL:DataDir:DoubleBackslash%\\library

[FileWrite11]
Type=Replace
File=%PAL:DataDir%\settings\config\gui.json
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:ForwardSlash%/
Replace=%PAL:Drive%%PAL:PackagePartialDir:ForwardSlash%/

[FileWrite12]
Type=Replace
File=%PAL:DataDir%\settings\config\gui.json
Find=%PAL:LastPortableAppsBaseDir:ForwardSlash%/
Replace=%PAL:PortableAppsBaseDir:ForwardSlash%/

[FileWrite13]
Type=Replace
File=%PAL:DataDir%\settings\config\gui.json
Find=%PAL:LastDrive%/
Replace=%PAL:Drive%/

[FileWrite14]
Type=Replace
File=%PAL:DataDir%\settings\config\history.plist
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:ForwardSlash%/
Replace=%PAL:Drive%%PAL:PackagePartialDir:ForwardSlash%/

[FileWrite15]
Type=Replace
File=%PAL:DataDir%\settings\config\history.plist
Find=%PAL:LastPortableAppsBaseDir:ForwardSlash%/
Replace=%PAL:PortableAppsBaseDir:ForwardSlash%/

[FileWrite16]
Type=Replace
File=%PAL:DataDir%\settings\config\history.plist
Find=%PAL:LastDrive%/
Replace=%PAL:Drive%/

[FileWrite17]
Type=Replace
File=%PAL:DataDir%\settings\config\viewer-webengine.json
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%\\

[FileWrite18]
Type=Replace
File=%PAL:DataDir%\settings\config\viewer-webengine.json
Find=%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\
Replace=%PAL:PortableAppsBaseDir:DoubleBackslash%\\

[FileWrite19]
Type=Replace
File=%PAL:DataDir%\settings\config\viewer-webengine.json
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\

;[FileWrite20]
;Type=ConfigWrite
;File=%PAL:DataDir%\settings\config\global.py.json
;Entry='  "language": "'
;Value=%PAL:LanguageCustom%'

;[Language]
;Base=%PortableApps.comLocaleglibc%

;[LanguageStrings]
;en_US=en

;[LanguageFile]
;Type=ConfigRead
;File=%PAL:DataDir%\settings\config\global.py.json
;Entry='  "language": "'
;TrimRight='",'
