/build/static/layout/Breadcrumb_cap_w.png

Excute Program From Files

Hi,

I'm trying to create a package for uninstallation of installed EXE. I wrote a vbscript to delete registries, files and folder. The script is working fine manually. when i tried the same with Custom Action ("Excute Program From Files"), its throughing an error of This action is only valid for products that are currently installed.

Sequence: After InstallFiles
In-Script Option: Defferred Excution - System Context
Processing: Synchronous, Ignore exit Code

Can any one help to solve this?

0 Comments   [ + ] Show comments

Answers (11)

Posted by: anonymous_9363 15 years ago
Red Belt
0
Are you sure it's the script which throws the error?

It seems overkill to create a script inside an MSI to do a job which the MSI itself can handle natively. You can use the RemoveFiles and RemoveRegistry tables to achieve what you want.
Posted by: honeydee.psv 15 years ago
Senior Yellow Belt
0
No Errors... But Script is also not working.

Anyother ideas to do the same?
Posted by: anonymous_9363 15 years ago
Red Belt
0
Er...yes...use the RemoveFiles and RemoveRegistry tables.
Posted by: pgiesbergen 15 years ago
Orange Belt
0
This action is only valid for products that are currently installed.

I can only guess what this cryptic message means...are you trying to uninstall something that is is not installed? Then you should add something to your script to check if it is installed, if not, do nothing...
Posted by: AngelD 15 years ago
Red Belt
0
Did you add the script as a file?
Please post the CustomAction table entry for this custom action.
Posted by: honeydee.psv 15 years ago
Senior Yellow Belt
0
This is the script i'm using. Can you tel me how can i include this with custom action. Is any thing mistake with the type of Custom Action or Sequence??

ON ERROR RESUME NEXT
'********************************************************************************************
'DELETING FOLDER UNDER WINDOWS FOLDER and QUEST SOFTWARE Folder UNDER PROGRAM FILES FOLDER
'********************************************************************************************
QuestToad="C:\Program Files\Quest Software"
LOGS="C:\Windows\Logs"
DelFolder(QuestToad)
DelFolder(LOGS)
Sub DelFolder(folder)
Dim objFso
Set objFso = CreateObject("Scripting.FileSystemObject")
objFso.DeleteFolder(folder)
set objFso = Nothing
End Sub
'**************************************************
'DELETING SHORTCUTS UNDER STARTMENU and DESKTOP
'**************************************************

'QuestToad="C:\Documents and Settings\All Users\Start Menu\Programs\Quest Software"
'DelFolder(QuestToad)
Sub DelFolder(folder)
Dim objFso
Set objFso = CreateObject("Scripting.FileSystemObject")
objFso.DeleteFolder(folder)
set objFso = Nothing
End Sub
Set objWshShell = WScript.CreateObject("WScript.Shell")
User_Profile = objWshShell.Environment("PROCESS")("UserProfile")
desktop_shortcut = User_Profile & "\Desktop\TOAD.lnk"
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile desktop_shortcut
'***********************
'DELETING REGISTRIES
'***********************

set oShell = CreateObject("WScript.Shell")
const REMOVE_REGISTRY0 = "HKEY_CURRENT_USER\Software\Quest Software\SQLab\Preferences\Tuning Lab\"
const REMOVE_REGISTRY1 = "HKEY_CURRENT_USER\Software\Quest Software\SQLab\Preferences\"
const REMOVE_REGISTRY2 = "HKEY_CURRENT_USER\Software\Quest Software\SQLab\"
const REMOVE_REGISTRY3 = "HKEY_CURRENT_USER\Software\Quest Software\"
const REMOVE_REGISTRY4 = "HKEY_LOCAL_MACHINE\Software\Quest Software\SQLab\"
Const REMOVE_REGISTRY5 = "HKEY_LOCAL_MACHINE\Software\Quest Software\TOAD\"
const REMOVE_REGISTRY6 = "HKEY_LOCAL_MACHINE\Software\Quest Software\Schema Manager\"
Const REMOVE_REGISTRY7 = "HKEY_LOCAL_MACHINE\Software\Quest Software\"
Const REMOVE_REGISTRY8 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\FmtPlus.exe\"
Const REMOVE_REGISTRY9 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\sqlab.exe\"
Const REMOVE_REGISTRY11 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Formatter Plus V1.3\"
Const REMOVE_REGISTRY12 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Quest Software TOAD Xpert Edition 7.4\"
Const REMOVE_REGISTRY13 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SQLab 4.6\"
oShell.RegDelete REMOVE_REGISTRY0
oShell.RegDelete REMOVE_REGISTRY1
oShell.RegDelete REMOVE_REGISTRY2
oShell.RegDelete REMOVE_REGISTRY3
oShell.RegDelete REMOVE_REGISTRY4
oShell.RegDelete REMOVE_REGISTRY5
oShell.RegDelete REMOVE_REGISTRY6
oShell.RegDelete REMOVE_REGISTRY7
oShell.RegDelete REMOVE_REGISTRY8
Posted by: honeydee.psv 15 years ago
Senior Yellow Belt
0
One of my friend gave me an idea to use Wise Script to cal vbscript..

I'm calling above vbscript in Wise Script. but Desktop Shortcut is not removing... else is working fine...Can you please help?
Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
you should probably just use the RemoveFile table for that, as I believe others have suggested. much easier.
Posted by: anonymous_9363 15 years ago
Red Belt
0
You really are making this MUCH harder than it needs to be. Use the tables as I suggested.

If you want to persist (and I have every reason to suspect you will, since any reasonably intelligent person would by now have take the advice [of people whose advice was sought], researched the tables mentioned and abandoned the tortuous route outlined)...

Set objWshShell = WScript.CreateObject("WScript.Shell") Apart from the dreadful construction, this is your problem, specifically the 'WScript' directive.

The Windows Installer engine has its own VBScript runtime and doesn't 'understand' the reference to the Windows Scripting Host (which is what defines the 'WScript' object). Change that line to 'Set objWshShell = CreateObject("WScript.Shell")' and any other references to WScript and it should work. Note that this refers ONLY to the directive, NOT object names (which is why my edited line still refers to "WScript.Shell")
Posted by: honeydee.psv 15 years ago
Senior Yellow Belt
0
Change that line to

Yes its working now. Thank you

Thank you all.
Posted by: Jamie B 15 years ago
Orange Senior Belt
0
You went ahead with an MSI custom action that calls a Wisescript that launches a vbscript ???

Crazy!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
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