Archive: Crashing on custom page


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

Please try latest CVS verison.


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


The problem was (hopefully) in InstallOptions.dll not makensis.exe.


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

?


try latest CVS Kichik as fixed a bug


Ok,
so should I just extract InstallOptions.dll, or is it safe to use modified makensis.exe with all latest cvs files?

-Stu


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.


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


Some important changes, same URL.

Try .NET Framework, it comes with a C compiler.


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 :)


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


You did update InstallOptions.dll, right?


Yes.
I extracted whole CVS zip, and makensis

-Stu


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?


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

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?


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


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.


Yes, it's 1.64.

-Stu


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


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.