PDA

Click to See Complete Forum and Search --> : [RESOLVED]|[Inno 5.2] Uninstall before Install


RingOfFire
Dec 28th, 2007, 03:34 AM
Hi,

I'm using Inno Setup (5.2) for updating my software. Setup detects previous installation files and replaces them correctly. If no installation is found setup quits.

However, now I need to modify my Inno Script which will proceed with upgrade as usual but should uninstall previous installation first. I think it will be done by adding "silentuninstall" somewhere in the script but I've never did this. Can someone help me with a sample? or an example link?

I think this should be done in CurStepChanged(ssInstall) but have no idea how to proceed...

Thank you!

RingOfFire
Dec 28th, 2007, 07:50 AM
Here is what I was able to find:

procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
Uninstall: String;
begin
if (CurStep = ssInstall) then begin
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProgram_is1', 'UninstallString', Uninstall) then begin
MsgBox('Warning: Old Version will be removed!', mbInformation, MB_OK);
Exec(RemoveQuotes(Uninstall), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
end;
end;
end;

If you have other suggestions, comments, please share.

Hack
Dec 28th, 2007, 12:40 PM
Did this solve the issue for you?

RobDog888
Dec 28th, 2007, 12:47 PM
If you have other suggestions, comments, please share.
One would deduce that more input is desired. :D

RingOfFire
Dec 28th, 2007, 04:54 PM
I hoped to see other proposals, but nothing yet.

And yes, thread will be marked as solved.

Thank you for reading...