Can't create setup project

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

Can't create setup project
Cannot load assembly Microsoft.xrm.sdk 
Subscribe
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
When trying to create a setup project for MSI publishing in Add-in Express I get an error saying that Microsoft.xrm.sdk could not be loaded. It is used for CRM communikation in my Outlook 2016 addin.
When pressing OK, the setup project is displayed but selection of installers (VS, InstallShield and WiX) are disabled. In "Why is option(s) disabled" it says to install these. Visual Studio Installer and WiX were then installed, but trying again shows VS Installer selected but radiobuttons disabled.
Entering Title, Description, Product name and Company does not enable "Next" - I'm stuck.

I then tried to create a VS Installer project to see if that was possible, and that went well. I could use that to publish ClickTwice and it install fine on client PC. ClickOnce is ofcourse not affected in any way.

Problem comes when trying to deploy next version and trying to update. When not using Add-in Express Setup project both
IsMSINetworkDeployed
and
IsMSIAutoUpdateEnabled
return false

There is no check in Publish that says I can't use a default setup project and install on client goes fine. But the adxloader.manifest is missing apparently in the publish and that is used to check IsMSINetworkDeployed.
So either I need to be able to include this in my VS Installer project - or fix my real problem creating the Add-in Express setup Project.

Microsoft.xrm.sdk is referenced when installing Nuget package Microsoft.CrmSdk.CoreAssemblies and the file is found under <project folder>\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.12\lib\net462\Microsoft.Xrm.Sdk.dll
For some reason Add-in express cannot load this when creating a setup project.

Have tried to turn on/off manifest signing, Copy local and Embed Interop Types. Has no effect.
Posted 08 Mar, 2019 03:11:22 Top
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
If using VS installer project in Add-in Express for publishing web deployed MSI, you might see problems like in this thread https://www.add-in-express.com/forum/read.php?FID=5&TID=15355

You need to use Add-in Express setup Project
Posted 08 Mar, 2019 03:27:44 Top
Sergey Grischenko


Add-in Express team


Posts: 7225
Joined: 2004-07-05
H Dan,

The ClickTwice deployment doesn't depend on the tool what is used to create the setup project. You just need to create msi as described in our documentation (see the 'Deploying Office Extensions' chapter).

I added Microsoft.CrmSdk.CoreAssemblies to a test project and created a new setup project without errors. I used WiX to create the setup. What is the target version of .NET Framework in your project? Probably you can send me sample project that reproduces the issue. I will test it on my PC.
Posted 08 Mar, 2019 06:01:06 Top
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
Target framework is 4.7
I will send you a sample projekt a bit later today or monday.
Posted 08 Mar, 2019 08:17:50 Top
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
Posted 11 Mar, 2019 02:56:32 Top
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
I don't have custom actions in my setup project. It was made with the default VS wizard for setup projects.
I set the PostBuildEvent from step 6 - and then saw step 10 about NOT changing the Product Code. Ok, I've done that every time, so I need to test this before doing anything else.
Also I added adxloader.dll.manifest as a file in the setup project.


Will deploy one version and then an update to that. If this doesn't work I could zip the project and send to you.
Posted 11 Mar, 2019 03:18:48 Top
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
Now the deployment works, and it fint an update, downloads it and pops up in the statusbar. Clicking on the message show an update form and I try to update the application.

But now I'm getting this error "The process cannot access the file 'C:\Users\dr\AppData\Local\Temp\16\inutime.exe' because it is being used by another process."

Seems like the downloaded file is locked...
Posted 11 Mar, 2019 05:40:27 Top
Andrei Smolin


Add-in Express team


Posts: 16201
Joined: 2006-05-11
Hello Dan,

Is it possible that the previous update isn't complete? I would restart the machine, start Excel and check that the updater starts. Please be aware that updating requires restarting Excel.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Mar, 2019 07:02:26 Top
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
Can't restart a server just now :)

But the downloaded file could be deleted after shutting down Outlook.

I have this code in my AddinModule_AddinInitialize:
'ClickOnce check updates
        If Me.IsNetworkDeployed Then
            Me.CheckForUpdates()
        End If

        'ClickTwice check updates
        If (Me.IsMSINetworkDeployed And Me.IsMSIAutoUpdateEnabled) Then
            Dim updateUrl As String = Me.CheckForMSIUpdates()
            If Not String.IsNullOrEmpty(updateUrl) Then
                Me.LaunchMSIUpdates(updateUrl)
            End If
        End If


But also the Enable Automatic updates setting is set in Publish. Am I getting the update started twice?
That would be a UpdateTwice and not ClickTwice deployment ;)
Posted 11 Mar, 2019 08:28:52 Top
Dan Rasmussen




Posts: 44
Joined: 2010-03-31
I commented the code.. So now I don't run that check. And now it seems to start the update fine. It even seems to install the update all the way - but when starting Outlook again it's the old version still running. And it keeps saying a new version is available.

When updating the version in setup project I don't update product code anymore. Should I update UpgradeCode property? I don't right now.
Posted 11 Mar, 2019 10:30:57 Top