Old 20th May 2013, 01:28   #1
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
NSIS 3.0a0

Yep. It's finally here.

Get your download at the usual place:

http://nsis.sourceforge.net/Download

Among many bug fixes and new features, the biggest one is probably Jim Park's Unicode. Wizou and Anders have merged it back to the main version and it's now available as an optional Unicode true command. So thank you Jim, thank you Wizou for merging it back in and thank you Anders for wrapping it all up and making sure NSIS 3 happens.

Next on plan is fixing whatever we broke (like linux build) and x64 by David Golub (partially already available in SVN and on David's BitBucket).

Please let us know of any broken parts of loose screws

P.S.

Check out our Twitter feed by Yathosho.

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  
Old 20th May 2013, 07:39   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Absolutely awesome! Many thanks to the NSIS team for putting in so many hours, and congratulations for reaching this important milestone. I'm hoping to go play with it soon!
MSG is offline  
Old 20th May 2013, 09:06   #3
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
Awesoooooooooome!!!

Quick question for plug-ins: all old plug-ins are now automatically treated as x86, aren't they?

Second question: Is .chm manual working for you correctly?

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline  
Old 20th May 2013, 09:43   #4
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
I'm an eternal optimist but I admit I was worried we'd seen the last major build, as the project really seemed to be losing momentum. I love NSIS, this is frelling great news! Thank you devs for all your work!

PostEnd:
aerDNA is offline  
Old 20th May 2013, 09:44   #5
TaleTN
Junior Member
 
Join Date: May 2013
Posts: 4
Cool, thanks!

I have just quickly tried 3.0a0, and a simple project compiled, but another, somewhat larger one wouldn't because !searchparse and !searchreplace failed. I then reinstalled 2.46, and then the project compiles just fine, so it would seem !searchparse and !searchreplace are broken.

!searchparse error:
code:
!searchparse: starting string "#define VERSIONINFO_VERSION " not found in file!


Failing NSIS source code line:
code:
!searchparse /file ../resource.h '#define VERSIONINFO_VERSION ' VER_MAJR ',' VER_MN ',' VER_BG ','


Relevant line from ../resource.h:
code:
#define VERSIONINFO_VERSION 1,3,0,0 // 1.3.0


!searchreplace error:
code:
Usage: !searchreplace [/ignorecase] output_name source_string substring replacestring


Failing NSIS source code line:
code:
!searchreplace VER_FN "${VER_STR}" "." ""
TaleTN is offline  
Old 20th May 2013, 11:57   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
Originally Posted by T.Slappy View Post
Quick question for plug-ins: all old plug-ins are now automatically treated as x86, aren't they?
If you mean Ansi vs Unicode then yes, everything starts out as Ansi but NSIS\Plugins\*.dll is not searched anymore, you would have to move them into the correct subdirectory...

Quote:
Originally Posted by T.Slappy View Post
Second question: Is .chm manual working for you correctly?
What do you mean?


Quote:
Originally Posted by TaleTN View Post
I have just quickly tried 3.0a0, and a simple project compiled, but another, somewhat larger one wouldn't because !searchparse and !searchreplace failed. I then reinstalled 2.46, and then the project compiles just fine, so it would seem !searchparse and !searchreplace are broken.
They are stricter in what they accept but it is of course possible that there is a bug in the new code.

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 20th May 2013, 14:19   #7
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
Hmm I cannot edit my previous post so I am adding found issues here, most of them are from manual:

UnsafeStrCpy command is not documented (however I suppose the same behaviour as StrCpy)

The 'new' ReserveFile explanation is very vague:
Quote:
Plugins in ${NSISDIR}\Plugins have to be reserved with ReserveFile /plugin
Maybe it is better to say "use /plugin switch anytime you use ReserveFile for reserving the .dll file".
Also plug-ins are now stored in ${NSISDIR}\Plugins\<architecture>-<Charset> so this may be confusing for users.

And again thanks for the great work!

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline  
Old 20th May 2013, 14:33   #8
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
Great work!

Maybe it is a good idea to copy already installed plugin's from a NSIS 2.x installation to the new plugin location (at least the ansi plugin's) in the NSIS installer?

jpderuiter
jpderuiter is offline  
Old 20th May 2013, 18:20   #9
TaleTN
Junior Member
 
Join Date: May 2013
Posts: 4
Quote:
Originally Posted by Anders View Post
They are stricter in what they accept but it is of course possible that there is a bug in the new code.
Then I guess there is a bug in the !searchparse code, because I have this very simple text file (meh.h):

code:
#define APP_VERSION 1,2,3
#define LONG_VERSION 1,2,3,4



Which I fails to parse correctly with this equally simple NSIS script:

code:
!searchparse /file meh.h `#define APP_VERSION ` VER_MAJOR `,` VER_MINOR `,`
# Bug: Found "#define APP_VERSION 1,2,", so VER_MAJOR should be "1" and
# VER_MINOR "2". However, VER_MINOR is "2,3".

