Windows silent with command line

Hi !

Can anyone help me to know how to install through Windows terminal (cmd) with command line ?
I manage to found the command “\S” for silent install but I also need to add a shortuct icon option on the desktop, all user install and PATH add.

Thank you for your attention.

The current installer uses NSIS and I don’t use Windows, so I can’t say I know. Certainly the default would be to add for all users in Program Files.

If you’re willing to test a different installer, I can try building an MSI installer if that’s likely to be easier for your purposes.

Hi !

Thank you for your answer.

Yes indeed, I saw the Nullsoft Scriptable Install System banner when it started on Windows but none of the classic command works… except the /S command but in this case I don’t have any desktop shortcut. Having a MSI installer isn’t the solution for my issue, I guess, unless the desktop option is already checked. The best is to have the choice like other classical NSIS app.

Also, there is an option to register Avogadro2 in the system PATH, it could be useful to add a special command line. For example, LatisPro has a command name /SERIALLTP=LTP-###-###-### for adding a serial key or /COMPONENTS="#######" for addingg special components.

As I said, I don’t use Windows… but it seems like we have a few options to tweak the installer. I think you’re saying you’d like:

  • Extra page to set the system PATH
  • Add the icon to the desktop (which I think is the same extra page)

Is that it? I think that should be a pretty easy tweak for the next nightly build.

There’s no need for a serial key - Avogadro is open source. An option to add components / plugins from the command-line does sound like a good idea.

I’ll make sure the change to avogadroapp gets linked to the issue report you opened. That should let you test it.

Actually, I just went to tweak the ‘modify path’ setting and it’s already there.
CPACK_NSIS_MODIFY_PATH ON

So I guess my question (not using Windows) - does this not work for you?

There’s already those two extra page in fact !
I’m asking about silent install. For that, I open a terminal and tape :

// Go to the script location :
cd /d “%~dp0”
echo Installing Avogadro2…
Avogadro2-1.99.exe /ALLUSERS /S

The question is, how, with command line, add a desktop icon ?

Thank you for the CPACK_NSIS_MODIFY_PATH, I didn’t know that one ! But it seems no usable with a command line install.
Here what I can see when I lunch manually the .exe installer :

What I need ? The Create Avogadro2 Desktop Icon checked with a command line parameter.

I also checked the NSIS website but nothing about desktop shortucut … Here the link.

Yeah, I understand what you want to do.

But as you linked to the NSIS page - I don’t know how to do that - especially as a non-Windows user.

Wouldn’t it be easier to just create the desktop links from the command-line later after the installer runs? Something like this? How to make a desktop shortcut available for all users in Windows 10 - Super User

1 Like

Actually I already have something like that :

echo Making shortcut for Avogadro2...
powershell "$WScriptShell = New-Object -ComObject WScript.Shell; 
$Shortcut = $WScriptShell.CreateShortcut('C:\Users\Public\Desktop\Avogadro2.lnk'); 
$Shortcut.TargetPath = 'C:\Program Files\Avogadro2\bin\avogadro2.exe'; 
$Shortcut.Save()"
echo Shortcut Avogadro2 added
echo --------------------------------------------------

However, there’s always the PATH parameter to config … It’d be so much easier to just add a parameter like \S !

1 Like

Do you have an example of another open source program that you install in this way that similarly provides command line options for the Windows installer? Then we could at least look into how they do it :slight_smile:

I think Python 3 is a great example ! Or 7-Zip.

1 Like

I can’t find the 7-Zip installer source, but mentioning Python turned up this:
https://pypi.org/project/pynsist/

It seems like many projects have their own NSIS configuration file, which may be the way to go. Currently we use cpack to generate the NSIS installer on-the-fly.

One benefit, judging from the Pynsist examples is that we could provide an installer with Python included.

Incidentally, have you tried VTK or Paraview? They use cpack to build their installers - I don’t know if they have the same problem.