Skip to main content

Hi. I’m having an error when create a software policy. 

 

"Error: The installation code is required."

 

What’s causing this issue?

Hi @jaykim!

 

Required Software Policies have the following mandatory fields that must be completed before you are able to upload your installation media to the Payload.

  1. Policy Name
  2. Package Name
  3. Package Version
  4. Installation Code

If you are receiving an "Error: The installation code is required.", you’ll want to make sure you add your install code to the script block before attempting to upload the installation media.

 

Here is are some examples of what the code may look like depending on your installation media:

 

EXE Install:

Start-Process -FilePath "appname.exe" -argumentlist "/silent /noreboot" -Verbose

 

MSI Install:

exit (Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '"appname.msi"') -Wait -Passthru).ExitCode

 

Note: you’ll want to ensure that appname.exe or appname.msi is replaced with the name of your installation media.

 

Additionally, for EXE installs, you’ll want to ensure that you are using the vendor’s appropriate silent install switches.  For example: “/silent” may be “/S” depending on the .exe file.

 

When possible, I always recommend using a system-wide MSI installer.  Required Software Policies can ingest the metadata from the MSI file and pre-populate the Package Name, Package Version, and Installation code for you via an override option. 

 

If using an MSI, a quick tip is to populate all of the required fields with placeholder data first so you can select the Upload File button.  When the file completes uploading, you then can select Override, and the fields will be populated with the data from the MSI file:

 

 

Fields are completed via Override option.

 

Again, this trick will only work with MSI files.

 

I hope this help!

 

Have a great day!


Reply