Skip to content
⌘ NSIS Forum Archive

NSIS 3.0b1 stubs not found

13 posts

scarney#

NSIS 3.0b1 stubs not found

All,

We are building installers from the command line using makensis.
  1. When I use the GUI to build an installer, the compiler finds all the plugins and includes.
  2. When I run makensis from the command line, I have no such luck.
  3. I was able to 'solve' the problem by making symlinks to ${NSISDIR}\Includes, etc into the directory where my .nsi file is.
  4. The .nsi files have syntax such as !include "MUI2.nsh"
  5. When I run makensis, from the command line, the complaint is 'Error: opening stub "D:\Perforce\scarney_devsyswin2008_SJMconnectwm11_dev\Windows\NSIS Installer\Stubs\zlib-x86-ansi". It is looking for this 'Stubs' directory in the same location as the .nsi file.
  6. I tried invoking makensis with a fully rooted pathname to no avail.
  7. Is the solution to execute 'file' commands inside the script?
  8. There doesn't seem to be a way to tell it where the 'Stubs' directory is.


Any pointers as to what I am doing wrong would be greatly appreciated.

--
Regards,
Sandra Carney
Anders#
This is not related to the problem is this thread. Anyway, we would need some more information like the NSIS version and the commandline you used...
scarney#
Update to last post

All,

I am down to making symlinks to two directories, 'Stubs' and 'Contrib'. All the rest, I could get around it by adding the following to my .nsi file:

!addincludedir "C:\Program Files (x86)\NSIS\Include"
!addincludedir "C:\Program Files (x86)\NSIS\Contrib"
!addincludedir "C:\Program Files (x86)\NSIS\Contrib\Modern UI 2"
!addincludedir "C:\Program Files (x86)\NSIS\Contrib\zip2exe"
!addincludedir "C:\Program Files (x86)\NSIS\Contrib\Examples\System"
!addincludedir "C:\Program Files (x86)\NSIS\Contrib\Language files"
!addincludedir "C:\Program Files (x86)\NSIS"
!addplugindir "C:\Program Files (x86)\NSIS\Plugins"
!addplugindir "C:\Program Files (x86)\NSIS\Bin"
!addplugindir "C:\Program Files (x86)\NSIS\Plugins\x86-ansi"
!addplugindir "C:\Program Files (x86)\NSIS\Examples\System"

This is all prototype code and the hard-coded path would be replaced by a define. :This makes no sense to me. Is there a config file that I need to load to tell makensis where it's own includes are?

Is that what 'nsisconf.nsh' is for? Do I bring that in alongside my .nsi file and define all of these paths in there?

--
Regards,
Sandra Carney
Anders#
You are not supposed to create any symlinks/junctions. You should be able to execute "C:\Program Files (x86)\NSIS\makensis.exe" "C:\Program Files (x86)\NSIS\Contrib\Examples\Example1.nsi" from any directory.

Have you tried re-installing NSIS?

Which NSIS version are you using, 2.46 or 3.0b1?
scarney#
Anders,

I can move it to the appropriate thread or should I start a new one?
Version: 3.0b1
OS: Windows Server 2008 R2

I got further by putting things in the 'nsisconf.nsh' file. All the !addinclude lines are moved to that. I now use a define to specify the root of the NullSoft installation.

I am doing this in a batch script.

Commandline: makensis.exe /V4 /O"D:\path\to\logfile" /DSJMNSISDIR="C:\Program Files (x86)\NSIS" "D:\path\to\NSIS Installer\myscript.nsi"
Anders#
You are not supposed to change 'nsisconf.nsh' to make basic scripts work. Example1.nsi should compile out of the box:

C:\Users\Anders>"c:\Program Files (x86)\NSIS\makensis.exe" /V4 /O"%temp%\temp.log" /Dfoo="bar" "c:\Program Files (x86)\NSIS\Examples\example1.nsi"

C:\Users\Anders>type "%temp%\temp.log"
MakeNSIS v3.0b1 - Copyright 1999-2014 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

