Outlook Addin installer chokes on auto-update - MSI error 1304

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Addin installer chokes on auto-update - MSI error 1304
 
mscheuner


Guest


We're testing an Outlook addin built with ADX on Windows 8.1 / Outlook 2013. Initial installation and tests worked perfectly fine.

But now, during installation of the update to a newer version, the update gets detected fine, the ADX installer gets downloaded and run, downloading the new MSI. When the MSI starts up, it displays the welcome dialog and then tries to start installing the new files - but it chokes and throws an error:



MSI Installer error 1304 - cannot write to C:\users\myself\appdata\local\addin\addin.dll.
Make sure you have access to the directory


The directory is there, and as the admin on the machine, I do have access to it and can write a file into it. Also: Outlook isn't running (checked in Task Manager).

So what on earth is blocking the updater MSI from replacing those files that make up our addin? Any ideas?
Posted 04 Nov, 2014 08:40:16 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Marc,

Do you have the option "Show warning if host application(s) is running" turned on? Was Outlook running when the update was started? Is there a chance that your code kills the Outlook process?


Andrei Smolin
Add-in Express Team Leader
Posted 04 Nov, 2014 09:18:28 Top
mscheuner


Guest


Hello Andrei,

not sure where that option you mention would be? In Windows 8.x itself? In a WiX script somewhere?

Outlook was launched, and then the addin detects a new version. We confirmed we wanted to install the update.

Then the ADXInstaller is launched and downloads the MSI and starts to run it.

Once, we closed Outlook ourselves just as the MSI was launched (when the welcome dialog was displayed) - the other time, we didn't do anything, and the MSI detected itself that Outlook was running and offered to close (and re-open) it.

In both cases, we get this error.
Posted 04 Nov, 2014 09:45:35 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Marc,

Thank you for these details. Regarding the option: you set it in the Preferences dialog when creating a ClickTwice installer. According to your description it is turned on.

Could you please try to delete the addin.dll file manually when the installer shows the error? Also, try to update the add-in by manually running the downloader with Outlook closed. Does this produce the same issue?


Andrei Smolin
Add-in Express Team Leader
Posted 05 Nov, 2014 07:17:55 Top
mscheuner


Guest


Hello Andrei,

to confirm: yes, the setting "Show warning if host application(s) is running" is in fact turned ON as you expected.

During the update process, at the point we get the error, there are no files in the target directory - they've already been deleted, it seems. So it almost seems as if the deletion has been "committed" yet - and a new file with the same name cannot be written to that directory......

When we use the ADXinstaller to just simply install the new version over top of the existing one, everything works just fine.
Posted 06 Nov, 2014 04:14:08 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Marc,

Please confirm that by ADXInstaller you mean the downloader created for the update, not the .MSI.

Hope Windows, Office and .NET on the target machine are properly updated.

I would like to access that PC remotely within the next 3 hours. Is this possible? If yes, I suggest using TeamViewer; in this case you'll need to send me your session ID and password to the support email address.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Nov, 2014 05:10:15 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
I've connected to the test machine and Martin showed me the issue. Thanks to both of you.

It looks like you set DisplayAlerts=false in one or more of the Add-in Express modules used in your solution. Also, you've cleared the "Show warning if host application(s) is running" check box in the ClickTwice Preferences, see section Publishing with ClickTwice in the manual.

You need to have this checkbox selected in order to avoid this issue. I would also recommend that you set DisplayAlerts=true.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Nov, 2014 09:03:13 Top
mscheuner


Guest


This is my
adxpublisher.exe.config
that's been used to "publish" this installation (I'm pretty sure the "Show warning if host application(s) is running" option is enabled with this - no?) :


