InstallationCheck strings not working

stevenjklein
Contributor II

I'm getting ready to push an install of an updated version of our VPN client.

Obviously I don't want to interrupt any currently connected users.

So I've used Composer to add an InstallationCheck script to check for active VPN connections. if it finds any it exits with error 112. The same script includes this line:

exit 112    ## Stop the installation with Message "16" from InstallationCheck.strings

And I've created an InstallationCheck.strings file with this:

"16" = "You have an Active VPN session. Please disconnect from VPN and try again."

I've tried testing with an active VPN session, expecting to see my error message, but instead I see this:
"The specified message could not be found for the index 16."

Any ideas on what I'm doing wrong, and how to fix it?

2 REPLIES 2

mike_paul
Contributor III
Contributor III

I imagine you are building your PKG as a flat PKG (default settings for pkgs these days) and flat PKGs only support preinstall and postinstall scripts.

Composer yells about it If you try to build a PKG with preflight or postflight with the following error: "Unsupported Script for flat package: The "Build flat PKGs" option is selected, and this package source includes scripts that are not supported for flat PKGs (preflight, postflight). You may choose to build as a flat PKG anyway (unsupported scripts will be ignored), build as a non-flat PKG, or cancel."

Im not sure why it doesnt give an error for the installationcheck script type but it does state it at the top of the script in the comments, "Not supported for flat packages"

You can change the build type if you go to Composer > Preferences > and uncheck "Build Flat Packages" or add a preflight/postflight script to the package and choose the option to build as non-flat when prompted.

stevenjklein
Contributor II

Thanks for taking a look, @mike.paul.

But that's not it. It properly prompted me like this:

0f95bfac68c24932a190f1c80b42f716

I chose Build as non-flat PKG, but it didn't help.

I also went into preferences and unchecked Built flat PKGs, but it still made no difference. Same error.