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?
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)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
Posted by:
honeydee.psv
15 years ago
Posted by:
pgiesbergen
15 years ago
Posted by:
AngelD
15 years ago
Posted by:
honeydee.psv
15 years ago
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
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
Posted by:
aogilmor
15 years ago
Posted by:
anonymous_9363
15 years ago
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)...
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")
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
Posted by:
Jamie B
15 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.