[Launch]
ProgramExecutable=4KDownloader\4KDownloader.exe
WorkingDirectory=%PAL:AppDir%\4KDownloader
WaitForExe1=MediaPlayer.exe
SinglePortableAppInstance=true
DirectoryMoveOK=yes
SupportsUNC=yes

[Activate]
Registry=true

[RegistryValueWrite]

[RegistryKeys]
4KSoftware=HKCU\Software\4K Software

[RegistryCleanupForce]
1=HKCU\Software\Classes\.download
2=HKCU\Software\Classes\4KSoftware.4KDownloader.download
3=HKCU\Software\Classes\.playlist
4=HKCU\Software\Classes\4KSoftware.4KPlayer.playlist
5=HKCR\CLSID\{EA33290D-8BDB-4cfd-ADD1-66F82DE61275}
6=HKCR\Wow6432Node\CLSID\{EA33290D-8BDB-4cfd-ADD1-66F82DE61275}

[RegistryCleanupIfEmpty]
1=HKCU\Software\4K Software

[DirectoriesMove]
4KSoftware=%AppData%\4K Software

[DirectoriesCleanupIfEmpty]
1=%AppData%\4K Software

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

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\settings\4KSoftware.reg
Find=%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\
Replace=%PAL:PortableAppsBaseDir:DoubleBackslash%\\

[FileWrite3]
Type=Replace
File=%PAL:DataDir%\settings\4KSoftware.reg
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\