Jump to content

Unattended VLC install script


Recommended Posts

Hi guys,

Can anyone help me out or point me in the right direction with the following bat script. What I would like it to do is check if VLC has been installed already, if it finds it uninstall it and install the new version. If it hasn't been installed already it should just install VLC.

This is what I have so far but it still thinks VNC is installed.

@echo off

echo Removing VLC media player

set VLANDIR=C:\Program Files\VideoLAN
set UNINSTALLER=%VLANDIR%\VLC\uninstall.exe
set OPTIONS=/S

if not exist "%UNINSTALLER%" goto good_end
start /wait "VLC uninstall" "%UNINSTALLER%" %OPTIONS%
REM Unfortunately the uninstaller seems to fork a child process and the parent
REM process exits immediately. So give it some time to uninstall

ping -n 5 127.0.0.1 > NUL

:good_end
ECHO Installing VLC...
vlc-0.9.4-win32.exe /S

Link to comment
Share on other sites


Have you taken a look at some of the examples in this topic!

Although not a direct answer they may help you out!

Thanks for the link but it looks like a pretty complex solution for what I want to achieve. For instance I do not care which version is installed. But I will try a few things tomorrow when I am at work and report back.

Cheers,

OffHand

Link to comment
Share on other sites

Have you taken a look at some of the examples in this topic!

Although not a direct answer they may help you out!

Managed to get it working with the following script:

@Echo off

REM This will check if there is a previous version of VLC and uninstall it if it finds it

if exist "%ProgramFiles%\VideoLAN\VLC\uninstall.exe" (
Echo Uninstalling previous VLC version... && ping -n 5 127.0.0.1>nul
start /wait "VLC Uninstall" "%ProgramFiles%\VideoLAN\VLC\uninstall.exe" /S)

REM I am removing the old VNC directory here.

ping -n 10 127.0.0.1>nul
ECHO Removing old VLC directory...
ping -n 2 127.0.0.1>nul
RMDIR "%ProgramFiles%\VideoLAN" /S /Q

REM And install the new version.

ECHO Installing VLC...
vlc-0.9.4-win32.exe /S

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...