Archive: Silent Mode Comand Line


Silent Mode Comand Line
Hello

I'm sorry to interrupt this technical discussion about NSIS compiler.

I have a question as a USER of a program distributed using NSIS. (I'm sorry if I am in the writing in the wrong place) .

I want to make a custom CD which will install some applications after the Windows Setup is complete.

So I want to run a kit in silent mode. This works for the Install Shield programs (-r and the -s switch).
But I cannot get it to work for a NSIS kit. (Ex. Divx412codec)

I've tryied /S and /SILENT, after browsing the compiler documentation but it doesn't run in silent mode.

Thansks for your time,

Crisp


Hi Crisp!

After looking into the source and testing on some of my installers I have found out that /S does work.

There are two exceptions:
1) The command line interpretation is case sensitive (/s won't work, only /S)
2) If the compiler which built the installer was a recompiled version of NSIS, it could have NSIS_CONFIG_SILENT_SUPPORT disabled which means you can not run the installer built by it in silent mode.

If you did use /S and not /s I see no other reason of DivX not running in silent mode but a recompiled compiler.

KiCHiK


Hi kichik!

I do run the installer with /S not /s.
So I guess SILENT Suport is disabled, or is an OLD version of NSIS (1.44 i think).
I've also tried the Winamp installation kit and Zoom DVD Player . Still nothing.
I'm definetly doing something wrong here, I don't think everybody disabled SILENT mode ...

Crisp


Hi kichik again !

I've just tested with PowerDivx312 (NSIS 1.60) and it's working ...
Thanks for your time !
So not all the installers that float around support this feature. Too bad.

Anyway, can someone point me to a reference of command-line switches or this is something that depends on how the kit was build ?

Crisp


Crisp,

the reference is:
http://www.nullsoft.com/free/nsis/makensis.htm

Since NSIS is OpenSource everyone can rebuild the project to do specific tasks and hence it's possible that in a custom made setup the /S is not supported.

Good luck,
greetz, Hendri.


Hi Crisp!

According to the version history (quoted below) commmand line options were added in version 1.42...

nsis142.exe (5/6/01)
Made it so that installers can take command line switches: /S (silent), /NCRC (no CRC checking) and /D= (sets output directory). Note that /D= must be the last parameter on the line.
[...]
I have also tested the /S silent switch with an installer I built with NSIS 1.44 and it works.
The only possible reason I can think of is a recompiled NSIS compiler... Sorry.

The only place I know you can find the command line switches in is the source code it self.

KiCHiK

/D command line option doesn't work
>Made it so that installers can take command line switches: /S (silent), / NCRC (no CRC checking) and /D= (sets output directory). Note that /D= must be the last parameter on the line.

I cannot get /D to work.
I executed: ./setup_debug.exe /S /D=./x from a cygwin shell. The program silently installed into the install directory defined in the .nsi file. I tried several values (x, ./x, and \x) for the value of /D, but they were all ignored. And, directory x did exist.


This indeed seems like a bug to me. The /D switch is read and processed before the default installation dir set with InstallDir is read and processed. The later ignores the fact that the first has already set the installation dir.


Oops :(

Sorry about that one, my bad... It does ignore it if an installation directory was given in the command line.

I have looked closer into the code and it seems that the directory validating code expects full path, that is C:\cygwin\x and not ./x or other variations.

Again, I am sorry about this confusion.


I got /D to work using absolute directories. The following commands silently install into c:\x. setup.exe will create x if it doesn't exist.

(From Dos command prompt): setup.exe /S /D=c:\x
(From cygwin shell): ./setup.exe /S /D=c:\\x


/D and quotes
(Using a dev snapshot from 2003-Sep-17)

I was beating my head about using the /D switch in my installer. I thought that the InstallDir and InstallDirRegKey commands were overriding it. It turns out, though, that the /D switch doesn't work if the specified folder has quotes in it, e.g.:

myinstall.exe /S /D="C:\Program Files\testdir"

does not work, but

myinstall.exe /S /D=C:\Program Files\testdir

does work.

Looking at the code in Source\exehead\Main.c, I understand that the /D switch has to be the last one on the command line. But I would like to understand why it can't deal with quoted paths.

-- Tim


If it has to be last then there is no use of quotes. Nothing can come after it, hence spaces won't matter.


loop:

Originally posted by kichik
If it has to be last then there is no use of quotes. Nothing can come after it, hence spaces won't matter.
And of course, since it can't handle a quoted argument, it has to be the last thing on the command line so it can accept paths with embedded spaces.

Goto loop

(I'm afraid this is going to turn into a circular conversation...)

Okay, I'll just have to accept that's the way it is. I, personally, found it confusing, since I quote long file names out of habit. (And I'm not yet familiar enough with the NSIS docs to find a reference that says to avoid using quotes with /D.) I suppose it saves some code space in the installer runtime.

-- Tim

I'm afraid that part is not very well documented. But this thread pretty much coveres it all.