[Launch]
ProgramExecutable=DiskDefrag\Integrator.exe
RunAsAdmin=compile-force
SinglePortableAppInstance=true
SingleAppInstance=true
WorkingDirectory=%PAL:AppDir%\DiskDefrag
CommandLineArguments=/portable
WaitForProgram=true
WaitForOtherInstances=true
WaitForExe1=cdefrag.exe
WaitForExe2=DiskDefrag.exe
WaitForExe3=ndefrg32.exe
WaitForExe4=TabCareCenter.exe
WaitForExe5=TabReports.exe
DirectoryMoveOK=yes
SupportsUNC=yes

[Activate]
Registry=true

[RegistryValueWrite]
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6F662E64-9925-4B71-BCE2-98ED7AD1CED7}_is1\UninstallString=REG_SZ:%PAL:AppDir%\DiskDefrag\SSDOptimizer.exe

[RegistryKeys]
DiskDefrag="HKLM\SOFTWARE\Auslogics\Disk Defrag Portable"
-="HKLM\SOFTWARE\Auslogics\Google Analytics Package"
-=HKLM\SOFTWARE\Classes\CLSID\{1A2ACDD6-1B14-E9F9-0D3D-6862567E5037}
-=HKLM\SOFTWARE\Auslogics
-=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6F662E64-9925-4B71-BCE2-98ED7AD1CED7}_is1

[RegistryCleanupForce]

[RegistryCleanupIfEmpty]
1=HKLM\SOFTWARE\Auslogics

[DirectoriesMove]
DiskDefrag="%ALLUSERSAPPDATA%\Auslogics\Disk Defrag Portable"

[DirectoriesCleanupIfEmpty]
1="%ALLUSERSAPPDATA%\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%\\
