Changes

Vlc

144 bytes added, 08:45, 15 September 2008
no edit summary
<packages>
<package id='VLC' name='VLC media player' revision='8649200' priority='50' reboot='false' >
<!-- VLC media player -->
<check type='uninstall' condition='exists' path='VideoLAN VLC media player 0.89.6d2' /> <install cmd='"%SOFTWARE%\VLC v.0.89.6d2\unattended.cmd"' /> <remove cmd='"%SOFTWARE%\VLC v.0.89.6d2\unattended-uninstall.cmd"' /> <upgrade cmd='"%SOFTWARE%\VLC v.0.89.6d2\unattended.cmd"' />
</package>
 
</packages>
</source>
@echo off
set BINARY=vlc-0.89.6d2-win32.exe
echo Installing VLC media playerplyer
set INSTALLER_LOC=%~dp0
call "%INSTALLER_LOC%unattended-uninstall.cmd"
echo - Installing player
start /wait "VLC" "%INSTALLER_LOC%%BINARY%" /S /NCRC /D="%PROG_FILES%"
set EXIT_CODE=%ERRORLEVEL%
unattended-uninstall.cmd
<source lang="dos">
@echo Removing VLC media plyeroff
if not "%ProgramFiles(x86)%" == "" set PROG_FILESBINARY=%ProgramFiles(x86)%vlc-0.9.2-win32.exe echo Installing VLC media plyer
set INSTALLER_LOC=%~dp0
set VLANDIREXIT_CODE=%PROG_FILES%\VideoLAN0set UNINSTALLERPROG_FILES=%VLANDIRProgramFiles%\VLC\uninstall.exeif not "%ProgramFiles(x86)%" == "" set OPTIONSPROG_FILES=/S%ProgramFiles(x86)%
if not exist echo - Removing previous version "%UNINSTALLERINSTALLER_LOC%" goto good_endstart /wait "VLC unattended-uninstall.cmd" "%UNINSTALLER%" %OPTIONS%:: Unfortunately the uninstaller seems to fork a child process and the parent:: process exits immediately. So give it some time to uninstallfor /L %%C IN (1,1,30) DO ( if not exist call "%UNINSTALLERINSTALLER_LOC%" goto good_end ping unattended-n 1 127uninstall.0.0.1):bad_endexit 1cmd"
:good_endecho - Installing playerif exist start /wait "VLC" "%VLANDIRINSTALLER_LOC%%BINARY%" rmdir /S /NCRC /D="%VLANDIRPROG_FILES%"set EXIT_CODE=%ERRORLEVEL% call "%INSTALLER_LOC%cleanup.cmd" exit 0/B %EXIT_CODE%
</source>
In order to prevent an endless-loop the uninstallation will stop after a maximum of 30 seconds.
 
Finally here's my cleanup.cmd. script:
<source lang="dos">
@echo off
 
echo Removing unnecessary shortcuts
del /F /Q "%ALLUSERSPROFILE%\Desktop\VLC media player**"
del /F /Q "%PUBLIC%\Desktop\VLC media player**"
 
exit /B 0
</source>
This has been tested on Windows Vista x64.
[[category:Silent Installers]]
Anonymous user