!searchparse /file meh.h `#define LONG_VERSION ` LONG_MAJOR `,` LONG_MINOR `,` LONG_BG `,`
# Bug: Should have found "#define LONG_VERSION 1,2,3,", but instead says
# "#define LONG_VERSION " not found.

Name "meh ${VER_MAJOR}.${VER_MINOR} (${LONG_MAJOR}.${LONG_MINOR}.${LONG_BG})"
OutFile "meh.exe"
Section
SectionEnd

TaleTN is offline  
Old 20th May 2013, 21:49   #10
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
didn't think i'd live to see this, good job everybody!

i'm glad that the anchors for commands in the html help finally changed from chapters to something more readable. would've been better though to use the literal command names - #StrCpy rather than #strcpy, #!ifdef rather than #if. i can think of several scenarios where this could be come useful, for instance a command lookup from an editor.
Yathosho is offline  
Old 21st May 2013, 03:12   #11
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Xi'an, China
Posts: 206
Great work!!!!!!!!!!!!!!!!

Maybe able to upgrade LZMA(LZMA2)?

Born in: Xi'an, China
Live in: Shanghai, China
Name: 賈可(zh-Hant, trad.), 贾可(zh-Hans, simp.), Jia Ke (Pinyin).
Email: jiake@vip.qq.com
QQ: 137729898
jiake is offline  
Old 21st May 2013, 07:44   #12
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
Quote:
Originally Posted by jiake View Post
Maybe able to upgrade LZMA(LZMA2)?
there has been a discussion about that
Yathosho is offline  
Old 21st May 2013, 08:26   #13
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Xi'an, China
Posts: 206
Quote:
Originally Posted by Yathosho View Post
there has been a discussion about that
Thank you.
Compression code does look outdated.

Born in: Xi'an, China
Live in: Shanghai, China
Name: 賈可(zh-Hant, trad.), 贾可(zh-Hans, simp.), Jia Ke (Pinyin).
Email: jiake@vip.qq.com
QQ: 137729898
jiake is offline  
Old 21st May 2013, 19:37   #14
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
I think I fixed searchparse

Quote:
Originally Posted by TaleTN View Post
!searchreplace error:
code:
Usage: !searchreplace [/ignorecase] output_name source_string substring replacestring


Failing NSIS source code line:
code:
!searchreplace VER_FN "${VER_STR}" "." ""

!define VER_STR a.b.c.d
!searchreplace VER_FN "${VER_STR}" "." ""
!warning "|${VER_FN}|"

gives me:

!searchreplace: "VER_FN"="abcd"
warning: !warning: |abcd| (test.nsi:22)

so you need to provide a full example that actually fails for me to fix this

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 21st May 2013, 21:31   #15
Theresias
Junior Member
 
Join Date: Jun 2006
Posts: 48
Very much appreciated folks, keep up the good work!
Theresias is offline  
Old 22nd May 2013, 09:43   #16
TaleTN
Junior Member
 
Join Date: May 2013
Posts: 4
Quote:
Originally Posted by Anders View Post
so you need to provide a full example that actually fails for me to fix this
Here you go:

meh.h:
code:
#define VERSIONINFO_STR "1.3.0"


meh.nsi:
code:
# Sets VER_STR to "1.3.0".
!searchparse /file meh.h '#define VERSIONINFO_STR "' VER_STR '"'

# VER_FN should be "130", but returns usage error instead.
!searchreplace VER_FN "${VER_STR}" "." ""

Name "meh"
OutFile "meh.exe"
Section
SectionEnd

TaleTN is offline  
Old 22nd May 2013, 12:40   #17
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
After a short work with NSIS 3 I noticed my favourite feature is still not implemented:
code:

Var /GLOBAL myVariable "initial value"



I think this is often used: "initial value" could be optional parameter.

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline  
Old 22nd May 2013, 20:10   #18
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
Originally Posted by T.Slappy View Post
After a short work with NSIS 3 I noticed my favourite feature is still not implemented:
code:
Var /GLOBAL myVariable "initial value"

I think this is often used: "initial value" could be optional parameter.
I believe there is a feature request for Var Foo, Bar, Baz but I don't think we found a good syntax to express this, /GLOBAL makes things confusing etc.

Setting an initial value is probably not going to happen, NSIS currently uses a PE section trick to allocate the variables with no code at runtime. If you want this feature so bad you can just use a macro in .onInit...

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 23rd May 2013, 05:04   #19
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
Congrats on finally moving up to version 3 alpha!

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline  
Old 24th May 2013, 13:05   #20
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
Very good to have it all in one place. I like also the streamlining since 2.46. Math.dll -- much smaller. Thanks.

I found a minor problem. (I hope minor.)

${NSIS_CHAR_SIZE} is always 1.

So,

PHP Code:
!if "${NSIS_CHAR_SIZE}2
  Unicode true
