Results 1 to 6 of 6

Thread: [InnoSetup] How To Proceed UnInstall Upon Question

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Question [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:
    1. [Code]
    2.   // Ask the user a Yes/No question
    3. begin
    4.   if MsgBox('Would you like to keep your Settings?', mbConfirmation, MB_YESNO) = IDNO then
    5.   begin
    6.         // Delete all files and directories
    7.         // but leave the directory itself
    8.         DelTree('{userappdata}\MySoft', True, True, True);
    9.  
    10.   end;
    11.  end.
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [InnoSetup] How To Proceed UnInstall Upon Question

    In the code section don't you need procedures??? Check with Kleinma, he should know.

  3. #3

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: [InnoSetup] How To Proceed UnInstall Upon Question

    In the code section don't you need procedures???
    I guess i do.. i dont kow.. thats why im asking...


    whos Kleinma ? user on forums..?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: [InnoSetup] How To Proceed UnInstall Upon Question

    Yes, He hangs out in the VB.Net forum... Send him a PM

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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?

  6. #6

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: [InnoSetup] How To Proceed UnInstall Upon Question

    OK.. thanx for that...

    I've already started doing my own .exe to uninstall stuff..
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width