Old 12th July 2011, 16:49   #1
Junior Member
Join Date: Jul 2011
Posts: 1
MUI + InstType and silent install

I have created an installer that uses MUI and has several InstTypes. It works great.

I now have the need to automate the deployment across several hundred hosts and would like to use the silent install option, but I'm having trouble.

I was hoping that I could just run it from the command line like this:
myinstaller.exe /S /InstType="Some Platform"

That doesn't work. The correct sections are not selected.

Can someone tell me how to pass the InstType in on the command line?
dwatrous is offline   Reply With Quote
Old 13th July 2011, 06:40   #2
Major Dude
Join Date: Oct 2006
Posts: 1,892
It's all in the manual: http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.11

You can use the macros in sections.nsh to toggle (enable/disable) sections, depending on the paramaters supplied to the installer. You can do this in the .onInit function.
MSG is offline   Reply With Quote
Old 27th January 2021, 16:41   #3
Junior Member
Join Date: Jan 2021
Posts: 2
select Install Type from cmd line

I have prepared project using InstType, this works fine...but how can you set(select) InstType from command line? is this possible?

yes i could GetParameters and GetOptions...but that kinda defeats the full convenience of using InstType.

InstType(Install Type) should be able to be set from cmd line as a built-in switch.

why build a bridge that goes 99% across the river, you need 100%
Mupp is offline   Reply With Quote
Old 27th January 2021, 19:22   #4
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,542
Originally Posted by Mupp View Post
why build a bridge that goes 99% across the river, you need 100%
There is a issue with languages here. Languages are not loaded in .onInit so a automatic solution is not possible for all languages.

With a little work on your part you can do it, all you need is GetOptions and SetCurInstType .

If you only have a single language or only care about the default language:

PHP Code:
!include LogicLib.nsh
!include FileFunc.nsh

Function SetInstTypeByName
$1 0
InstTypeGetText $$2
${If} $!= ""
${AndIf} $== $3
IntOp $$1
"" loop

Function .onInit
${GetOptions$R0 /INSTTYPE= $0
Call SetInstTypeByName
With multiple languages you need to do some manual labor. I'm sure you can automate most of it with clever use of the pre-processor and a macro for InstType creation.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

insttype, mui, silent

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