!endif 
does not work.
bnicer is offline  
Old 24th May 2013, 13:21   #21
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
Originally Posted by TaleTN View Post
Here you go:
With !searchparse fixed I get 130 as the result...

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 24th May 2013, 13:22   #22
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
Originally Posted by bnicer View Post
${NSIS_CHAR_SIZE} is always 1.
This is by design, ${NSIS_CHAR_SIZE} is mainly for code that interacts with the system plugin. ${NSIS_CHAR_SIZE} changes after "Unicode true"...

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 24th May 2013, 14:41   #23
TaleTN
Junior Member
 
Join Date: May 2013
Posts: 4
Quote:
Originally Posted by Anders View Post
With !searchparse fixed I get 130 as the result...
Yay, great! I guess there was nothing wrong with !searchreplace then, but it was also caused by a bug in !searchparse?
TaleTN is offline  
Old 24th May 2013, 15:28   #24
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
Quote:
${NSIS_CHAR_SIZE} changes after "Unicode true"...
I should have tried it first. It isn't a problem, only different. Thanks.
bnicer is offline  
Old 24th May 2013, 19:49   #25
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
there's always a warning when a script contains ${NSIS_VERSION}, i guess it doesn't like the "a" in v3.0a0
Yathosho is offline  
Old 25th May 2013, 00:05   #26
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
Originally Posted by Yathosho View Post
there's always a warning when a script contains ${NSIS_VERSION}, i guess it doesn't like the "a" in v3.0a0
Please post code examples and compiler warnings when reporting issues...

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 25th May 2013, 09:35   #27
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
Quote:
Originally Posted by Anders View Post
Please post code examples and compiler warnings when reporting issues...
code:
!if ${NSIS_VERSION} < "v3.0"
!endif



will produce

code:
1 warning:
Invalid number: "v3.0a0" (C:\Users\jan\Desktop\test.nsi:1)

Yathosho is offline  
Old 25th May 2013, 16:17   #28
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
That warning is because it can't parse "v3.0a0" (or "v3.0") as an integer because it isn't.

Stu
Afrow UK is offline  
Old 25th May 2013, 17:07   #29
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
Originally Posted by Yathosho View Post
code:
!if ${NSIS_VERSION} < "v3.0"
!endif

Like Afrow UK said, it gives you a warning because it failed to parse the input as a number. The warning is new but it will fail to parse under 2.46 as well.

Quote:
Originally Posted by 2.46 fails this
!undef NSIS_VERSION
!define NSIS_VERSION "v3.0" ;a0"
!if ${NSIS_VERSION} < v4.0
!warning "${NSIS_VERSION} <"
!else
!warning "${NSIS_VERSION} >="
!endif
You probably want something like:
Quote:
!if "${NSIS_PACKEDVERSION}" > 0x2046000
Unicode True
!else
!if "${NSIS_CHAR_SIZE}" < 2 ; This takes care of the Unicode fork?
!warning "Unicode not supported, creating ANSI installer"
!endif
!endif

When comparing NSIS_PACKEDVERSION you should check against the last version that did not have the feature you are after, if you do it this way you should be compatible all the way back to v2.15. If you do it the other way with !if ${NSIS_PACKEDVERSION} >= 0x3000000 it will be parsed as 0 >= 0 (true) on older versions!

It is important to note that unofficial svn builds might not set NSIS_VERSION nor NSIS_PACKEDVERSION at all.


Quote:
!if 0x2046000 >= "${NSIS_PACKEDVERSION}"
!error "You need NSISv3+"
!endif
;Or
!if ! "${NSIS_PACKEDVERSION}" > 0x2046000
!error "You need NSISv3+"
!endif
I'm not sure what the fork will do in the future, you might even want to use !if ! "${NSIS_PACKEDVERSION}" > 0x2999999

The format of NSIS_VERSION was never set in stone, v3.4.5 would be a legal version and there can be a letter or word suffix etc...

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 29th May 2013, 17:20   #30
Redo89
Junior Member
 
Join Date: May 2013
Posts: 2
Respected developers!
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.

Redo89 is offline  
Old 29th May 2013, 20:29   #31
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
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...

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 30th May 2013, 21:43   #32
Redo89
Junior Member
 
Join Date: May 2013
Posts: 2
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!
Redo89 is offline  
Old 31st May 2013, 08:56   #33
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
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.
Yathosho is offline  
Old 31st May 2013, 16:07   #34
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
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?

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 31st May 2013, 19:48   #35
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
Quote:
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:
code:
${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}

Yathosho is offline  
Old 31st May 2013, 22:09   #36
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
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?

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 31st May 2013, 22:24   #37
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
Quote:
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

Quote:
Originally Posted by Anders View Post
As far as the code goes, what about NT4?
good point, thanks
Attached Files
File Type: zip rwparam-2.1.5pre-src.zip (22.4 KB, 134 views)
Yathosho is offline  
Old 1st June 2013, 01:56   #38
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
Quote:
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...

IntOp $PostCount $PostCount + 1
Anders is offline  
Old 1st June 2013, 07:28   #39
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
Quote:
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
Yathosho is offline  
Old 1st June 2013, 13:52   #40
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
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)?
jpderuiter is offline  
Closed Thread
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