PDA

View Full Version : Uninstall the program if it exists


chandu143
01-05-2009, 11:10 PM
Hi All,
In general if we create a build using set up factory ,after installing the program and again trying to install the program it will just overwrites all the files if we select the overwrite option.
My requirement is to uninstall the program first if exists and then install the program. I implemented the code in the on start up Actions script to detemine whether the program installed or not. But facing problem to run the uninstall exe using the File.Run but getting errors 1013.
Pls provide any solution to satisfy the requirement, as i am blocked to move further in my project.

Thanks in advance ....

chandu143
01-06-2009, 02:46 AM
Hi all,
I implemented the code for uninstalling the program if exists and then installing the program.But facing problem as both the process are running at a time. Need to run the installation process when and only when uninstallation process completed otherwise the application should exit. Waiting for your valuable comments.

Go through the below code to get the uninstall process.

result = File.DoesExist(SessionVar.Expand("%AppFolder%\\WindowsApplication5.exe"));
if(result == true) then
proceed = Dialog.Message("Notice", "Press yes to overwrite the existing file .", MB_YESNO, MB_ICONINFORMATION, MB_DEFBUTTON1);

if( proceed == IDYES) then

asde =SessionVar.Expand("%StartProgramsFolder%\\%AppShortcutFolderName%\\Un install %ProductName%");

res= Shell.Execute(asde, "open", "", "", SW_SHOWNORMAL);
else
Application.Exit(0);
end
end