Archive: Problem with the large string version of NSIS


Problem with the large string version of NSIS
Hello,

When I try to compile Ultra Modern UI with the large string build of NSIS, the compiler stop without any error...

Log with the Confirm.nsi example:

MakeNSIS v2.46 - Copyright 1995-2009 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

Processing config:
Processing plugin dlls: "C:\Program Files\NSIS\Plugins\*.dll"
- AdvSplash::show
- Banner::destroy
- Banner::getWindow
- Banner::show
- BgImage::AddImage
- BgImage::AddText
- BgImage::Clear
- BgImage::Destroy
- BgImage::Redraw
- BgImage::SetBg
- BgImage::SetReturn
- BgImage::Sound
- Dialer::AttemptConnect
- Dialer::AutodialHangup
- Dialer::AutodialOnline
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- InstallOptions::dialog
- InstallOptions::initDialog
- InstallOptions::show
- InstallOptionsEx::dialog
- InstallOptionsEx::initDialog
- InstallOptionsEx::setFocus
- InstallOptionsEx::show
- InstallOptionsEx::skipValidation
- InstallOption****legacy::dialog
- InstallOption****legacy::initDialog
- InstallOption****legacy::setFocus
- InstallOption****legacy::show
- InstallOption****legacy::skipValidation
- InstallOption****newAPI::dialog
- InstallOption****newAPI::initDialog
- InstallOption****newAPI::setFocus
- InstallOption****newAPI::show
- InstallOption****newAPI::skipValidation
- LangDLL::LangDialog
- Math::Script
- NSISArray::ArrayCount
- NSISArray::ArrayExists
- NSISArray::Clear
- NSISArray::Concat
- NSISArray::Copy
- NSISArray::Cut
- NSISArray::Debug
- NSISArray::Delete
- NSISArray::ErrorStyle
- NSISArray::Exists
- NSISArray::ExistsI
- NSISArray::FreeUnusedMem
- NSISArray::Join
- NSISArray::New
- NSISArray::Pop
- NSISArray::Push
- NSISArray::Put
- NSISArray::ReDim
- NSISArray::Read
- NSISArray::ReadToStack
- NSISArray::Reverse
- NSISArray::Search
- NSISArray::SearchI
- NSISArray::SetAutoReDim
- NSISArray::SetSize
- NSISArray::Shift
- NSISArray::SizeOf
- NSISArray::Sort
- NSISArray::Splice
- NSISArray::Subtract
- NSISArray::Swap
- NSISArray::Unload
- NSISArray::Unshift
- NSISArray::Write
- NSISArray::WriteList
- NSISArray::WriteListC
- NSISdl::download
- NSISdl::download_quiet
- SkinnedControls::setskin
- SkinnedControls::skinit
- SkinnedControls::unskinit
- Splash::show
- StartMenu::Init
- StartMenu::Select
- StartMenu::Show
- System::Alloc
- System::Call
- System::Copy
- System::Free
- System::Get
- System::Int64Op
- System::Store
- TypeLib::GetLibVersion
- TypeLib::Register
- TypeLib::UnRegister
- UserInfo::GetAccountType
- UserInfo::GetName
- UserInfo::GetOriginalAccountType
- VPatch::GetFileCRC32
- VPatch::GetFileMD5
- VPatch::vpatchfile
- nsDialogs::Create
- nsDialogs::CreateControl
- nsDialogs::CreateItem
- nsDialogs::CreateTimer
- nsDialogs::GetUserData
- nsDialogs::KillTimer
- nsDialogs::OnBack
- nsDialogs::OnChange
- nsDialogs::OnClick
- nsDialogs::OnNotify
- nsDialogs::SelectFileDialog
- nsDialogs::SelectFolderDialog
- nsDialogs::SetRTL
- nsDialogs::SetUserData
- nsDialogs::Show
- nsExec::Exec
- nsExec::ExecToLog
- nsExec::ExecToStack

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "C:\Program Files\NSIS\Examples\******odernUI"

