Installing viscosity via command line

Got a problem with Viscosity or need help? Ask here!

skerbel

Posts: 1
Joined: Mon Aug 21, 2017 3:21 am

Post by skerbel » Mon Aug 21, 2017 3:26 am
Hello all!

I'm trying to build a script that will automate setup of a few steps that I normally do when building machines for deployment. I have built a package of Viscosity for deployment using these instructions:

https://www.sparklabs.com/support/kb/ar ... ences-mac/

And the package installs successfully with preconfigured connections and license when I run the installer by double clicking the package as usual and following the prompts.

However, when I try to install it via the terminal, e.g. :
sudo installer -pkg /path/to/Viscosity.pkg -target /

It says it runs successfully, and Viscosity is indeed installed, and even licensed, but the two preconfigured connections don't show up.

I'm wondering if anyone's run into this before. Is it how the package is built? Is it just not possible?

Thanks for any help you can give.

James

User avatar
Posts: 2313
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Wed Aug 23, 2017 7:42 pm
Hi skerbel,

Viscosity stores connection data on a per-user-account basis, so depending on how the installer is being run it's possible this data may be getting deployed to the wrong user (such as the root user, or the user the installer is being run as).

After running the installer (but before running Viscosity) I'd recommend checking Viscosity's Application Support directory for the user you're trying to deploy to (located at ~/Library/Application Support/Viscosity) and look for a "Preconfigure" directory. Please note that that's the Library folder in the user's profile folder (rather than the global Library folder). If the installer has processed the bundle correctly you should see a Preconfigure directory with a similar layout to the one used when creating the bundle. If there is no Preconfigure directory it likely means it has been deployed to another user.

Another approach you could potentially take to automate install is to copy the Viscosity application and Preconfigure directory into place yourself, and then run the following command to install the helper tool (these are essentially the same steps as what the template bundle installer is performing):
sudo /Applications/Viscosity.app/Contents/MacOS/Viscosity -installHelperTool YES
Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs
2 posts Page 1 of 1