GoogleCloudPlatform / osconfig

Apache License 2.0
85 stars 101 forks source link

Wrong order of default installation parameters for msiexec #654

Open dryzhov opened 1 month ago

dryzhov commented 1 month ago

Steps to reproduce:

  1. create software installation recipe without definition of flags
  2. launch recipe

Result: msiexec dialog window with usage information

Expected result: installed msi package

Analyze: Function policies/recipes/steps.go/stepInstallMsi contains code with default msiexec options

    args := step.Flags
    if len(args) == 0 {
        args = []string{"/i", "/qn", "/norestart"}
    }
    args = append(args, path)

where path contain full path to *.msi file

By msiexec documentation parameter /i must contain value - package or product code. Then code may look like this:

    args := step.Flags
    if len(args) == 0 {
        args = []string{"/qn", "/norestart", "/i"}
    }
    args = append(args, path)