EM Agent install fails with "Error code 0x65B: Function failed during execution" in the MSI log

Version 6

    Verified Product Versions

    Environment Manager 10.0Environment Manager 10.1Environment Manager 8.6


    When trying to install the Environment Manager Agent manually via its MSI you see it rolling back the install and it fails with a "setup was interrupted" message. You may also see the Agent fail to install in the Management Center with the code 1603 though to confirm the following behaviour you will need to try using the MSI.



    Gathering an MSI log of the install can reveal a bit more information. To do this you can use a command similar to the following which gathers a log for a 64 bit agent install:

    msiexec.exe /i <location_of_agent>\EnvironmentManagerAgent64.msi /L*V <location_of_log>\Install.log

    Just change the information above in triangular brackets for the place the agent is running from and the location you wish to save the MSI log respectively.

    For more information on the parameters for this see the following MS article: Msiexec


    The MSI log shows the following when the EmDriver is trying to install:

    DIFXAPP: INFO:   Installing INF file "C:\Windows\system32\DRVSTORE\EmDriver_864B59E442F3BDFC53DE42866F2302AC91744DF7\EmDriver.inf" of Type 5.

    DIFXAPP: INFO:   installing class filter 'C:\Windows\system32\DRVSTORE\EmDriver_864B59E442F3BDFC53DE42866F2302AC91744DF7\EmDriver.inf'

    DIFXAPP: ERROR:  Inf 'C:\Windows\system32\DRVSTORE\EmDriver_864B59E442F3BDFC53DE42866F2302AC91744DF7\EmDriver.inf' does not have the correct install section!

    DIFXAPP: ERROR:  The driver installation failed. Attempting to undo system changes ... (Error code 0x65B: Function failed during execution.)

    DIFXAPP: INFO:   Unable to revert to a previous driver store for service 'EmDriver'.

    DIFXAPP: INFO:   Will attempt to uninstall the driver.

    DIFXAPP: INFO:   RETURN: DriverPackageInstallW  (0x65B)

    DIFXAPP: ERROR: encountered while installing driver package 'C:\Program Files\AppSense\Environment Manager\Agent\DifxCache\EmDriver\EmDriver.inf'

    DIFXAPP: ERROR: InstallDriverPackages failed with error 0x65B

    It seems in some scenarios the install checks for this EmDriver.inf file and reads that the version contained within it will not permit the driver to be replaced. This is potentially because a more recent version of the driver had been previously installed such as v10.



    The best way to remedy this would be to firstly uninstall any other version of the Environment Manager agent and to try again. If this still fails then navigate to:



    Within this location check for a folder that begins with "EmDriver_". In the example from above the folder would be:


    As the installer is checking for this location during the install just rename this folder (you may need to use an Elevated user account such as an Administrator).


    If this still fails, also check for a pre-existing version of the EmDriver.sys driver in here:


    If the file is present rename it, for example from EmDriver.sys to EmDriver.old.


    After this retry the MSI and you should be able to complete the install.

    Gathering an MSI log during the success install you will instead see:

    DIFXAPP: INFO:   ENTER:  DriverPackageInstallW

    DIFXAPP: INFO:   Copied 'EmDriver.inf' to driver store...

    DIFXAPP: INFO:   Copied 'EmDriver.cat' to driver store...

    DIFXAPP: INFO:   Commiting queue...

    DIFXAPP: INFO:   Copied file: 'C:\Program Files\AppSense\Environment Manager\Agent\DifxCache\EmDriver\EmDriver.sys' -> 'C:\Windows\system32\DRVSTORE\EmDriver_864B59E442F3BDFC53DE42866F2302AC91744DF7\EmDriver.sys'.

    DIFXAPP: INFO:   Installing INF file "C:\Windows\system32\DRVSTORE\EmDriver_864B59E442F3BDFC53DE42866F2302AC91744DF7\EmDriver.inf" of Type 5.

    DIFXAPP: INFO:   installing class filter 'C:\Windows\system32\DRVSTORE\EmDriver_864B59E442F3BDFC53DE42866F2302AC91744DF7\EmDriver.inf'

    DIFXAPP: SUCCESS:Installation completed with code 0x0.



    If you are still seeing this issue than there may be more elements within the Agent install that are corrupt. The best course would be to repair then remove the corrupted install:


    1. Repair the Environment Manager Agent installation

    2. Reboot the endpoint

    3. Uninstall the Environment Manager Agent installation

    4. Reboot the endpoint

    5. Install or deploy the desired Environment Manager Agent version