Kaseya Community

Uninstalling a second Kaseya Agent without prompts

This question is not answered

I'm trying to automate the removal of a second Kaseya agent installed on a system. I have the ID of the agent and uninstall command:

"RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{48C76121-4F90-11D5-9884-0050BA85A90}\Setup.exe" UNINSTALL"

My questions is two fold: 

How do I suppress ALL prompts and have it agree to the uninstall? How do I keep the system from rebooting? 

Thanks in advance. 

All Replies
  • Also, is the run dll launch setup option required?

  • Hi CL,

    No the "RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup" part is not needed, The version of the agent you are attemping to uninstall is using an InstallShield setup.exe, and therefore your command line must use InstallShield command line switches and silent install automation conventions.  See unattended.sourceforge.net/installers.php for more information on common installer technologies such as InstallShield.  

    As such, you need an ISS "answer file" that has the various options you want chosen for the various dialogs that would be presented to the end-user if the install/uninstall was not silent.  I've included the contents of a setup.iss that has the various options in it to uninstall the agent and suppress the reboot.  You will need to copy this text (everything between the ------ lines) and save as a text file with an ISS extension, for example c:\uninstall.iss).

    ------

    [InstallShield Silent]
    Version=v6.00.000
    File=Response File
    [File Transfer]
    OverwrittenReadOnly=NoToAll
    [{48C76121-4F90-11D5-9884-0050BA85A903}-DlgOrder]
    Dlg0={48C76121-4F90-11D5-9884-0050BA85A903}-SprintfBox-0
    Count=2
    Dlg1={48C76121-4F90-11D5-9884-0050BA85A903}-SdFinishReboot-0
    [{48C76121-4F90-11D5-9884-0050BA85A903}-SprintfBox-0]
    Result=1
    [Application]
    Name=Kaseya Agent
    Version=5.0.0.0
    Company=Kaseya
    Lang=0009
    [{48C76121-4F90-11D5-9884-0050BA85A903}-SdFinishReboot-0]
    Result=1
    BootOption=0

    ------

    You may need to adjust the [Application] sections Version in this file to match the version you are uninstalling, but it may not really matter.  Alternatively you can create your own ISS file on one machine using the same setup.exe portion of your uninstall command line but tack on the following to the command line:

           /r /f1c:\uninstall.iss

    By tacking on the additional switches, you are telling InstallShield to record (/r) the answers to the dialogs, and write them to the file (/f1) called c:\uninstall.iss.

    Once you have an ISS file you can then upload this ISS file to the Managed Files location on your KServer and use a Write File step in your Agent Procedure to drop the ISS file onto the machine where the uninstall will be taking place.  Then call the setup.exe portion of the command line with the UNINSTALL switch and then put the silent (/s) switch and tell it where the "answer file" is located:

         /s /f1c:\uninstall.iss

    So your new command line would look like:

    "C:\Program Files (x86)\InstallShield Installation Information\{48C76121-4F90-11D5-9884-0050BA85A903}\Setup.exe" UNINSTALL /s /f1c:\uninstall.iss

    Hope this helps,

    Matt Warburton

    Kaseya Professional Services