- NSIS Discussion
- Crashing on custom page
Archive: Crashing on custom page
Afrow UK
2nd August 2003 19:03 UTC
Crashing on custom page
This is very strange, and has just started happening even though I never changed the code that is causing the crash.
I have a custom IO page, and am reading registry values when the user clicks back or next.
After reading the registry values, I am comparing them to "1".
Just those two pieces of code seems to crash the whole installer when I click back or next.
My function is like this:
Function MainDialog
## Add header text and colour
!insertmacro HEADER_TEXT "Detected Updates" "Updates that have not yet been installed"
## Show dialog
pagetop:
InstallOptions::dialog "$TEMP\ddayupdates\dialog.du"
Pop $R0
StrCmp $R0 back settings
StrCmp $R0 cancel pagecancel
StrCmp $R0 success pagesuccess
StrCmp $R0 error pagecancel
## Open settings dialog
settings:
ReadRegStr $R0 HKLM "SOFTWARE\D-Day Updater" "SETTINGS"
;StrCmp $R0 0 0 pagetop
Exec "$TEMP\ddayupdates\du_settings.exe"
Goto pagetop
pagesuccess:
ReadRegStr $R0 HKLM "SOFTWARE\D-Day Updater" "SETTINGS"
;StrCmp $R0 0 0 pagetop
ReadINIStr $R0 "$TEMP\ddayupdates\dialog.du" "Field 3" "Type"
StrCmp $R0 "Text" 0 pagecancel
MessageBox MB_OK|MB_ICONEXCLAMATION "There are no new detected \
updates.$\r$\nYou are up-to-date!" IDOK pagetop
pagecancel:
WriteRegStr HKLM "SOFTWARE\D-Day Updater" "SETTINGS" "0"
FunctionEnd
If I blank out the strcmp's then it works fine.
Changing strcmp to intcmp also crashes the installer.
I have even put another IO page before it, and that also crashes on leave (even though it does not have any StrCmp's in it).
I have placed a message box before the Pop $R0 (after leaving the IO page) and that never shows either.
I seem to remember this happening randomly for me a while ago, but now it happens all the time (even after reboot)
I am also using Kichik's modified MakeNSIS exe with longer max strlen, but have not downloaded any latest cvs files (so no nsis base files have changed since the installer worked).
-Stu
kichik
3rd August 2003 22:57 UTC
Please try latest CVS verison.
Afrow UK
3rd August 2003 23:04 UTC
That's always a problem with me on this installer atm, because my installer requires the 8192 max strlen.
Is it safe to get the makensis zip containing the modified strlen on cvs change?
-Stu
kichik
3rd August 2003 23:10 UTC
The problem was (hopefully) in InstallOptions.dll not makensis.exe.
ramon18
4th August 2003 10:30 UTC
What happens if you remove this code:
pagetop:
InstallOptions::dialog "$TEMP\ddayupdates\dialog.du"
Pop $R0
StrCmp $R0 back settings
StrCmp $R0 cancel pagecancel
StrCmp $R0 success pagesuccess
StrCmp $R0 error pagecancel
?
ramon18
4th August 2003 16:14 UTC
try latest CVS Kichik as fixed a bug
Afrow UK
4th August 2003 20:14 UTC
Ok,
so should I just extract InstallOptions.dll, or is it safe to use modified makensis.exe with all latest cvs files?
-Stu
kichik
4th August 2003 20:18 UTC
Compare the time your makensis.exe was compiled with the change log and see if anything big was changed since. Better yet, tell me the date and I'll check, just to make sure.
Afrow UK
4th August 2003 20:29 UTC
Created and modified on:
23 July 2003, 23:43:24
I have noticed a modification on NSISdl - need that!
Also, I have seen some nice changes to makensis that are important to my installer.
Will I be able to have another compile :(
Sorry, I must buy a compiler myself.
Any tips on where I would be able to purchase the product (on the net?)
Thanks
-Stu
kichik
4th August 2003 20:34 UTC
Some important changes, same URL.
Try .NET Framework, it comes with a C compiler.
Afrow UK
4th August 2003 20:52 UTC
Ah, ok thanks.
I have a copy of latest NeoScripter (if any good) which I had to download .NET framework for.
Thanks for recompile, much appreciated by me and eventually a load of gamers!
-Stu :)
Afrow UK
4th August 2003 22:16 UTC
OK, after placing the old code back in (containing StrCmp's) it still crashes.
After blanking out the InstallOptions::Dialog, and the pop, it works fine.
I have reverted back to IfFileExists and all is ok.
-Stu
kichik
4th August 2003 22:20 UTC
You did update InstallOptions.dll, right?
Afrow UK
4th August 2003 22:29 UTC
Yes.
I extracted whole CVS zip, and makensis
-Stu
kichik
4th August 2003 22:42 UTC
What does IfFileExists have to do with it? Does it replace the entire custom page? It is just the InstallOptions::dialog call that is causing this right? What's the exact text that shows in the error message?
Afrow UK
4th August 2003 23:05 UTC
I'm on WinXP.
Before, my settings dialog would write "1" to the registry to show that it was running.
On my IO page, I would check if the registry value was "1" and of so, then don't let user continue to next page.
Because this causes crashes, I instead create a temp file to show that the settings dialog is running, and if that file exists then don't go to next page.
The InstallOptions call is indeed causing the crash.
Here is the details:
AppName: ddayupdater.exe AppVer: 1.0.1.0 ModName: installoptions.dll
ModVer: 0.0.0.0 Offset: 00001af6
Strangely, having the StrCmp's
and the IfFileExists in there stops the crashing!
-Stu
kichik
4th August 2003 23:30 UTC
Can you attach a zipped example (script, ini, compiled example)?
The error message makes no sense to me... If somehow a DLL can be loaded at that address or XP trims the base address it means it crashes on test eax, eax. It makes no sense. I'm sorry to doubt, but can you please make sure the InstallOptions.dll you have is versioned 1.64?
Afrow UK
5th August 2003 00:08 UTC
Where can I find the InstallOptions version?
Looking at InstallerOptions, it says version 2.0.
I shall zip up all involved files tomorrow (comes to about 1.5mb).
-Stu
kichik
5th August 2003 00:12 UTC
If you have TortoiseCVS just go the properties of InstallOptions.dll. If not, open Plugins\CVS\Entries and look at the line where InstallOptions.dll is listed.
Afrow UK
5th August 2003 00:16 UTC
Yes, it's 1.64.
-Stu
Afrow UK
5th August 2003 08:03 UTC
Zipped up
You can get it here:
http://myweb.tiscali.co.uk/afrowuk/du_files.zip
Search ddayupdater.nsi for "Function MainDialog" to get there.
There are some notes underneath the function.
-Stu
kichik
5th August 2003 15:59 UTC
I was only able to reproduce this exact error when I gave IO a non existent INI. I have made it so IO will return an error instead of crashing in this case. You should check your script to make sure it doesn't delete the INI file ahead of time or something like that, unless it still crashes with 1.65. If it does, I need full error message and a small example that depends on nothing else.