Uninstalling a .exe installed package (vlc-2.0.1) before installing vlc-2.0.4.msi
I'm building my first msi. By default, on new installed computers, vlc 2.0.1 is installed. It has been done in the master with vlc-2.0.1 exe setup.
I have succesfully created vlc-2.0.4.msi, but the problem is that once installed I have both 2.0.1 and 2.0.4 in add/remove programs.
I'd like to find a solution : in the vlc-2.0.4.msi, uninstall 2.0.1 and then install 2.0.4, but I don't know how to proceed.
I thank you very much for your help.
A simple way to uninstall the installed application would be :
-make a Custom Action =>CA
-place it before the installation of the files in your msi
-in the CA read the uninstall registry of your previouslly installed application: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\xyz\UninstallString
where "xyz" is the Key of the application you want to uninstall
Then read the value of "UninstallString", and run that value (preferablly from system account) using silent switches (a lot of applications have silent switches something like "/s" might work, test it for yourself)
It might be possible to make a SystemSearch for the registry value, place the value in a property and then just make a CA that runs an exe on the machine ( cmd.exe ) and pass to it the property and silent switches as parameters of the exe...
But i think the first option would make life easyer, as yo have more control in VBscript ( for example)
1) Make a batch file and name it Install.bat
2) Now write these lines in that
echo Please be wait while VLC Media Player is installing …
if %PROCESSOR_ARCHITECTURE%==x86 (
“%Programfiles%\VideoLAN\VLC\uninstall.exe" /S /NCRC
) else (
“%Programfiles(x86)%\VideoLAN\VLC\uninstall.exe" /S /NCRC
ping -n 20 127.0.0.1 > NUL
msiexec /i "%~dp0YOUR MSI.msi" /qn
REM Return exit code to SCCM
exit /B %EXIT_CODE%
3) Now save the above file and Run as adminstrator.
Thats it, you are done