[Launch]
ProgramExecutable="DiskDefrag\DiskDefrag.exe"
RunAsAdmin=force
SingleAppInstance=true
WaitForProgram=true
WaitForExe1=ActionCenter.exe
WaitForExe2=cdefrag.exe
WaitForExe3=ndefrg32.exe
WaitForEXE4=ndefrg64.exe
WaitForExe5=Integrator.exe
WaitForExe6=TabReports.exe
DirectoryMoveOK=yes
SupportsUNC=yes

[Activate]
Registry=true

[RegistryKeys]
DiskDefrag="HKLM\SOFTWARE\Auslogics\Disk Defrag\9.x"
-=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Auslogics\Disk Defrag
-=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Logon\{A9A677CB-BC6C-4176-9611-2773B7E2C25A}
-=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\{A9A677CB-BC6C-4176-9611-2773B7E2C25A}

[RegistryCleanupIfEmpty]
1=HKLM\SOFTWARE\Auslogics\Disk Defrag
2=HKLM\SOFTWARE\Auslogics
3=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Auslogics

[RegistryValueBackupDelete]
1=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\DefragPath\Default
2=HKLM\SOFTWARE\Auslogics\ClientID

[DirectoriesMove]
DiskDefrag=%ALLUSERSAPPDATA%\Auslogics\Disk Defrag
-=%SystemRoot%\System32\Tasks\Auslogics\Disk Defrag

[DirectoriesCleanupIfEmpty]
1=%ALLUSERSAPPDATA%\Auslogics
2=%WINDIR%\System32\Tasks\Auslogics\Disk Defrag
3=%WINDIR%\System32\Tasks\Auslogics

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

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

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