Skip to content
⌘ NSIS Forum Archive

NSIS 3.0a0

66 posts

Anders#
Originally Posted by Redo89 View Post
Please, make possibility of translation of the text for "NSIS Error".
It always in English.... Add opportunity to change the text of this error.
thanks.
This has been asked before, this string is used before translations have been loaded. If you want to change the string, use a hex editor...
Redo89#
what file to edit hex editor? the compiled installer? It will cause CRC error!
I don't want to disable CRC check

And you are right, about this problem many times wrote. I don't understand why developers can't add opportunity to change this message...

Sorry for bad English!
Yathosho#
in need some advice on how to best debug an installer generated with this alpha version. i have one installer that produces problems: it compiles, but upon running it crashes with no error message whatsoever. i commented out all used plugins (MoreInfo, System and ToolTips) and even the custom UI it uses - no success. a look at process monitor shows a couple of errors/warnings (NAME COLLISION, FILE LOCKED WITH ONLY READERS, FAST IO DISALLOWED and BUFFER OVERFLOW). the installer quits with error code -1073741819 (and google doesn't know about that). i checked with the last working version and it produces the same results in process monitor, but the installer works as desired.
Anders#
Originally Posted by Yathosho View Post
in need some advice on how to best debug an installer generated with this alpha version. i have one installer that produces problems: it compiles, but upon running it crashes with no error message whatsoever. i commented out all used plugins (MoreInfo, System and ToolTips) and even the custom UI it uses - no success. a look at process monitor shows a couple of errors/warnings (NAME COLLISION, FILE LOCKED WITH ONLY READERS, FAST IO DISALLOWED and BUFFER OVERFLOW). the installer quits with error code -1073741819 (and google doesn't know about that). i checked with the last working version and it produces the same results in process monitor, but the installer works as desired.
Can you create a minimal sample with the same issue? Does MessageBox in .onInit work? Unicode/Ansi?
Yathosho#
Originally Posted by Anders View Post
Can you create a minimal sample with the same issue? Does MessageBox in .onInit work? Unicode/Ansi?
okay, thanks to your advise i could narrow down the problem

1. it works when i compile an ansi version

2. when i compile a unicode version, this segment is causing the problem:
	${If} ${AtLeastWin2000}
StrCpy "$settingsINI" "$APPDATA\RunWithParameters\settings.ini"
StrCpy "$historyINI" "$APPDATA\RunWithParameters\history.ini"
StrCpy "$defaultsINI" "$APPDATA\RunWithParameters\defaults.ini"
IfFileExists "$APPDATA\RunWithParameters\mydefaults.ini" 0 +2
StrCpy "$mydefaultsINI" "$APPDATA\RunWithParameters\mydefaults.ini"
${ElseIf} ${AtMostWinME}
StrCpy "$settingsINI" "$EXEDIR\settings.ini"
StrCpy "$historyINI" "$EXEDIR\history.ini"
StrCpy "$defaultsINI" "$EXEDIR\defaults.ini"
IfFileExists "$EXEDIR\mydefaults.ini" 0 +2
StrCpy "$mydefaultsINI" "$EXEDIR\mydefaults.ini"
${EndIf}
Anders#
Originally Posted by Yathosho View Post
2. when i compile a unicode version, this segment is causing the problem:
Does not crash for me (tested in a section), please provide a full .nsi

As far as the code goes, what about NT4?
Yathosho#
Originally Posted by Anders View Post
Does not crash for me (tested in a section), please provide a full .nsi
see attachment, should include everything to compile

Originally Posted by Anders View Post
As far as the code goes, what about NT4?
good point, thanks
Anders#
Originally Posted by Yathosho View Post
see attachment, should include everything to compile
My guess is that the crash is in nsArray, please provide sample code that does not use 3rd-party plugins if you want me to investigate further...
Yathosho#
Originally Posted by Anders View Post
My guess is that the crash is in nsArray, please provide sample code that does not use 3rd-party plugins if you want me to investigate further...
as i said before, i already tried and commented out all plugins and the ui - to no success
jpderuiter#
By using Messageboxes you can narrow it down to the ForEachIn loop in line 318.

I don't know nsArray, but are you allowed to use StrCpy with it (line 304, 310 and 314)?
Yathosho#
i'm getting the same problem with this simple script

; Settings ---------------------------------
OutFile "installer_name.exe"
RequestExecutionLevel user
Unicode true
!include LogicLib.nsh
!include WinVer.nsh
; Pages ------------------------------------
Page instfiles
; Sections ---------------------------------
Section "section_name"
Quit
SectionEnd
; Functions --------------------------------
Function .onInit
${If} ${AtLeastWin2000}
MessageBox MB_OK "${__LINE__}"
${EndIf}
FunctionEnd
seems only to happen on my main windows installation (windows 7 with all patches). works just fine in a vm with windows 2003, on virtualized windows 7 i get as far as the messagebox before the program terminates with an error message (see attachment).
jpderuiter#
As said in my previous post, I get a crash on your script with nsArray, which you are mixing with StrCpy.

For the Kernelbase.dll error:
Afrow UK#
Working on the crash now. It appears to be coming from nsArray.

Originally Posted by jpderuiter View Post
I don't know nsArray, but are you allowed to use StrCpy with it (line 304, 310 and 314)?
I very much doubt that this would cause a crash - the value passed to the plug-in at run time should be no different when passing it via a variable or a hard coded string.

Stu
Yathosho#
Originally Posted by jpderuiter View Post
As said in my previous post, I get a crash on your script with nsArray, which you are mixing with StrCpy
the executable runs fine when i comment out the first if-statement in onInit, also the ansi version never caused any problems.

i think the bug is caused by WinVer.nsh. when i comment its line 197, my compiled executable does not crash. this is the line:
System::Call kernel32::GetVersionEx(pr0)i.r3
jpderuiter#
Sorry, my crashes happen because I commented out onGUIInit, because I wanted to test it without parameters.

Yatosho, does your script crash when using /help as parameter?
Afrow UK#
Fixed the memory access violation in nsArray which occurred in the ForEachIn loop (nsArray::Iterate). I tested by running with /install and then running subsequent debugging executions with the default INI file as an argument. I don't get any crashes now.

Edit: I should mention the crash came about because an invalid array name is being used in your ForEachIn loop - it resulted in a NULL pointer in the plug-in and subsequent violation where validation was missing. This should not be an issue now.

Stu
Yathosho#
Originally Posted by jpderuiter View Post
The last example doesn't crash for me either. Can you maybe attach the compiled installer too?
attached

Yatosho, does your script crash when using /help as parameter?[/QUOTE]

yes
Yathosho#
ok, i did some more testing as getting different results on different windows installations seemed strange. computer is virus free, so i renamed my old nsis directory (i installed nsis 3 over nsis 2) and did a clean install of 3.0a. now everything compiles and runs fine. still find it a bit weird (ANSI worked, WinVer seems to have caused this), but for me it's sorted. thanks for all advice.
bnicer#
I had problem with an installer, where ANSI worked as opposed to UNICODE, that was caused by WinVer. The installer didn't crash, but the ${If} ${AtLeastWin'X'} conditions failed, UNICODE. Though, unlike in Yathosho's example, my script had a mistake. I was including WinVer.nsh before I declared Unicode true/false.

I thought of posting this earlier in response to Yathosho, but it didn't seem related. Maybe it is (worth looking into)? If the Unicode true declaration comes after an included file, a compiler error message would be in order, even though it's an avoidable mistake. I wonder as well if it should be necessary to declare Unicode when the script file is encoded in UNICODE. Make Unicode an optional command?
Anders#
Thanks Yathosho and bnicer for tracking this down.

The compiler should abort if you use a plugin before switching unicode mode but WinVer does some size calculations when you include it and those are later passed to System::Call, I'll try to come up with a fix for this...
mariusnegrutiu#
I'm trying to digitally sign the installer using the new !finalize command.
Everything works well as long as I don't use "%1" in the command line. If "%1" is used, makensis.exe crashes...

My code goes like this:
!finalize '"${__FILEDIR__}\SignTool.exe" sign /s MY_CERTSTORE /t "http://timestamp.globalsign.com/scripts/timstamp.dll" /d "Description" /du "http://www.blahblah.com" /v "%1"'

Btw, congratulations for reviving NSIS!
Anders#
WinVer should be a able to deal with switching modes now but it really is best if the unicode mode is set before files are !included

Originally Posted by mariusnegrutiu View Post
Everything works well as long as I don't use "%1" in the command line. If "%1" is used, makensis.exe crashes...
Fixed...
Anders#
Originally Posted by extremecarver View Post
Is there filesize >2GB support in 3.0a?
Or will it come with x64 branch?
No and I'm guessing no, the top bit is already used to store data...
extremecarver#
thanks for the answer. Well then I hope it will be changed/enabled after x64 intregration sometimes. It would be much better than having the installer call external .zip/7z files (which on top can only be bzip/lzma and not lzma2) to unpack because they don't fit into the 2GB limit.
yoachan#
Just want to say thank you for everyone's work. 🙂

BTW can I use/install both NSIS 2 and NSIS 3 in one PC?
Would like my project to keep running and be able to test NSIS 3 to tell if I found a bug.
So amazing that NSIS 3 exist. Even NSIS 2 is already amaze me. 🙂
Anders#
Originally Posted by yoachan View Post
BTW can I use/install both NSIS 2 and NSIS 3 in one PC?
Would like my project to keep running and be able to test NSIS 3 to tell if I found a bug.
So amazing that NSIS 3 exist. Even NSIS 2 is already amaze me. 🙂
The startmenu and add/remove programs entries will be taken over, other than that it should not be a problem. Makensis itself does not depend on any kind of system configuration...
Yathosho#
are there plans to move the examples (and maybe includes) to the user space? on any modern windows version, the examples won't compile due to lack of privileges. just saying.