View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012362CMakeCMakepublic2011-07-27 13:052012-03-06 08:37
ReporterChristian Höltje 
Assigned ToDavid Cole 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformanyOSWindowsOS Versionany
Product VersionCMake 2.8.5 
Target VersionFixed in VersionCMake 2.8.7 
Summary0012362: installer has no command line options
DescriptionThe CMake installer (cmake-2.8.5-win32-x86.exe) doesn't take any command line options. It always starts the GUI.

Ideally, there would be a way to specify where to install via the command line so that the install runs "headless" (without GUI).

This is a *must* for installing across large build farms.

Thanks.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0027080)
David Cole (manager)
2011-07-27 13:27

The CMake Win32 installer is built with NSIS, and as such, it supports some of the standard command line arguments that all such NSIS built installers do.

Specifically, you can write a silent automatic install command line like so:

  "C:\full\path\to\cmake-2.8.5-win32-x86.exe" /S /D=C:\path\to\install\to\with\no\spaces

Furthermore, you may silently call the uninstaller like so:

  C:\path\to\install\to\with\no\spaces\Uninstall.exe /S

Importantly, (I've determined this empirically by experiment, so I may be stating things overly strictly here, but I don't think so....) you must have:

- Most importantly, admin privileges -- this needs to be run in a "Run as Admin" type setting, or else Windows will prompt the user to see if it's ok to run an installer/uninstaller

- the "/S" indicates "silent" and means do not show the gui for the installer

- the "/D" must be the last argument you pass to the installer, indicating the root directory into which to install

- Everything after the "/D=" should name the full path to a directory with "\" separator characters, (not with "/") *and* with no spaces in it. It is still possible in Windows to construct a valid 8.3 old-school DOS name for any file or directory, and if you need to install it in a path that does have spaces in it for real, then you'll have to construct the short name equivalent to pass with /D=

This definitely works with CMake 2.8.3 and later, and may work as far back as 2.8.0. (I can't remember when the changes went in to get this to work well, but I'll look it up later and append another note here.)

After reading your bug report, I realized that we have not documented this "feature" on the Windows installer anywhere, and think that this will now be good fodder for a blog entry.

Thanks for the inspiration...
(0027081)
David Cole (manager)
2011-07-27 13:51

In the file "Modules/NSIS.template.in" the variable IS_DEFAULT_INSTALLDIR first appeared in an official release as of CMake 2.8.0.

That's the variable that gives us a heuristic for whether the installer should use the /D argument value or not. Since it first appeared in 2.8.0, you should be able to call any CMake Win32 installer with this silent install technique for 2.8.0 and later.

If you're running as admin, and you can accept the default value for CMake's installation directoy, you can use /S with any version of the CMake Win32 installer.

Let me know if you run into problems using this technique, or if you find any of this information to be invalid.
(0027082)
Christian Höltje (reporter)
2011-07-27 14:07

No problems, that works great.

I'd just suggest adding a /? or /h option (or both) so that I could have figured that out. :-)
(0027083)
David Cole (manager)
2011-07-27 14:51

NSIS generates that executable, so we have no source code for it in the CMake tree. I do not know how to add "/?" or "/h" or "--help" argument handling to this executable...

If anybody else knows how to do that, then please point me to a way to do that.

In the meantime, I'll blog about it, and see if we can't figure out a reasonable place in the CMake documentation to put this information.
(0027650)
David Cole (manager)
2011-10-25 23:55

Blogged about here:

  http://www.kitware.com/blog/home/post/186 [^]

If anybody has a good suggestion about how to better document this feature within the CMake / CPack code itself, please re-open this issue and let us know what your suggestion is.

Thanks.
(0028835)
David Cole (manager)
2012-03-06 08:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-07-27 13:05 Christian Höltje New Issue
2011-07-27 13:11 David Cole Assigned To => David Cole
2011-07-27 13:11 David Cole Status new => assigned
2011-07-27 13:27 David Cole Note Added: 0027080
2011-07-27 13:51 David Cole Note Added: 0027081
2011-07-27 14:07 Christian Höltje Note Added: 0027082
2011-07-27 14:51 David Cole Note Added: 0027083
2011-10-25 23:55 David Cole Note Added: 0027650
2011-10-25 23:55 David Cole Status assigned => resolved
2011-10-25 23:55 David Cole Fixed in Version => CMake 2.8.7
2011-10-25 23:55 David Cole Resolution open => no change required
2012-03-06 08:37 David Cole Note Added: 0028835
2012-03-06 08:37 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team