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

 

 

 

 

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

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

 

Answered 02/03/2013 by: jagadeish
Red Belt

Please log in to comment
2

[shakes head] Leaving aside the fact that your script has only rudimentary error-trapping, you should ALWAYS avoid hard-coding paths like these in script.

Either get the path to 'Program Files' from the registry or use the 'ProgramFiles' environment variable.

Answered 02/04/2013 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity