Old 8th October 2016, 05:25   #1
eliotime3000
Junior Member
 
Join Date: Oct 2016
Posts: 5
Compiling NSIS Examples: Can't open output file

All good with NSIS 3.0, except for one thing: for add a Version Information to the installer, now it depends of Resource Hacker to add version information to the installer (or at least, that's the impression that shows in this new tutorial).

Exist another variables for add or edit version info of the installer without use Resource Hacker?

Last edited by Anders; 11th October 2016 at 03:55. Reason: Not a NSIS 3 specific issue, moved to separate thread
eliotime3000 is offline   Reply With Quote
Old 8th October 2016, 11:23   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,701
Thumbs down

Quote:
Originally Posted by eliotime3000 View Post
All good with NSIS 3.0, except for one thing: for add a Version Information to the installer, now it depends of Resource Hacker to add version information to the installer (or at least, that's the impression that shows in this new tutorial).

Exist another variables for add or edit version info of the installer without use Resource Hacker?
Did you actually test v3 or are you just wasting everybody's time with pointless questions? If you did test then you forgot to include example code and compiler error messages!

That wiki page is from 2005, what makes you think anything has changed in v3? In fact, NSIS3 added the !getdllversion instruction that lets you extract information at compile-time with no external tools. v3 still has the same VI* attributes you use to set the version information.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th October 2016, 06:24   #3
eliotime3000
Junior Member
 
Join Date: Oct 2016
Posts: 5
Quote:
Originally Posted by Anders View Post
Did you actually test v3 or are you just wasting everybody's time with pointless questions? If you did test then you forgot to include example code and compiler error messages!

That wiki page is from 2005, what makes you think anything has changed in v3? In fact, NSIS3 added the !getdllversion instruction that lets you extract information at compile-time with no external tools. v3 still has the same VI* attributes you use to set the version information.
I've tested NSIS v3, and the VersionInfo variable that is avariable on the example files is not working.
eliotime3000 is offline   Reply With Quote
Old 10th October 2016, 06:58   #4
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 858
Did you even try !getdllversion?

Example (NSIS 3):
Quote:
Name "get version"
OutFile "get version.exe"

RequestExecutionLevel user

Page instfiles

!getdllversion "$%windir%\explorer.exe" expv_
!echo "!echo: Explorer.exe version is ${expv_1}.${expv_2}.${expv_3}.${expv_4}"

Section one
MessageBox MB_OK "Explorer.exe version is ${expv_1}.${expv_2}.${expv_3}.${expv_4}"
SectionEnd
On my machine this gives: Explorer.exe version is 6.2.14393.206, which is the Windows 10 Anniversary Update version.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 10th October 2016, 12:20   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,701
Quote:
Originally Posted by JasonFriday13 View Post


On my machine this gives: Explorer.exe version is 6.2.14393.206, which is the Windows 10 Anniversary Update version.
Technically not correct, the version should be 10.0.14393.206 but Windows lies even when you try to extract version info from resources these days. Should hopefully not be an issue on files outside %windir%.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th October 2016, 12:34   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,701
Quote:
Originally Posted by eliotime3000 View Post
I've tested NSIS v3, and the VersionInfo variable that is avariable on the example files is not working.
If you believe something is not working then you really should post a small example so we can verify if something is broken or not...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th October 2016, 02:41   #7
eliotime3000
Junior Member
 
Join Date: Oct 2016
Posts: 5
Unhappy

Quote:
Originally Posted by Anders View Post
If you believe something is not working then you really should post a small example so we can verify if something is broken or not...
I'm using the script file named VersionInfo.nsi that is included on NSIS 3.0 final, and the output shows me the following (via HM NIS Edit 2.0.3):

code:
Command line:
"C:\Program Files\NSIS\makensis.exe" /NOTIFYHWND 393820 "C:\Program Files\NSIS\Examples\VersionInfo.nsi"

Processing config: C:\Program Files\NSIS\nsisconf.nsh
Processing script file: "C:\Program Files\NSIS\Examples\VersionInfo.nsi" (ACP)

Processed 1 file, writing output (x86-ansi):

Output: "C:\Program Files\NSIS\Examples\VersionInfo.exe"
Can't open output file
Error - aborting creation process



I don't understand why the compiling engine does not generate the installer with the VersionInfo variables.
eliotime3000 is offline   Reply With Quote
Old 11th October 2016, 03:52   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,701
I was a bit confused since you started off by linking to something on the wiki and now you are talking about something that ships with NSIS.

Now that you have posted the compiler output we can finally get somewhere. The compiler is telling you exactly what the problem is:


Quote:
Originally Posted by eliotime3000 View Post
I'm using the script file named VersionInfo.nsi that is included on NSIS 3.0 final, and the output shows me the following (via HM NIS Edit 2.0.3):

code:
Output: "C:\Program Files\NSIS\Examples\VersionInfo.exe"
Can't open output file
Error - aborting creation process

This happens if you install NSIS in a directory where you don't have write access.

You can:

A) Give everyone write permission to the Examples directory

or

B) Copy the .nsi to somewhere you have write access

or

C) Copy the code you need and paste it into your own .nsi

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th October 2016, 05:05   #9
eliotime3000
Junior Member
 
Join Date: Oct 2016
Posts: 5
1.- Solved the Issue of the example code. Now i'm trying to solve the problem that I have with the usage of the VersionInfo on my NSI script. The simplest solution was simply skip the following line:

code:
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"


And just paste (and edit) the rest of the script:

code:
;Version Information

VIProductVersion "1.2.3.4"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Test Application"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A test comment"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Fake company"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Test Application is a trademark of Fake company"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright Fake company"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Test Application"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.2.3"



Thanks a lot. And I apologize by claim about NSIS 3.0 release.
eliotime3000 is offline   Reply With Quote
Old 11th October 2016, 05:46   #10
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,701
Quote:
Originally Posted by eliotime3000 View Post
Now i'm trying to solve the problem that I have with the usage of the VersionInfo on my NSI script. The simplest solution was simply skip the following line:

code:
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
And you failed to post compiler error/warnings again! My guess is that you are using MUI or something else that already loaded the language file. The language file is only loaded in that example so LANG_ENGLISH is defined to the correct language code...

IntOp $PostCount $PostCount + 1
Anders 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