[Inno Setup] procedure BeforeInstall(); Not Working-VBForums
Results 1 to 14 of 14

Thread: [Inno Setup] procedure BeforeInstall(); Not Working

  1. #1

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

    Question [Inno Setup] procedure BeforeInstall(); Not Working

    Hello,

    Another Inno problems of mine...

    in my code section i have the following
    VB Code:
    1. :
    2.  
    3. [COLOR=Navy][Code]
    4. [COLOR=DarkOrange]procedure BeforeInstall[/COLOR]();
    5. begin
    6.     if FileExists('{userappdata}\MyApp\Settings.ini') then
    7.  
    8.  if MsgBox('Your Settings seem to be Installed. Would you like to keep them?', mbConfirmation, MB_YESNO or MB_DEFBUTTON1) = IDNO then
    9.         begin
    10.           // Delete the directory and everything inside it
    11.           DelTree('{userappdata}\MyApp', True, True, True);
    12.         end;
    13. end;[/COLOR]


    And then i call the procedure like so..
    VB Code:
    1. [COLOR=Navy]
    2.  
    3. [INI]
    4. Filename: {userappdata}\MyApp\Settings.ini; Section: Info; Key: Information; String: myapp; [/COLOR] [COLOR=DarkOrange]BeforeInstall: BeforeInstal[/COLOR]

    Basically the problem is, when i install the application I dont see any MessageBox.

    How can i get it to show..
    _____________________________________________________________________

    ----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: [Inno Setup] procedure BeforeInstall(); Not Working

    To check it remove your if statements to see if you are getting there and just not finding what you think should be true.

    Verify first....

  3. #3

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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    Removed the If FileExists.. part. and i DO get a msgbox, but eventhough i Say NO, it doesnt seem to be deleteing the direcotry...
    _____________________________________________________________________

    ----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: [Inno Setup] procedure BeforeInstall(); Not Working

    post what you have now

  5. #5

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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    post what you have now

    VB Code:
    1. [COLOR=DarkSlateBlue][Code]
    2. procedure BeforeInstall();
    3. begin
    4.  
    5.  if MsgBox('Your Settings seem to be Installed. Would you like to keep them?', mbConfirmation, MB_YESNO or MB_DEFBUTTON1) = IDNO then
    6.         begin
    7.           // Delete the directory and everything inside it
    8.           DelTree('{userappdata}\MyApp\*', True, True, True);
    9.         end;
    10. end;[/COLOR]
    _____________________________________________________________________

    ----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.



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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    Did you verify that it does indeed fall thru to the DelTree line?

  7. #7

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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    How do i verify it..?

    Is there any step through code in Inno?? Like Vb has? things like debug.print
    _____________________________________________________________________

    ----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.



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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    Put a messagebox just before the line that is supposed to delete to see if you are actually getting there.

    Verify that you are getting there before assuming that the instruction doesn't work. One thing at a time...

  9. #9

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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    OK i put another messagebox just beft the DelTree function and I do get it...

    so it seems like the DelTree function isnt doing what its supposed to do...
    _____________________________________________________________________

    ----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.



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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    Ok, try this

    DelTree('{userappdata}\MyApp\', True, True, True);

  11. #11

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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    Nope..

    Same result..

    I thikn im gona have to manully do an .Exe in vb to do the things i need Inno to do in its Code section...

    I already have like 2 other separate .exe cos Inno wouldnt do things i need!!
    _____________________________________________________________________

    ----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.



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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    It is possibly that parameters don't get replaced in the code section.

    Check with Klienma to be sure. Send him a PM. He hangs out in the .Net Forum.

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

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    You may need to pass the '{userappdata}\MyApp\' as a parameter so that Inno Setup replaces it in the script before calling the code section.

  14. #14
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,246

    Re: [Inno Setup] procedure BeforeInstall(); Not Working

    Quote Originally Posted by some1uk03
    How do i verify it..?

    Is there any step through code in Inno?? Like Vb has? things like debug.print

    you should be able to set breakpoints just like VB by clicking in the left margin (just like VB)

    I recommend you use the latest version of INNO, I am not sure when they added in the debugging features.

    As far as the issue, you need to pass in the value as a whole, you can't use INNOs values in the code section (as randem suggested above)

    Go into the INNO help file, and look for the topic "Pascal Scripting: BeforeInstall and AfterInstall Parameters" (you can search that in the help search and it will come up)

    it shows you how to do what you want, and also has some code examples.
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.