Old 2nd August 2003, 18:03   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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:
code:

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
Afrow UK is offline   Reply With Quote
Old 3rd August 2003, 21:57   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Please try latest CVS verison.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 3rd August 2003, 22:04   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 3rd August 2003, 22:10   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The problem was (hopefully) in InstallOptions.dll not makensis.exe.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th August 2003, 09:30   #5
ramon18
NSIS Dev
 
ramon18's Avatar
 
Join Date: Apr 2003
Location: Portugal
Posts: 110
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 is offline   Reply With Quote
Old 4th August 2003, 15:14   #6
ramon18
NSIS Dev
 
ramon18's Avatar
 
Join Date: Apr 2003
Location: Portugal
Posts: 110
try latest CVS Kichik as fixed a bug
ramon18 is offline   Reply With Quote
Old 4th August 2003, 19:14   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ok,
so should I just extract InstallOptions.dll, or is it safe to use modified makensis.exe with all latest cvs files?

-Stu
Afrow UK is offline   Reply With Quote
Old 4th August 2003, 19:18   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th August 2003, 19:29   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 4th August 2003, 19:34   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Some important changes, same URL.

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

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th August 2003, 19:52   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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 is offline   Reply With Quote
Old 4th August 2003, 21:16   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 4th August 2003, 21:20   #13
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You did update InstallOptions.dll, right?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th August 2003, 21:29   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Yes.
I extracted whole CVS zip, and makensis

-Stu
Afrow UK is offline   Reply With Quote
Old 4th August 2003, 21:42   #15
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th August 2003, 22:05   #16
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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:
Quote:
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
Afrow UK is offline   Reply With Quote
Old 4th August 2003, 22:30   #17
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th August 2003, 23:08   #18
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 4th August 2003, 23:12   #19
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th August 2003, 23:16   #20
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Yes, it's 1.64.

-Stu
Afrow UK is offline   Reply With Quote
Old 5th August 2003, 07:03   #21
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 5th August 2003, 14:59   #22
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump