/build/static/layout/Breadcrumb_cap_w.png

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

 

 

 

 


0 Comments   [ + ] Show comments

Answers (2)

Posted by: jagadeish 11 years ago
Red Belt
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

 

Posted by: anonymous_9363 11 years ago
Red Belt
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.

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