[Launch]
ProgramExecutable=qBittorrent\qbittorrent.exe
DirectoryMoveOK=yes
SupportsUNC=yes
;CleanTemp=false is required for qBittorrent to handle launching second instances
CleanTemp=false
;MinOS=10

[Activate]
Registry=true

[RegistryKeys]
Classes_torrent=HKLM\SOFTWARE\Classes\.torrent
Classes_Magnet=HKLM\SOFTWARE\Classes\Magnet
Classes_qBittorrent=HKLM\SOFTWARE\Classes\qBittorrent
ESENT_qBittorrent=HKLM\SOFTWARE\Microsoft\ESENT\Process\qbittorrent
qBitTorrent=HKCU\Software\qBittorrent

[DirectoriesMove]
settings\LocalAppData_qBittorrent=%LOCALAPPDATA%\qBittorrent
settings\AppData_qBittorrent=%APPDATA%\qBittorrent

[FileWrite1]
Type=INI
File=%PAL:DataDir%\settings\AppData_qBittorrent\qBittorrent.ini
Section=Preferences
Key=Win32\NeverCheckFileAssocation
Value=true

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\settings\AppData_qBittorrent\qBittorrent.ini
Find=@PLACEHOLDER_PALDATADIR@
Replace=%PAL:DataDir:DoubleBackSlash%

[FileWrite3]
Type=Replace
File=%PAL:DataDir%\settings\AppData_qBittorrent\qBittorrent.ini
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackSlash%\\
Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackSlash%\\

[FileWrite4]
Type=Replace
File=%PAL:DataDir%\settings\AppData_qBittorrent\qBittorrent.ini
Find=%PAL:LastDrive%%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PortableAppsBaseDir:DoubleBackslash%\\

[FileWrite5]
Type=Replace
File=%PAL:DataDir%\settings\AppData_qBittorrent\qBittorrent.ini
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\



[FileWrite6]
Type=Replace
File=%PAL:DataDir%\settings\AppData_qBittorrent\qBittorrent-resume.ini
Find=\x%PAL:LastDriveHex%\0:\
Replace=\x%PAL:DriveHex%\0:\
