Error 1312 When Installing Custom MSI Updates

We use Avigilon as our NVR solution corporate wide. Since there are a lot of people in the company who use the client software to view live video and/or recordings I have been trying to use Patch Manager to push out updates to the client. Avigilon publishes an MSI installer for the client but I cannot get it to work with Patch Manager.

I've created a package in Patch Manager with the MSI. My prerequisite and applicability rules are working fine. When the update runs, it says that it completes successfully but actually uninstalls the Avigilon client. When I check the event logs I find this error:

Source: MsiInstaller

Event ID: 11312

Product: Avigilon Control Center Client Only -- Error 1312. Cannot create the directory 'C:\Windows\TEMP\mia8A37.tmp\AvigilonControlCenterClientOnly.exe'.  A file with this name already exists.  Please rename or remove the file and click retry, or click Cancel to exit.

I've tried emptying the TEMP folder before running the update and it still fails. I've confirmed that running the command manually on the computer works fine: msiexec.exe /qn /norestart /i AvigilonControlCenterClientOnly-

I've done some searching and there is very little about the topic. There is one post in the InstallAware forums that suggests this is an issue with InstallAware. Indeed, the Avigilon installer is built with InstallAware but there is no resolution on that topic and no further information anywhere else. Has anyone else ever run into this issue?

  • I got it working and learned a couple things in the process. First, the problem does appear to be related to InstallAware. Specifically, some packages built with InstallAware will fail when attempting to install as SYSTEM. From the InstallAware forums, I learned that you can use PSEXEC to simulate this and indeed the following command reproduced the error code 1312:

    psexec /s /i msiexec /qn /norestart /i "C:\users\me\desktop\AvigilonControlCenterClientOnly-"

    Another discovery was that commandline parameters didn't appear to be getting passed to the installer from Patch Manager. I tried adding /l*xv "c:\windows\temp\avigiloninstall.txt" to the command line in order to generate a log but this did not work. Luckily, adding that to the psexec command did. The reason I wanted a log was because I had found a post on another blog that suggested the issue was with an improperly set variable. Anyways, I got the log from psexec as well as a log from running msiexec normally from an elevated command prompt and diffed them. The differences in the properties were the TempFolder and the various user directories (AppDataFolder, FavoritesFolder, etc.). The log from the good installation was using my user profile for all the folders and myprofile\appdata\local\temp as the TempFolder. The failed psexec installer was using the system profile (C:\Windows\system32\config\systemprofile) and C:\Windows\Temp for the TempFolder.

    Nothing was mistakenly pointing to that C:\Windows\TEMP\mia8A37.tmp as in the blog post I linked above so I decided I would try to change the TempFolder variable. I added TempFolder="C:\users\default\appdata\local\temp" to my psexec command but the install still failed. When I checked the log I found that TempFolder was still set to the Windows temp folder but a new property TEMPFOLDER had been added with the default user folder I had supplied.

    That path didn't seem to be leading anywhere so I decided to try out the suggestion on that page that the author said didn't work (adding ALLUSERS=TRUE) to the command line. This led to the same error and a similar log file. Finally, I found a post on the InstallAware forums that said you have to use the following to get the ALLUSERS=TRUE argument to work:

    msiexec /i c:\mytest.msi /quiet CMDLINE="ALLUSERS=TRUE"

    Indeed, adding that to the psexec command worked and adding it the command line arguments in Patch Manager also worked. My understanding of this is that InstallAware MSI packages are actually just wrappers for an inner InstallAware installer. The wrapper automatically passes /quiet to the inner part but it will not pass optional parameters given to msiexec such as ALLUSERS=TRUE. Instead, it passes the contents of the CMDLINE parameter to the inner installer as its command line arguments. So to change properties for MSI packages built with InstallAware you need to add them to the CMDLINE property.

    Anyway, the whole wrapper thing has some additional implications:

    • In the logs, /quiet (or /qn) gets passed to the inner installer as /s (Property(S): CMDLINE = /s). When I add CMDLINE="ALLUSERS=TRUE" to my command then the /s is removed (Property(S): CMDLINE = ALLUSERS=TRUE). The installation was still silent in my case but I imagine this could cause issues. If so, try changing it to CMDLINE="/s ALLUSERS=TRUE".
    • Second, I don't know if /norestart will be respected. /s is a InstallAware flag, not an msiexec one which suggests that the inner installer is an InstallAware built EXE. As far as I can find, there is no equivalent InstallAware flag for /norestart.
    • Third, you cannot trust the msiexec return codes when installing packages built with InstallAware. The return codes from the inner installer are not propagated to the outer one. Every time my installations failed with psexec or Patch Manager I got a return code of 0 from msiexec.
    • Lastly, because the inner installer uses InstallAware flags, to get the most detailed logs possible you should use CMDLINE="/l=path\to\log" instead of using the msiexec /l*xv or /log flags. Note that this slows the installation down significantly though.

    Well, I still have no idea why the system installation fails in the first place and I have some...opinions on how good of an idea the whole msiexec wrapper idea is but I probably shouldn't share them.


    • Use psexec /s /i msiexec to simplify troubleshooting this issue.
    • Try adding CMDLINE="ALLUSERS=TRUE" to your command line arguments.
    • If that doesn't work generate logs by running msiexec normally and through psexec. The most detailed logs come from adding CMDLINE="/l=/path/to/log" to you command line. Find the property that is different and add CMDLINE="PROPERTY=VALUE" to your command line in Patch Manager.
  • Easy steps to solve this error:

    Error 1312. Cannot create the directory 'C:\Program'.

    A file with this name already exists. Please rename or remove the file and click retry, or click Cancel to exit.


    • Remove the file from the location or rename it.
    • Proceed with Revit Installation.

    Hope this helps,
    J Wick