[InnoSetup] How To Proceed UnInstall Upon Question
Hello,
Can someone help me create a messagebox that will ask the user a question.
If Yes then Delete files if No skip.
Currently i have the following: But the messagebox never shows up..
I think because i dont know how to call this from the UnInstallDelete section.
VB Code:
[Code]
// Ask the user a Yes/No question
begin
if MsgBox('Would you like to keep your Settings?', mbConfirmation, MB_YESNO) = IDNO then
begin
// Delete all files and directories
// but leave the directory itself
DelTree('{userappdata}\MySoft', True, True, True);
end;
end.
Re: [InnoSetup] How To Proceed UnInstall Upon Question
In the code section don't you need procedures??? Check with Kleinma, he should know.
Re: [InnoSetup] How To Proceed UnInstall Upon Question
Quote:
In the code section don't you need procedures???
I guess i do.. i dont kow.. thats why im asking... :D
whos Kleinma ? user on forums..?
Re: [InnoSetup] How To Proceed UnInstall Upon Question
Yes, He hangs out in the VB.Net forum... Send him a PM
Re: [InnoSetup] How To Proceed UnInstall Upon Question
INNO currently doesn't support calling code during uninstallation from the UninstallRun section. This section allows you to run certain files during uninstallation. Lets say maybe an exe that does something when you uninstall. I have heard they are planning to support calling code instead of launching a file in this section, but I have no idea when it may be implemented.
I noticed an article on INNO's newsgroup that may be of interest to you, but I am not sure how good you are with scripting in INNO
http://news.jrsoftware.org/news/inno.../msg11103.html
Read all the replies to that and the replies to the replies, because they made some adjustments to the originally posted code somewhere along the way.
The easier method (and the one I would recommend) is making an exe that you distribute with your app that is specifically for saving/deleting settings. You launch this exe in the [uninstallrun] section and it simply asks if they want to keep their settings, and if they say no, delete them right from that exe. Then the exe exits...
the uninstallrun section is run before any files are actually deleted as part of INNOs uninstallation, so you don't have to worry about your exe being deleted before it was run.
If you wanted to get a little fancier and not have to use a second exe to do this, you could build this functionality right into your main exe, but only trigger with with a commandline argument like /uninstall
when your exe is run with the /uninstall command, it simply prompts the messagebox and deletes settings if they indicate yes.
Does all that make sense?
Re: [InnoSetup] How To Proceed UnInstall Upon Question
OK.. thanx for that...
I've already started doing my own .exe to uninstall stuff.. :)