Win7 x64, Win XP Pro 32, single MSI for both, driving me crazy :(
Hello,
I have made vlc-2.0.5.msi for Windows XP. It uses a simple VBS script that first uninstalls first the vlc-2.0.1 that comes with our Windows XP Pro PC's (installed via .exe) then install 2.0.5.msi. Everything works fine.
The VBS script is :
Set objFSO32 = CreateObject("Scripting.FileSystemObject" )
If objFSO32.FileExists ("C:\Progra~1\videolan\vlc\uninst~1.exe") Then
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\Progra~1\videolan\vlc\uninst~1.exe /S"
End If
I go to "MSI Script", I choose "All Custom Actions", I do "Call VBSScript From Embedded Code". Then I double-click, I go to the "Location" tab, uncheck "No Sequence", choose "Normal Execute Immediate/Deferred", click on the button "Add", and put the action under "LaunchConditions".
Works right out of the box for... Windows XP Pro 32Bits only...
This MSI is for Windows Server Deployment. The problem is that wa now have Win7 64Bits PCs...
So I changed my VBS script for this one :
Set objFSO = CreateObject("Scripting.FileSystemObject" )
If objFSO.FileExists ("C:\Progra~1\videolan\vlc\uninst~1.exe") Then
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\Progra~1\videolan\vlc\uninst~1.exe /S"
ElseIf objFSO.FileExists ("C:\Progra~2\videolan\vlc\uninst~1.exe") Then
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\Progra~2\videolan\vlc\uninst~1.exe /S"
Else
End If
This is for both Windows XP Pro 32Bits and Windows 7 Pro 64Bits. I ran this script by hand on both systems, works fine.
The problems start when I want to add it in Wise Package Studio 5...
Compile, run vlc-2.0.5.msi, then got a "Error 1720"...
Please help me, it's driving me crazy Q_Q
Thanks in advance,
3rik
Answers (2)
The below code should work
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists ("C:\Progra~1\videolan\vlc\uninst~1.exe") Then
WshShell.Run "C:\Progra~1\videolan\vlc\uninst~1.exe /S"
ElseIf objFSO.FileExists ("C:\Progra~2\videolan\vlc\uninst~1.exe") Then
WshShell.Run "C:\Progra~2\videolan\vlc\uninst~1.exe /S"
End If