; NVIDIA Display Driver uninstaller
call Uninstall

[UninstallSilent]
Set ForceNoReboot=yes
call UninstallSilentReboot

[UninstallSilentReboot]
Set Silent=yes
call Uninstall
Delreg {UninstRegkey}\NVIDIA Display Driver
del {current Script}
del {Current Parser Path}

[Uninstall]
call UninstallSedona

UninstallService NVSvc

DelBoot {sysdir}\nvmctray.dll
DelBoot {sysdir}\nvoglv32.dll
DelBoot {sysdir}\nvsvc.dll
DelBoot {sysdir}\nvmccs.dll
DelBoot {sysdir}\nvmccsrs.dll
DelBoot {sysdir}\nvcolor.exe
DelBoot {sysdir}\nvapps.xml
DelBoot {sysdir}\nvwsapps.xml
Delreg {UninstRegkey}\NVIDIA Display Driver
delreg HKLM\Software\Microsoft\Windows\CurrentVersion\Run\NvMediaCenter
delreg HKLM\Software\Microsoft\Windows\CurrentVersion\Run\NvCplDaemon
delreg HKLM\Software\Microsoft\Windows\CurrentVersion\Run\NvSvc
DelReg HKLM\Software\NVIDIA Corporation\NVAPI
DelReg HKLM\SYSTEM\CurrentControlSet\Services\nv\NVAPI
DelReg HKLM\SYSTEM\CurrentControlSet\Services\nvlddmkm\NVAPI


; Poll the registry to determine what the installed INF name has become
; then use that name with dpinst to do the uninstall.
getreg InfPath=HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000\InfPath
SysCallAndWait {sysdir}\dpinst.exe /u {windir}\inf\{InfPath} /s

[UninstallSedona]
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvcpl.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nview.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvshell.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvwdmcpl.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvmccss.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvdisps.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvgames.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvmobls.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvvitvs.dll
SysCallAndWait {sysdir}\regsvr32.exe /s /u {sysdir}\nvwss.dll

DelBoot {sysdir}\nvcpl.dll
DelBoot {sysdir}\nvdisps.dll
DelBoot {sysdir}\nvgames.dll
DelBoot {sysdir}\nvmccss.dll
DelBoot {sysdir}\nvmobls.dll
DelBoot {sysdir}\nvvitvs.dll
DelBoot {sysdir}\nvwss.dll

Set current file
DirAndApply {windir}\help\nvcpl\nvcpl*.cab,DelBoot {current file}
Set current file
DirAndApply {windir}\help\nvcpl\nvdsp*.chm,DelBoot {current file}
Set current file
DirAndApply {windir}\help\nvcpl\nv3d*.chm,DelBoot {current file}
Set current file
DirAndApply {windir}\help\nvcpl\nvmob*.chm,DelBoot {current file}
Set current file
DirAndApply {windir}\help\nvcpl\nvwks*.chm,DelBoot {current file}

Set ServersPresent=0
EnumRegNamesCmd HKLM\Software\NVIDIA Corporation\NVControlPanel\RegisteredServers, set ServersPresent=1
EnumRegNamesCmd HKLM\Software\NVIDIA Corporation\Global\NVControlPanel\RegisteredServers, set ServersPresent=1
if {ServersPresent}=0 then call UninstallSedonaClient

[UninstallSedonaClient]
DelBoot {sysdir}\nvcpl.exe
DelBoot {sysdir}\nvcplui.exe
DelBoot {sysdir}\nvcpl.cpl
DelBoot {sysdir}\nvcpluir.dll
DelBoot {sysdir}\nvexpbar.dll
DelBoot {sysdir}\nvdispsr.dll
DelBoot {sysdir}\nvgamesr.dll
DelBoot {sysdir}\nvmccssr.dll
DelBoot {sysdir}\nvmoblsr.dll
DelBoot {sysdir}\nvvitvsr.dll
DelBoot {sysdir}\nvwssr.dll

Set current file
DirAndApply {windir}\help\nvcpl\nvcpl*.chm,DelBoot {current file}
DelBoot {windir}\help\nvcpl
DelReg HKLM\Software\NVIDIA Corporation\NVControlPanel
DelRegE HKLM\Software\NVIDIA Corporation
DelReg HKCU\Software\NVIDIA Corporation\NVControlPanel
DelRegE HKCU\Software\NVIDIA Corporation