Processing script file: "C:\Program Files\NSIS\Examples\******odernUI\Confirm.nsi"
Name: "******odernUI Confirm"
OutFile: "Confirm.exe"
SetCompressor: /FINAL lzma
InstallDir: "$LOCALAPPDATA\******odernUI Test"
InstallRegKey: "HKCU\Software\******odernUI Test\"
!include: "C:\Program Files\NSIS\Include\UMUI.nsh"
!include: "C:\Program Files\NSIS\Contrib\******odernUI\UMUI.nsh"
NSIS Ultra Modern User Interface version 1.00 beta 2 - 2005-2009 SuperPat (C:\Program Files\NSIS\Contrib\******odernUI\UMUI.nsh:12)
Based on: NSIS Modern User Interface version 1.8 - 2002-2009 Joost Verburg (C:\Program Files\NSIS\Contrib\******odernUI\UMUI.nsh:13)
!define: "MUI_INCLUDED"=""
!define: "UMUI_SYSVERSION"="1.00 beta 2"
!define: "MUI_SYSVERSION"="1.8"
!define: "MUI_VERBOSE"="3"
!include: closed: "C:\Program Files\NSIS\Contrib\******odernUI\UMUI.nsh"
!include: closed: "C:\Program Files\NSIS\Include\UMUI.nsh"
!include: "C:\Program Files\NSIS\Include\WinMessages.nsh"
!include: closed: "C:\Program Files\NSIS\Include\WinMessages.nsh"
!define: "UMUI_SKIN"="red"
!define: "MUI_ABORTWARNING"=""
!define: "MUI_UNABORTWARNING"=""
Var: "STARTMENU_FOLDER"
!insertmacro: MUI_PAGE_LICENSE
!insertmacro: end of MUI_PAGE_LICENSE
!insertmacro: MUI_PAGE_COMPONENTS
!insertmacro: end of MUI_PAGE_COMPONENTS
!insertmacro: MUI_PAGE_DIRECTORY
!insertmacro: end of MUI_PAGE_DIRECTORY
!define: "MUI_STARTMENUPAGE_REGISTRY_ROOT"="HKCU"
!define: "MUI_STARTMENUPAGE_REGISTRY_KEY"="Software\******odernUI Test"
!define: "MUI_STARTMENUPAGE_REGISTRY_VALUENAME"="Start Menu Folder"
!insertmacro: UMUI_PAGE_ALTERNATIVESTARTMENU
!insertmacro: end of UMUI_PAGE_ALTERNATIVESTARTMENU
!define: "UMUI_CONFIRMPAGE_TEXTBOX"="confirm_function"
!insertmacro: UMUI_PAGE_CONFIRM
It did the same thing when you try to insert an ultra modern page.

Do you now why?

Best Regards,
SuperPat

I just tried to compile the ******odernUI (1.00 2009-12-25) basic.nsi example with the large string build and it worked...

But when I tried to compile the confirm.nsi example makensis crashed.

Second chance exception 0xC00000FD (Stack Overflow) occurred in "MAKENSIS.EXE" at address 0x0044F907.
ps. For some reason the forum is filtering word ****** (u-l-t-r-a-m) effectively breaking urls to ******odernUI.

PaR

The basic.nsi example works because it does not use any InstallOptionsEx pages.

The WelcomeFinishAbort.nsi, MultiLanguage.nsi examples work fine


Reduced test case probably would help to solve this problem. ;)

PaR


With "Stack Overflow" two things come to my mind: Either UMUI uses too many nested macros/functions, so that the stack runs out of free space (maybe the long strings build requires more stack space per macro/function call, so that's why the "normal" build works?) or there is an infinite recursion somewhere. The latter is unlikely, because it would (most-likely) apply to the "normal" build as well. Can't we simply increase the stack size ???


Originally posted by LoRd_MuldeR
With "Stack Overflow" two things come to my mind: Either UMUI uses too many nested macros/functions, so that the stack runs out of free space (maybe the long strings build requires more stack space per macro/function call, so that's why the "normal" build works?)
You are right but there are only three sub-macro level where it crashes but some of them can be called several times in the same function.

It is true that I use too many macros, and not enough functions because of their difficulty in managing it:

Some function may be called in install script and uninstall script but it is not an obligation and an unused function causes a warning.

I might try using a little less macro, but I think the stack will still always too small.


Originally posted by LoRd_MuldeR
Can't we simply increase the stack size ???
This would be perfect!

Here's an modified version of the large string makensis.exe with stack size set to 8 MB. I used EDITBIN from the VC++ toolset to change the stack size.

PaR


That one works for me :)

BTW: Is there a way to detect NSIS_MAX_STRLEN at runtime?


Not sure what you mean, but NSIS_MAX_STRLEN is defined at script compiletime and passing it to some runtime variable shouldn't be a problem. E.g. StrCpy $0 ${NSIS_MAX_STRLEN}

NSIS_MAX_STRLEN is also passed on plug-in when they are called.

PaR


Ah, thanks again!

I couldn't find ${NSIS_MAX_STRLEN} in the docs and only tried ${__NSIS_MAX_STRLEN__} ;)


Right :)
You can run command 'makensis /HDRINFO' to get a list of options makensis was compiled with. All those options should be defined when compiling scripts.

