MSIExec Commands

MSIExec commands allow installing, patching or removing packages silently. Here is a little memo with the most used command.   Install MSI %systemroot%\system32\msiexec.exe -I “C:\PackageFolder\setup.msi” /qn /L*xv “C:\LogFolder\install_msi.log”   Install MSI transformed by MST %systemroot%\system32\msiexec.exe -I “C:\PackageFolder\setup.msi” TRANSFORMS=”C:\PackageFolder\setup.mst” /qn /L*xv “C:\LogFolder\install_msi.log”   Install MSP %systemroot%\system32\msiexec.exe -P “C:\PackageFolder\patch.msp” /qn /L*xv “C:\LogFolder\patch_msp.log”   Uninstall MSI %systemroot%\system32\msiexec.exe -X … Read more

Remove Certificates using PowerShell

1. Process This article details the way to remove certificates using PowerShell. The Cmdlet used to delete certificates is Remove-Item   Let’s take for example the following certificate: SCOM-ECO.   To check if the certificate is present in the store of the machine:           Launch the PowerShell Console.       … Read more

MSI Properties

MSI Properties are global variables used by Windows Installer during an installation. . MSDN Link : http://msdn.microsoft.com/en-us/library/windows/desktop/aa370905.aspx     ADDLOCAL The value of the ADDLOCAL property is a list of features that are delimited by commas, and are to be installed locally. ADDLOCAL=ALL means that all features will be installed.     ALLUSERS The ALLUSERS property configures … Read more

Issetupdriven

Some manufacturers provide MSI embedded in EXE file. To package such an application, it’s always better to extract the MSI (with 7-Zip for example) and use it instead of using the silent install command (usually a wrapper) of the exe file. The problem is that sometimes the MSI cannot be launched without the original exe. … Read more

Packaging Drivers

This article details the way to package drivers. . 1. Repackaging Method Generally, a driver contains: INF files PNF files DLL files Registry entries in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum It’s possible to make a capture of the installation, but take care of excluded elements after snapshot. By default, Wise Package Studio excludes registry entries in: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum Those registry … Read more

Export Security Settings

This article details the way to retrieve the security settings of a file or folder in order to implement it in a script. Then, this script can be added in the package using a custom action for example. . 1. Security VBScript To grant permissions on files or folder, the following kind of script can … Read more

Add/Remove Programs and Registry

1. Mandatory Parameters Registry Keys Information displayed in Add/Remove Programs are stored in registry: [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My_Application_Flag] Where “My_Application_Flag” can be the product code or the name of the application . Mandatory Values To create an entry in Add/Remove Programs, 3 values are mandatory: DisplayName: The name of the application InstallLocation: The install directory of the application … Read more

Packaging Certificates

Installing a certificate on a machine can be done by running a CER file or by importing a PFX file. . 1. Install CER File To install a certificate with a CER file implemented in a MSI, the Microsoft tool “certmgr” (Certificate Manager Tool), included in Windows must be used. First snapshot Create a folder … Read more

Send Email with PowerShell

The following script allows to send an email in HTML using SMTP with PowerShell. The script does not prompt for credentials (the user account and its according password are set into the script itself). To avoid writing user account and password in the script, Get-Credentials can be used to prompt the user for username and password. … Read more

Starting Runbook with PowerShell

To start an orchestrator runbook with PowerShell, Microsoft provide a reliable script in its MSDN web site. https://msdn.microsoft.com/en-us/library/hh921685.aspx   But, as prerequisite, the script needs the GUIDs for runbook and runbook parameters. There are different ways to find these GUIDs. One of the easier is to use Excel, and more specifically the PowerPivot plugin. Thank … Read more