PDA

View Full Version : i am unable to find the execute uninstaller action



james decosta
01-28-2008, 11:02 PM
hi,
say i am unable to find the execute uninstaller action
How can i execute the uninstaller.exe if i get some value in the $REG_COMPONENT_LOCATIONS$ using custom code actions.
that is say the code is as given below:

public MyCustom extends CustomCodeAction{

public void install(installerProxy ip) throws InstallException{

String regComponentLocation=ip.substitute("$REG_COMPONENT_LOCATIONS$");
String cmdToExecute=regComponentLocation+"\\Uninstall Sample.exe";
Process toBeExecuted=RunTime.getRuntime().exec(cmdToExecute);
}
Will it work like this?????????????????
And one more doubt??????????????????????????/
Say if there are multiple instances of my product installed on a machine so what the $REG_COMPONENT_LOCATION will contain????????
Will it contain all the locations separated by ":"
And if so can i use StringTokenizer and take the first token and using it execute the uninstall Sample.exe .
It would be a pleasure if someone can help me out in executing the uninstaller using custom code action.