Changes
Vlc
,→Advanced method by SkyBeam
unattended-uninstall.cmd
<pre>
echo Removing VLC media plyer
if not "%ProgramFiles(x86)%" == "" set PROG_FILES=%ProgramFiles(x86)%
set INSTALLER_LOC=%~dp0
set UNINSTALLERVLANDIR=%PROG_FILES%\VideoLANset UNINSTALLER=%VLANDIR%\VLC\uninstall.exe
set OPTIONS=/S
if not exist "%PROG_FILES%\%UNINSTALLER%" goto endgood_endstart /wait "VLC uninstall" "%PROG_FILES%\%UNINSTALLER%" %OPTIONS%REM :: Unfortunately the uninstaller seems to fork a child process and the parentREM :: process exits immediately. So give it some time to uninstallREM Get sleep.exe from the Windows Resource Kit Tools
for /L %%C IN (1,1,30) DO (
if not exist "%PROG_FILES%\%UNINSTALLER%" goto endgood_end "%INSTALLER_LOC%sleepping -n 1 127.0.0.exe" 1
)
:bad_end
exit 1
:endgood_endif exist "%VLANDIR%" rmdir "%VLANDDIR%"exit 0
</pre>
As this script is called by unattended.cmd also when VLC is probably not installed it first checks if there is an uninstallation to be done. If not it just skipsthe uninstall, but still checks to see if the uninstaller totally cleaned up after itself.
As I wrote above the uninstaller forks a child process and exits immediately. So there is a need to wait for the uninstaller to complete. I am simply checking if the uninstaller still exists. If yes I wait for another second.
In order to prevent an endless-loop the uninstallation will stop after a maximum of 30 seconds.