-
Nov 21st, 2006, 11:59 AM
#1
Thread Starter
Frenzied Member
[Inno Setup] procedure BeforeInstall(); Not Working
Hello,
Another Inno problems of mine...
in my code section i have the following
VB Code:
:
[COLOR=Navy][Code]
[COLOR=DarkOrange]procedure BeforeInstall[/COLOR]();
begin
if FileExists('{userappdata}\MyApp\Settings.ini') then
if MsgBox('Your Settings seem to be Installed. Would you like to keep them?', mbConfirmation, MB_YESNO or MB_DEFBUTTON1) = IDNO then
begin
// Delete the directory and everything inside it
DelTree('{userappdata}\MyApp', True, True, True);
end;
end;[/COLOR]
And then i call the procedure like so..
VB Code:
[COLOR=Navy]
[INI]
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.
-
Nov 21st, 2006, 02:24 PM
#2
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....
-
Nov 21st, 2006, 02:40 PM
#3
Thread Starter
Frenzied Member
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.
-
Nov 21st, 2006, 02:49 PM
#4
Re: [Inno Setup] procedure BeforeInstall(); Not Working
-
Nov 22nd, 2006, 04:56 AM
#5
Thread Starter
Frenzied Member
Re: [Inno Setup] procedure BeforeInstall(); Not Working
VB Code:
[COLOR=DarkSlateBlue][Code]
procedure BeforeInstall();
begin
if MsgBox('Your Settings seem to be Installed. Would you like to keep them?', mbConfirmation, MB_YESNO or MB_DEFBUTTON1) = IDNO then
begin
// Delete the directory and everything inside it
DelTree('{userappdata}\MyApp\*', True, True, True);
end;
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.
-
Nov 22nd, 2006, 05:04 AM
#6
Re: [Inno Setup] procedure BeforeInstall(); Not Working
Did you verify that it does indeed fall thru to the DelTree line?
-
Nov 22nd, 2006, 08:02 AM
#7
Thread Starter
Frenzied Member
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.
-
Nov 22nd, 2006, 12:58 PM
#8
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...
-
Nov 22nd, 2006, 02:45 PM
#9
Thread Starter
Frenzied Member
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.
-
Nov 22nd, 2006, 02:56 PM
#10
Re: [Inno Setup] procedure BeforeInstall(); Not Working
Ok, try this
DelTree('{userappdata}\MyApp\', True, True, True);
-
Nov 22nd, 2006, 03:54 PM
#11
Thread Starter
Frenzied Member
-
Nov 22nd, 2006, 04:15 PM
#12
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.
-
Nov 22nd, 2006, 04:22 PM
#13
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.
-
Nov 22nd, 2006, 04:54 PM
#14
Re: [Inno Setup] procedure BeforeInstall(); Not Working
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|