Coder Social home page Coder Social logo

springborland / salt-windows-msi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saltstack/salt-windows-msi

0.0 0.0 0.0 979 KB

Windows MSI installer build toolkit

License: Apache License 2.0

C# 54.16% XSLT 3.64% Batchfile 12.88% PowerShell 17.40% Python 11.92%

salt-windows-msi's Introduction

Windows MSI installer build toolkit

This creates a Salt Minion msi installer using WiX.

The focus is on unattended install.

Introduction

On Windows installers

An msi installer allows unattended/silent installations, meaning without opening any window, while still providing customized values for e.g. master hostname, minion id, installation path, using the following generic command:

msiexec /i *.msi PROPERTY1=VALUE1 PROPERTY2=VALUE2 PROPERTY3="VALUE3a and 3b" PROPERTY4=""

Values must be quoted when they contains whitespace, or to unset a property, as in PROPERTY4=""

Example: Set the master:

msiexec /i *.msi MASTER=salt2

Example: set the master and its key:

msiexec /i *.msi MASTER=salt2 MASTER_KEY=MIIBIjA...2QIDAQAB

Example: uninstall and remove configuration

MsiExec.exe /X *.msi REMOVE_CONFIG=1

Features

  • Creates a very verbose log file, by default %TEMP%\MSIxxxxx.LOG, where xxxxx are 5 random lowercase letters or numbers. The name of the log can be specified with msiexec /log example.log
  • Upgrades NSIS installations UNDER REVIEW

Salt Minion-specific and generic msi-properties:

Property Default Comment
MASTER salt The master (name or IP). Only a single master.
MASTER_KEY The master public key. See below.
MINION_ID Hostname The minion id.
MINION_CONFIG Content to be written to the minion config file. See below.
START_MINION 1 Set to "" to prevent the start of the salt-minion service.
REMOVE_CONFIG Set to 1 to remove configuration on uninstall. ONLY FROM COMMANDLINE
CONFIG_TYPE Existing Or Custom or Default. See below.
CUSTOM_CONFIG Name of a custom config file in the same path as the installer or full path. Requires CONFIG_TYPE=Custom. ONLY FROM COMMANDLINE
INSTALLFOLDER C:\salt\ Where to install the Minion DO NOT CHANGE (yet) --- BLOCKED BY issue#38430
ARPSYSTEMCOMPONENT Set to 1 to hide "Salt Minion" in "Programs and Features".

Master and id are read from file C:\salt\conf\minion

You can set a new master with MASTER.

You can set a new master public key with MASTER_KEY, after you converted it into one line like so:

  • Remove the first and the last line (-----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY-----).
  • Remove linebreaks.

MINION_CONFIG

If MINION_CONFIG is set:

  • Its content is written to file c:\salt\conf\minion, with ^ replaced by line breaks,
  • all minion.d\*.conf files are deleted,
  • the minion_id file is deleted.

Example MINION_CONFIG="master: Anna^id: Ben" results in:

master: Anna
id: Ben

CONFIG_TYPE

There are 3 scenarios the installer tries to account for:

  1. existing-config (default)
  2. custom-config
  3. default-config

Existing

This setting makes no changes to the existing config and just upgrades/downgrades salt. Makes for easy upgrades. Just run the installer with a silent option. If there is no existing config, then the default is used and master and minion id are applied if passed.

Custom

This setting will lay down a custom config passed via the command line. Since we want to make sure the custom config is applied correctly, we'll need to back up any existing config.

  1. minion config renamed to minion-<timestamp>.bak
  2. minion_id file renamed to minion_id-<timestamp>.bak
  3. minion.d directory renamed to minion.d-<timestamp>.bak Then the custom config is laid down by the installer... and master and minion id should be applied to the custom config if passed.

Default

This setting will reset config to be the default config contained in the pkg. Therefore, all existing config files should be backed up

  1. minion config renamed to minion-<timestamp>.bak
  2. minion_id file renamed to minion_id-<timestamp>.bak
  3. minion.d directory renamed to minion.d-<timestamp>.bak Then the default config file is laid down by the installer... settings for master and minion id should be applied to the default config if passed

Client requirements

  • Windows 7 (for workstations), Server 2012 (for domain controllers), or higher.

salt-windows-msi's People

Contributors

marbx avatar twangboy avatar utahdave avatar xeacott avatar berkut-174 avatar mcd1992 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.