PaR


Originally posted by {_trueparuex^}
Here's an modified version of the large string makensis.exe with stack size set to 8 MB. I used EDITBIN from the VC++ toolset to change the stack size.
Is this version of the file still available somewhere? I, too, am getting the crashing issue, and would love a quick fix.

Alternately, is there another way to change the stack size without using the VC++ toolset, which I don't have?

Thanks in advance!
Michael

http://nsis.sourceforge.net/Docs/AppendixG.html#G.1

Stu


Originally posted by theTallGuy
Is this version of the file still available somewhere? I, too, am getting the crashing issue, and would love a quick fix.

Alternately, is there another way to change the stack size without using the VC++ toolset, which I don't have?

Thanks in advance!
Michael
Not sure what happened to the attachment, but I uploaded another version to my website:
http://koti.mbnet.fi/vaultec/files/m...2_stack_8M.zip

The stack size is just a value in the PE header and you can change it with tools like: LordPE, PE tools, PE Explorer ... hex editor of your choice. :D

PaR

AddSize no longer works. Is this version based on a nightly build? Otherwise, thanks.

edit:
Nor does it automatically get the section size for 'Space required'. You have to calculate manually and SectionSetSize as a workaround.

edit again:
It hinges on the placement of sections. Don't ask me why. They have to be before .onInit? (Or nothing installs.) I can't fix it.


There is another large string download from sourceforge. The installer it builds fails the integrity check. This puts me in a bind. Not being a developer, I can't build me own version.

I'm using a single string with potentially, although unlikely, up to 150 paths of files that are in use. I'm unable to divide the string up into several smaller segments, because each path will be added onto the one string with a line break, and the string will be displayed on the MUI UnConfirmPage as a list of files. I would trim the full paths and use only the file names, as a last resort.

Is anyone else having similar issues with the large string build: "Installer integrity check has failed"?


Why not use a listbox to display the paths?
You could add one line at a time


It's possible. I haven't worked with listboxes before. The list has to refresh when there are still some files open after the Uninstall button is pressed, scroll down with many files, and scroll horizontally or wrap if the path is long. I think you can achieve the first two, but not sure about the third. I'll see what happens. Thanks. :up:


http://lmgtfy.com/?q=listbox+horizontal+scroll


Originally posted by bnicer
AddSize no longer works. Is this version based on a nightly build? Otherwise, thanks.

edit:
Nor does it automatically get the section size for 'Space required'. You have to calculate manually and SectionSetSize as a workaround.

edit again:
It hinges on the placement of sections. Don't ask me why. They have to be before .onInit? (Or nothing installs.) I can't fix it.
It's the official large string build (NSIS v2.46) modified with EDITBIN.

Are you using the correct stub files?

PaR

I'm using stubs that are in the stubs folder for the normal build. Is that wrong?

What strikes me is that AddSize does not add size to the section it's in. Unless I move the section that installs files forward, nothing really happens. It's like the section wasn't there.

edit: I just read the readme.txt, which mentions stubs. I missed that. Sorry. My mistake.

Yes, and the sourceforge download and the large string build you posted are both up and running without a hitch now. Again, sorry for the fuss, people. :o Oops. Thanks!


Not compatible with Unicode?
only works with ANSI?


Originally posted by PoRtAbLe_StEaLtH
only works with ANSI?
The unicode build uses large strings by default IIRC