[Launch]
ProgramExecutable=OperaGX\opera.exe
WorkingDirectory=%PAL:AppDir%\OperaGX
CommandLineArguments=--user-data-dir="%PAL:DataDir%\profile\data" --disable-features=PrintCompositorLPAC
WaitForEXE1=installer.exe
WaitForEXE2=opera_autoupdate.exe
WaitForEXE3=opera_crashreporter.exe
WaitForEXE4=wow_helper.exe
DirectoryMoveOK=yes
SupportsUNC=yes
MinOS=7

[Activate]
Registry=true
Java=find

;[DirectoriesCleanupForce]
;Handled in custom code
;1=%PAL:AppDir%\OperaGX\profile\data\Crash Reports

;[DirectoriesCleanupIfEmpty] 
;Handled in custom code
;1=%PAL:AppDir%\OperaGX\profile\data
;2=%PAL:AppDir%\OperaGX\profile

[Language]
Base=%PortableApps.comLanguageCode%
CheckIfExists=%PAL:AppDir%\OperaGX\%CustomCodeOperaVersion%\localization\%PAL:LanguageCustom%.pak
DefaultIfNotExists=en

[LanguageFile]
Type=ConfigRead
File=%PAL:DataDir%\profile\operaprefs.ini
Entry=Language Files Directory={Resources}locale/

[RegistryKeys]
-=HKCU\Software\Opera Software

[RegistryCleanupIfEmpty]
1=HKLM\SOFTWARE\MozillaPlugins
2=HKCU\SOFTWARE\MozillaPlugins

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\profile\data\Preferences
Find="%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%\\"
Replace="%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%\\"

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\profile\data\Preferences
Find="%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\"
Replace="%PAL:PortableAppsBaseDir:DoubleBackslash%\\"

[FileWrite3]
Type=Replace
File=%PAL:DataDir%\profile\data\Preferences
Find="%PAL:LastDrive%\\"
Replace="%PAL:Drive%\\"

[FileWrite4]
Type=Replace
File=%PAL:AppDir%\OperaGX\installation_status.json
Find=BASEOPERASUBFOLDER
Replace=%PAL:AppDir:DoubleBackslash%\\OperaGX

[FileWrite5]
Type=Replace
File=%PAL:AppDir%\OperaGX\installation_status.json
Find="%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%\\"
Replace="%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%\\"

[FileWrite6]
Type=Replace
File=%PAL:AppDir%\OperaGX\installation_status.json
Find="%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\"
Replace="%PAL:PortableAppsBaseDir:DoubleBackslash%\\"

[FileWrite7]
Type=Replace
File=%PAL:AppDir%\OperaGX\installation_status.json
Find="%PAL:LastDrive:DoubleBackslash%\\"
Replace="%PAL:Drive:DoubleBackslash%\\"