Command line defined: "foo=bar"
Processing config: c:\Program Files (x86)\NSIS\nsisconf.nsh
Processing default plugins: "c:\Program Files (x86)\NSIS\Plugins
\x86-ansi\*.dll"
+ Banner::destroy
..snipped..
+ splash::show

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "c:\Program Files (x86)\NSIS\Examples"

Processing script file: "c:\Program Files (x86)\NSIS\Examples\example1.nsi" (ACP)
Name: "Example1"
OutFile: "example1.exe"
InstallDir: "$DESKTOP\Example1"
Page: directory
Page: instfiles
Section: ""
SetOutPath: "$INSTDIR"
File: "example1.nsi" [compress] 433/908 bytes
SectionEnd

Processed 1 file, writing output (x86-ansi):
Processing pages... Done!
Removing unused resources... Done!
Generating language tables... Done!

Output: "c:\Program Files (x86)\NSIS\Examples\example1.exe"
Install: 2 pages (128 bytes), 1 section (2072 bytes), 3 instructions (84 bytes), 44 strings (866 bytes), 1 language table (230 bytes).

Using zlib compression.

EXE header size: 34304 / 35840 bytes
Install code: 832 / 2748 bytes
Install data: 437 / 912 bytes
CRC (0xF07F857B): 4 / 4 bytes

Total size: 35577 / 39504 bytes (90.0%)

C:\Users\Anders>
And a batch file also works:
@echo off
cd "c:\Program Files (x86)\NSIS"
makensis.exe /V4 /O"%temp%\temp.log" /Dfoo="bar" "c:\Program Files (x86)\NSIS\Examples\example1.nsi"
type "%temp%\temp.log"
Please try to duplicate my results, if that fails, try NSIS v2.46...
scarney#
Duplication of your results failed

Anders,

Tried
"C:\Program Files (x86)\NSIS\makensis.exe" "C:\Program Files (x86)\NSIS\Examples\example1.nsi"

with the following result:

Error: opening stub "D:\Perforce\scarney_devsyswin2008_SJMconnectwm11_dev\Windows\NSIS Installer\Stubs\zlib-x86-ansi"

Installing v.2.46 and trying that. Will get back to you.

--
Regards,
Sandra Carney
scarney#
Anders,

Installed v.2.46 and I could compile the example. However, when I try to build the installer from my script, I run into the same problem.

Looks like there was a problem with the install and there is a problem with the script. I will keep digging tomorrow.

So if makensis is looking in the directory where the .nsi script is for 'Stubs' instead of in the directory where makensis.exe is, does that mean my installation is hosed?

I tried setting NSISDIR in the environment and it doesn't matter.
Anders#
If %NSISDIR% is set, makensis will look in %NSISDIR%\Stubs, otherwise it removes the filename from the argv[0] main() parameter GetModuleFileName(NULL,...) and uses that.

What is "D:\Perforce\scarney_devsyswin2008_SJMconnectwm11_dev\Windows\NSIS Installer", is your .nsi located there?
scarney#
Anders,

I got it working. I had been futzing around in the .nsi script which, BTW, is located in "D:\Perforce\scarney_devsyswin2008_SJMconnectwm11_dev\Windows\NSIS Installer".

I reverted it and everything works now.

BTW, running the v.3.0b1 makensis on the same unmodified .nsi script didn't help.

I looked through the Windows logs and didn't see anything.

Should I try reinstalling v.3.0b1 to see if I can make it work?

--
Regards,
Sandra Carney
scarney#
Anders,

This time, I logged onto the system as 'Administrator', uninstalled 2.46. Installed 3.0b1. Logged out. Logged back in as me. Now it runs.

Before, I was logging in as me. I have admin rights so I was doing a 'runas' to run the setup.

I think I just needed to be logged in as Administrator.

Now all is well.

--
Regards,
Sandra Carney
JasonFriday13#
FYI, the nsis installer should automatically prompt for admin rights, you shouldn't have to use 'run as' for the setup program. Something else is going on.