<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="publish.Settings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="clickTwice.Settings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </sectionGroup>
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
  <publish.Settings>
    <clickTwice.Settings>
      <!-- Required. If set to true, the downloader will cause the UAC dialog to show up. Default - false. -->
      <add key="requiresElevation" value="false"/>

      <!-- Required. The .NET Framework version required for your add-in to install, e.g. "v2.0.50727"-->
      <add key="targetFrameworkVersion" value="v4.0"/>

      <!-- Required. The path and file name of the .MSI file containing an installer of your add-in, e.g. "D:MyProjectMyProject.msi". -->
      <add key="installerFile" value="C:workswisscomidiasrcVidiaAddinSetupinDebugSwisscom.Vidia.AddinSetup.msi"/>

      <!-- Required. The publishing Location. A file share or an FTP server. E.g.  "D:MyProjectMSIPublish", "\ServerApplicationName", "ftp://ftp.domain.com/ApplicationName". -->
      <add key="publishingLocation" value="C:inetpubwwwrootVidia"/>

      <!-- Required. A URL or UNC path that specifies the location from which users download and run the installer, e.g. "http://www.domain.com/ApplicationName" or "\ServerApplicationName". -->
      <add key="installationUrl" value="http://deploy.nowhow.ch/Vidia/Install/"/>

      <!-- Required. The path and file name of the certificate file, e.g. "d:MyKeysmykey.pfx" -->
      <add key="certificateFile" value="****signing*****.pfx"/>

      <!-- Required. The file name of the downloader file, e.g. "myproject".-->
      <add key="downloaderFileName" value="Swisscom.Vidia.Addin.Loader.exe"/>

      <!-- Optional. The path and file name of the custom action assembly containing a ClickTwice module, e.g. "D:MyProjectCustomActionMyActions.dll". -->
      <add key="customActionAssembly" value=""/>

      <!-- Optional. The full name of the class that inherits the ADXClickTwiceModule class, e.g MyNamespace.MyCustomActionClass. -->
      <add key="customActionClass" value=""/>

      <!-- Optional. A password for the certificate file specified by 'certificateFile'. -->
      <add key="certificatePassword" value="********"/>

      <!-- Optional. The URL of the time stamp server. -->
      <add key="timestampUrl" value=""/>

      <!-- Optional. The name of an icon file, e.g. "test.ico". If this attribute is specified, the corresponding file must be located in the folder specified in 'projectOutputDirectory'. The icon is used for the app visible in the Start menu of Windows Explorer as well as in the "Uninstall or change a program" list ("Add / Remove Programs" in Windows XP).  -->
      <add key="iconFileName" value="Vidia.ico"/>

      <!-- Required. A list of application names (separated with ";") that must be re-started when the add-in is registered, e.g. "Excel;Word;Internet Explorer"  -->
      <add key="targetApplicationNames" value="Outlook"/>

      <!-- Optional. Specifies if the Windows installer UI will be shown during installation. Default - false. -->
      <add key="quietModeDuringInstall" value="false"/>

      <!-- Optional. Specifies if the Windows installer UI will be shown during uninstallation. Default - true. -->
      <add key="quietModeDuringUninstall" value="true"/>

      <!-- Optional. Specifies if the downloader's windows will be shown during the download process. Default - true. -->
      <add key="showDownloaderWindow" value="true"/>

      <!-- Optional. If true, shows the warning if the host application(s) is running. Default - true. -->
      <add key="showRunningApplicationsWarning" value="true"/>

      <!-- Optional. Specifies a string to be returned by CheckForUpdates/CheckForMSIUpdates() if a new version of the add-in is available. If there's no new version, CheckForUpdates/CheckForMSIUpdates() returns an empty string. -->
      <add key="checkForUpdateReturnString" value=""/>

      <!-- Optional. A list of prerequisites (separated with ";"), e.g. "Microsoft.Net.Framework.3.5.SP1;Microsoft.Windows.Installer.3.1" -->
      <add key="prerequisites" value=""/>

      <!-- Optional. Specifies the folder location containing prerequisites, e.g. "C:Program Files (x86)Microsoft SDKsWindows7.0ABootstrapper" -->
      <add key="bootstrapperDirectory" value=""/>

      <!-- Optional. If true, setup.exe installing the prerequisites listed in 'prerequisites' will be generated. Setting to true is required to install prerequisites. If no prerequisites are used, can be set to false. Default - false.-->
      <add key="createSetupExe" value="false"/>

      <!-- Optional. If true, prerequisites will be downloaded from the vendor's web site, otherwise, prerequisites will be copied to the location specified by 'publishingLocation'. Default - false. -->
      <add key="downloadFromVendorWebSite" value="true"/>

      <!-- The FTP-related settings below apply only if 'installationURL' specifies the FTP path to which users go to install the application. -->
      <add key="ftpAnonymous" value="true"/>
      <add key="ftpUserName" value=""/>
      <add key="ftpPassword" value=""/>
      <add key="ftpPassiveMode" value="false"/>
    </clickTwice.Settings>
  </publish.Settings>
</configuration>


The really odd things is: on most VM's we're testing with (Win 7, Win 8.0, Win 8.1 and various versions of Outlook), it works just fine - only on this one constellation, it chokes.... (always using the same installer)
Posted 06 Nov, 2014 09:11:17 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Marc,

The issue as I see it is this: instead of getting an Add-in Express dialog *requiring* and *checking* that you close Outlook (as specified by the settings above), you get an MSI dialog *suggesting* that you close Outlook. When you chose "Close Outlook" in this dialog, MSI commands Outlook to close and continues installing; when it comes to deleting/replacing the add-in file it appears that Outlook is still running and the file is locked. While you start Windows Task Manager after you get the error, Outlook already gets closed and this appears like kind of enigma.

Please try to publish this using the Publish ADX Project option in Visual Studio and check what dialog . On Monday (tomorrow we are on holiday), I'll try to publish a test add-in using your settings. What Add-in Express build are you using?

mscheuner writes:
on most VM's we're testing with ..., it works just fine


Are you saying that Add-in Express shows its dialog or you get the .MSI dialog (it allows you 1) to continue installing with Outlook running or 2) to close Outlook)?


Andrei Smolin
Add-in Express Team Leader
Posted 06 Nov, 2014 10:32:02 Top