/build/static/layout/Breadcrumb_cap_w.png

K1000 scripting an .exe installation to use a .reg file afterwords. K1000 does not behave same as doing it manually.

I have only dabbled in scripting before, but now with our K1000 appliance, I am finding the need to script more and more. Problem is, I'm not much of a scripter so I rely on examples and templates heavily, followed by a lot of testing and tweaking afterwords.

My latest issue is with a program called Snare. It is an open source application that resides on a server or desktop to capture relevant application / system logs and then email them out. Very basic install. https://www.intersectalliance.com/our-product/snare-agent/

Now, if i run snare.exe /? , i get a list of commands supported through CLI. The ones i am interested in are /SP- (Disables the "This will install..." window) and /SILENT

If i run this command manually from the location i have the application at, snare.exe /SP- /SILENT , i get a clean install and service running. After this, we run a reg file to import specific keys for the application, then restart the service.Everything is wonderful and great.

I have the .exe and .reg file zipped, and associated with the software within KACE. If i go to scripting, and have it launch an installation package, and point to Snare, and enter the command snare.exe /SP- /SILENT , then remediation i have restart a service, Snare.

It is my understanding, at least with the MSI installer, that if you have a .reg file zipped with the MSI, KACE automatically runs the .reg file after installation. Therefor leaving only the service to be restarted.

If i run this from K1000 Run Now, the installation goes through, but its not the same and the restart service log comes back as "service does not exist"

I check out the device that i pushed it on, and sure enough, there is no start menu folder with the 3 items needed in it, and no services. But if i go to the control panel / programs and features, it is there.

Its very confusing to try to understand that why I can run the installation commands on the device with no issues, but cannot run the exact command from KACE.I've tried to add the ZIP as a dependency, i've tried adding the .reg file by its self as a dependency and I have tried running this install with just the .exe, no reg file associated at all.

On Success

  1. Install “Snare version 4.0.2 (Open Source)” with arguments “SnareForWindows-4.0.2.0-MultiArchOpenSource.exe /SP- /silent”.

Remediation

  1. Restart service “Snare”.

3 Comments   [ + ] Show comments
  • Is the registry installed in user space? - dedenker 9 years ago
  • forgive my ignorance .. not following "installed in user space" - pdsmith_barbnet 9 years ago
  • Try adding ALLUSERS=1 to the MSI install command line options. This will install the app for All Users so you will get the start menu entries at least. Installing with KACE uses a system account and not a user account, so any file or registry entries intended for the user profile are not able to be installed. Recommend checking vendor documentation for any advice on how to install in system context (eg via Microsoft SMS or SCCM) - EdT 9 years ago

Answers (2)

Posted by: stephen_c01 9 years ago
Purple Belt
0
regedit /s regfile.reg if i remember right.
Posted by: chucksteel 9 years ago
Red Belt
0
I don't recommend using the scripting engine to install software, instead you should use a managed installation. In this case you should upload a zip file to the software title containing:
The snare installer
The registry file
An install script (I normally call mine install.bat)

It looks like your install script in this case would be:
snare.exe /SP- /SILENT
regedit.exe /s registryfile.reg


Once that is zipped and uploaded to the software title you can create a managed install. Go to Distribution, in the Choose Action menu select New. Enter a Name (which is actually the notes) and select the software title from the dropdown. Select the radio button for Override default installation and enter the name of your install script (install.bat) and check the box for "Don't prepend msiexec.exe". 

Set the Execution option appropriately and the deployment options for where you want the title to be installed. And save the distribution. The next time the target machines check in they should initiate the installation.


Comments:
  • Thank you for all of that. I will try it out. I am confused regarding when to use scripting, and when not to use scripting. When our KACE engineer was on site, he advised setting up scripts for installations that were for basic installations. For example, a user requesting Java or TeamViewer to be installed right then and there. I have several Managed Installations setup for groups that must have the application regardless if they want it or not, or groups that are supposed to have Office 10 vs Office 13.

    Any way, I appreciate your assistance. I will report back with my results. - pdsmith_barbnet 9 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