Kaseya Community

Firefox- script to install an extension (specifically AU dictionary)

  • Does anyone have any scripts that could point me in the right direction? We've scripted the slient deployment of Firefox- but we need to add the Australian Spelling Dictionary extension. Does anyone have anything?

    Thanks
    Damien

    Legacy Forum Name: Firefox- script to install an extension (specifically AU dictionary),
    Legacy Posted By Username: CORDPG
  • This doesn't use any new K2 procedure features, but I created this with a prospect a year ago when he wanted to know if we could do it... just import this as a folder into k2:

    <?xml version="1.0" encoding="utf-8"?>
    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">
      <Folder name="Firefox Plugin" treePres="3">
        <Procedure name="Deploy Firefox Plugin - Step 1a - Check User " treePres="3">
          <Body description="">
            <If description="">
              <Condition name="UserIsLoggedIn">
                <Parameter xsi:type="StringParameter" name="UserName" value="" />
              </Condition>
              <Then>
                <Statement name="ExecuteScript" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="ScriptID" value="51079646" />
                  <Parameter xsi:type="StringParameter" name="ScriptName" value="Deploy Firefox Plugin - Step 1b - Query User" />
                  <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                  <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
                </Statement>
              </Then>
              <Else>
                <Statement name="ExecuteScript" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="ScriptID" value="51220992" />
                  <Parameter xsi:type="StringParameter" name="ScriptName" value="Deploy Firefox Plugin - Step 1c - Check OS " />
                  <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                  <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
                </Statement>
              </Else>
            </If>
          </Body>
        </Procedure>
        <Procedure name="Deploy Firefox Plugin - Step 1b - Query User" treePres="3">
          <Body description="">
            <If description="">
              <Condition name="UserResponseIsYes">
                <Parameter xsi:type="StringParameter" name="Message" value="Firefox must be closed to install a necessary plugin. Continue now? " />
                <Parameter xsi:type="IntegerParameter" name="Timeout" value="1" />
              </Condition>
              <Then>
                <Statement name="ExecuteScript" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="ScriptID" value="51220992" />
                  <Parameter xsi:type="StringParameter" name="ScriptName" value="Deploy Firefox Plugin - Step 1c - Check OS " />
                  <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                  <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
                </Statement>
              </Then>
              <Else>
                <Statement name="ScheduleScript" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="ScriptName" value="51079646" />
                  <Parameter xsi:type="StringParameter" name="TimeDelay" value="60" />
                  <Parameter xsi:type="StringParameter" name="MachineID" value="#vMachine.Machine_GroupID#" />
                </Statement>
              </Else>
            </If>
          </Body>
        </Procedure>
        <Procedure name="Deploy Firefox Plugin - Step 1c - Check OS " treePres="3">
          <Body description="">
            <If description="">
              <Condition name="CheckRegistryValue">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\Identifier" />
                <Parameter xsi:type="EnumParameter" name="Condition" value="Contains" />
                <Parameter xsi:type="StringParameter" name="Value" value="x86" />
              </Condition>
              <Then>
                <Statement name="ExecuteScript" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="ScriptID" value="63709726" />
                  <Parameter xsi:type="StringParameter" name="ScriptName" value="Deploy Firefox Plugin - Step 2a - 32-bit" />
                  <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                  <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
                </Statement>
              </Then>
              <Else>
                <Statement name="ExecuteScript" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="ScriptID" value="26746586" />
                  <Parameter xsi:type="StringParameter" name="ScriptName" value="Deploy Firefox Plugin - Step 2b - 64-bit" />
                  <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                  <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
                </Statement>
              </Else>
            </If>
          </Body>
        </Procedure>
        <Procedure name="Deploy Firefox Plugin - Step 2a - 32-bit" treePres="3">
          <Body description="Deploy Firefox Plugin&#xA;&#xA;Benjamin Lavalley, Sr. Sales Engineer, Kaseya&#xA;">
            <If description="Deploy Firefox Plugin&#xA;&#xA;Benjamin Lavalley, Sr. Sales Engineer, Kaseya&#xA;">
              <Condition name="TestFile">
                <Parameter xsi:type="StringParameter" name="Path" value="%programfiles%\mozilla firefox\extensions\{0fa2149e-bb2c-4ac2-a8d3-479599819475}\install.rdf" />
                <Parameter xsi:type="EnumParameter" name="Condition" value="DoesNotContain" />
                <Parameter xsi:type="StringParameter" name="Value" value="em:version=&quot;1.5&quot;" />
              </Condition>
              <Then>
                <Statement name="GetURL" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="URL" value="https://addons.mozilla.org/en-US/firefox/downloads/latest/2871/addon-2871-latest.xpi?src=addondetail" />
                  <Parameter xsi:type="StringParameter" name="ResponseFileName" value="#vAgentConfiguration.AgentTempDir#\urlfixer.xpi" />
                  <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />
                </Statement>
                <Statement name="ExecuteShellCommand" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="Command" value="tskill /a firefox" />
                  <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                  <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                </Statement>
                <Statement name="CloseApplication" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="ApplicationName" value="firefox.exe" />
                </Statement>
                <Statement name="ExecuteShellCommand" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="Command" value="&quot;%programfiles%\mozilla firefox\Firefox.exe&quot; -install-global-extension &quot;#vAgentConfiguration.AgentTempDir#\urlfixer.xpi&quot;" />
                  <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                  <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                </Statement>
                <Statement name="PauseScript" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="IntegerParameter" name="Seconds" value="5" />
                </Statement>
                <Statement name="ExecuteFile" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="Path" value="%programfiles%\mozilla firefox\Firefox.exe" />
                  <Parameter xsi:type="StringParameter" name="Arguments" value="" />
                  <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                  <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />
                </Statement>
                <Statement name="PauseScript" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="IntegerParameter" name="Seconds" value="3" />
                </Statement>
                <Statement name="GetVariable" continueOnFail="false" osType="None">
                  <Parameter xsi:type="EnumParameter" name="VariableType" value="FileContent" />
                  <Parameter xsi:type="StringParameter" name="SourceContent" value="%programfiles%\mozilla firefox\extensions\{dc572301-7619-498c-a57d-39143191b318}\license.txt" />
                  <Parameter xsi:type="StringParameter" name="VariableName" value="tmpinstalled" />
                </Statement>
                <Statement name="WriteScriptLogEntry" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="Comment" value="URL Fixer Installed for 32-bit" />
                </Statement>
              </Then>
              <Else>
                <Statement name="WriteScriptLogEntry" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="Comment" value="URL Fixer Already present" />
                </Statement>
              </Else>
            </If>
          </Body>
        </Procedure>
        <Procedure name="Deploy Firefox Plugin - Step 2b - 64-bit" treePres="3">
          <Body description="For some reason it appears that the firefox.exe binary does not run correctly on a 64-bit system. The most we can do here is copy the XPI extension file into the extensions folder. This will prompt the user to install the extension when they next load firefox. &#xA;">
            <If description="For some reason it appears that the firefox.exe binary does not run correctly on a 64-bit system. The most we can do here is copy the XPI extension file into the extensions folder. This will prompt the user to install the extension when they next load firefox. &#xA;">
              <Condition name="TestFile">
                <Parameter xsi:type="StringParameter" name="Path" value="C:\program files (x86)\mozilla firefox\extensions\{0fa2149e-bb2c-4ac2-a8d3-479599819475}\install.rdf" />
                <Parameter xsi:type="EnumParameter" name="Condition" value="DoesNotContain" />
                <Parameter xsi:type="StringParameter" name="Value" value="em:version=&quot;1.5&quot;" />
              </Condition>
              <Then>
                <Statement name="GetURL" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="URL" value="https://addons.mozilla.org/en-US/firefox/downloads/latest/2871/addon-2871-latest.xpi?src=addondetail" />
                  <Parameter xsi:type="StringParameter" name="ResponseFileName" value="#vAgentConfiguration.AgentTempDir#\urlfixer.xpi" />
                  <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />
                </Statement>
                <Statement name="ExecuteShellCommand" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="Command" value="copy /y &quot;#vAgentConfiguration.AgentTempDir#\urlfixer.xpi&quot; &quot;c:\program files (x86)\Mozilla Firefox\extensions&quot;" />
                  <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                  <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                </Statement>
                <Statement name="WriteScriptLogEntry" continueOnFail="false" osType="Windows">
                  <Parameter xsi:type="StringParameter" name="Comment" value="URL Fixer installed for 64-bit " />
                </Statement>
              </Then>
              <Else>
                <Statement name="WriteScriptLogEntry">
                  <Parameter xsi:type="StringParameter" name="Comment" value="URL Fixer already installed" />
                </Statement>
              </Else>
            </If>
          </Body>
        </Procedure>
      </Folder>
    </ScriptExport>


    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: Benjamin.Lavalley@kaseya.com



    [edited by: Brendan Cosgrove at 5:47 PM (GMT -8) on 12-20-2010] .
  • Thankyou very much- this should give me something to start with.

    Appreciate it.

    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: CORDPG
  • i am sorry to re open this but could you make an example on https://automationexchange.kaseya.com/ so if others would like to do this they could.

    thank you