This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- vbScript to Uninstall a Prior app
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 04, 2012
05:00 PM
vbScript to Uninstall a Prior app
Have a vbScript that works quite well when it is not in IS, but when I put it in as a Custom Action the script never locates the open Window and closes it. Can someone help out with this as I am kind of a deadline.
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
Dim returnCode
returnCode = objShell.Run("cmd /K CD " + Chr(34) + "%USERPROFILE%\Start Menu\Programs\Startup" + Chr(34)+" & del " + Chr(34)+"RealSign.appref-ms" + Chr(34),0, false)
objShell.Run "rundll32.exe dfshim.dll,ShArpMaintain RealSign.application, Culture=neutral, PublicKeyToken=dd392756883a4781, processorArchitecture=x86"
Do Until Success = True
Success = objShell.AppActivate("RealSign M")
If Success = True Then
objShell.SendKeys "+{TAB}"
objShell.SendKeys "{ENTER}"
Else
Sleep 200
End If
Loop
Set objShell = Nothing
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
Dim returnCode
returnCode = objShell.Run("cmd /K CD " + Chr(34) + "%USERPROFILE%\Start Menu\Programs\Startup" + Chr(34)+" & del " + Chr(34)+"RealSign.appref-ms" + Chr(34),0, false)
objShell.Run "rundll32.exe dfshim.dll,ShArpMaintain RealSign.application, Culture=neutral, PublicKeyToken=dd392756883a4781, processorArchitecture=x86"
Do Until Success = True
Success = objShell.AppActivate("RealSign M")
If Success = True Then
objShell.SendKeys "+{TAB}"
objShell.SendKeys "{ENTER}"
Else
Sleep 200
End If
Loop
Set objShell = Nothing
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 04, 2012
07:14 PM
The code in this custom action is unfortunately outside the scope of our expertise. As some general suggestions, have you tried any type of debugging such as placing message boxes to see where this code is executing or adding logging to see if the methods being called are returning expected values, etc.? This may help track down any differences between the working and non-working scenarios.
On a side note, running VBScript from Windows Installer custom actions is well known for not behaving the same as running through cscript or wscript (Windows Installer does not use these hosts to run the script). In addition, things like antivirus utilities can block these types of custom actions from running at all. Situations such as these can make debugging and support somewhat more difficult. In general, we would recommend C/C++ MSI DLL custom actions or just regular EXE actions, as they would typically be much easier to work with even though more initial development effort may be required.
On a side note, running VBScript from Windows Installer custom actions is well known for not behaving the same as running through cscript or wscript (Windows Installer does not use these hosts to run the script). In addition, things like antivirus utilities can block these types of custom actions from running at all. Situations such as these can make debugging and support somewhat more difficult. In general, we would recommend C/C++ MSI DLL custom actions or just regular EXE actions, as they would typically be much easier to work with even though more initial development effort may be required.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 06, 2012
06:25 AM
the 1st thing i would do is to remove
On Error Resume Next
so you can get a proper error message. You'll find the error in the Windows Application Log
On Error Resume Next
so you can get a proper error message. You'll find the error in the Windows Application Log