How to create share for a whole drive under WiX? - deployment

I would like to create a share for a whole drive in my WiX installer project. The default approach for share creation works just fine for folders, but not for drives! The following code snippet illustrates the problem:
<!-- Works! -->
<Property Id="MySharePath"><![CDATA[X:\ROOT]]></Property>
<!-- Works NOT!
<Property Id="MySharePath"><![CDATA[X:\]]></Property>
-->
<Directory Id="MySharePath" Name=".">
<Component Id="C__AddShare"
Guid="$(var.GuidAddShare)"
KeyPath="no"
Permanent="yes">
<CreateFolder/>
<!-- Create necessary share -->
<util:FileShare Id="MY_SHARE"
Name="MY_SHARE"
Description="MY_SHARE">
<util:FileSharePermission ChangePermission="yes"
CreateChild="yes"
CreateFile="yes"
Delete="yes"
DeleteChild="yes"
GenericAll="yes"
GenericExecute="yes"
GenericRead="yes"
GenericWrite="yes"
Read="yes"
ReadAttributes="yes"
ReadExtendedAttributes="yes"
ReadPermission="yes"
Synchronize="yes"
TakeOwnership="yes"
Traverse="yes"
User="LukeSkywalker"
WriteAttributes="yes"
WriteExtendedAttributes="yes"/>
</util:FileShare>
</Component>
</Directory>
Does anybody has a hint for this?

I don't think the WiX toolset supports this today. It'd be great if you updated the FileShare extension to handle this case and contributed back to the community.

Related

Getting Error HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported after HTTP Error 500.35 - ANCM Multiple Hosting models not supported

I am getting error "Error HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported" after adding
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
to my application.config.host, I was trying to resolve HTTP Error 500.35 - ANCM Multiple Hosting models not supported by adding above code snippet to application.config.host. Any help would be appreciated. Thanks
This issu occured because you may have different hosting model on you web apps under the same server where you have hosted your all web apps ,so you need to change hosting model for all ur web apps to be outofprocess by adding below line
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
I got the same error when I changed target SDK to .Net Core 3.1.
My solution was remove hostingModel="inprocess" from aspNetCore tag in file web.config.
Sure it can be made cleaner, but at least the app works.
Hope it may help someone.
<aspNetCore processPath="dotnet" arguments=".\XXXXXXX.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"/>
I got it resolved.
I was loking for my applicationhost.config file in the .vs folder, to start i was unble to find .vs folder in my project folder. I manually typed C:\Users\v-wauddi\Desktop\Dutch Treat\DutchTreat.vs\DutchTreat\config\applicationhost.config and i was able to get applicationhost.config, I saw an unusual entry, I fixed it by commenting that unsual entry which can be seen in the below code.
<site name="DutchTreat" id="2">
<application path="/" applicationPool="DutchTreat AppPool">
<virtualDirectory path="/" physicalPath="C:\Users\v-
wauddi\Desktop\Dutch Treat\DutchTreat\DutchTreat" />
</application>
//commented out section
<!--<application path="/App" applicationPool="App AppPool">
<virtualDirectory path="/" physicalPath="C:\Users\v-
wauddi\Desktop\Dutch Treat\DutchTreat\DutchTreat" />
</application>-->
<bindings>
<binding protocol="http" bindingInformation="*:8888:localhost" />
</bindings>
</site>
I was going mad due to this issue from last 30-40 minutes. At last I deleted the .vs folder and reopened the project.
It works like charm.
Steps:
Open your solution folder.
exit project and close visual studio.
delete the vs folder, it might be hidden, so you need to enable
hidden items as shown below :
At last reopen project, it will take some extra seconds to reconstruct the files in .vs folder.

Deployment according to environment and user privileges through TFS CI

I have trying to implement CI for my desktop .NET application. But I am stuck at how to implement some stuff.
According to the requirements, I need to implement a filter while releasing the build according to user privileges and also filter the funtionalities that need not be installed on production.
I used to do this manually using a manifest.xml but now it seems a bit tidious to implement the same through TFS without using the Manifest.
My manifest looks like this:
<?xml version="1.0" encoding="Windows-1252"?>
<Manifest UpdaterVersion="3.33.7.717">
<f t="DLL" v="0.86.5.0" p="Module1.dll" />
<f t="DLL" v="1.26.2.123" d="true" x="true" p="File\Module2.dll" />
In this example "d" is for dll not be installed on production and "x" is for power user only.
Can anyone help me find a solution for this?

Continue the Wix setup after having a service that could not start

We have a setup in which we have a service that we try to install and run.
For some reason, the service cannot start(due to a port already in use). This isn't critical for us and should not stop the setup.
The service is declared like this:
<DirectoryRef Id="BIN">
<Component Id="MyService" Guid="*" SharedDllRefCount="yes">
<File Id="MyService.exe" Name="MyService.exe" KeyPath="yes" Vital="no" Compressed="default" DiskId="1" Source="$(var.DirDotfuscated)\MyService.exe" />
<ServiceControl Id="Install" Name="MyService" Start="install" Stop="install" />
<ServiceControl Id="Uninstall" Name="MyService" Stop="uninstall" Remove="uninstall" />
<ServiceInstall Id="NewServiceInstall2" Name="MyService" DisplayName="My Service" Type="ownProcess" Interactive="no" Start="auto" ErrorControl="normal" Description="My service" Vital="no" />
</Component>
<Component Id="Xms_HostService_Files" Guid="*" SharedDllRefCount="yes">
<File Id="MyService.exe.config" Name="MyService.exe.config" Vital="no" Compressed="default" DiskId="1" Source="$(var.DirDotfuscated)\MyService.exe.config" />
<File Id="MyServiceCommon.dll" Name="MyServiceCommon.dll" Vital="no" Compressed="default" DiskId="1" Source="$(var.DirDotfuscated)\MyServiceCommon.dll" />
<File KeyPath="yes" Id="MyServiceCore.dll" Name="MyServiceCore.dll" Vital="no" Compressed="default" DiskId="1" Source="$(var.DirDotfuscated)\MyServiceCore.dll" />
</Component>
</DirectoryRef>
When we execute the setup, we get this error:
And then, we only have the option to Retry(which will also fail) or cancel(that stops the setup).
We tried so many things(only put serviceInstall, not serviceControl, ...) but at some point we always have an error.
How should we manage this?
Attempted Answer (without ability to test):
What happens if you set the ServiceControl element's Wait attribute to "no"? I don't have a service exe to test with at the moment, but I believe that could work as you intend it.
Custom actions should generally be avoided for reliability reasons, but on the other hand - if you do need something special - that's what they are there for. Be prepared for most deployment problems to originate from your custom actions though: Why is it a good idea to limit the use of custom actions in my WiX / MSI setups?
Some further advice (which was not asked for :-) ):
You should not install multiple binaries with one component. You should use one file per component for many reasons. Windows Installer best practice specifically dictates to have only one binary per component, but in my opinion you should use one component per file in general to make minor upgrades and patching possible, and self-repair more reliable.
To better understand component reference counting: Change my component GUID in wix?
By eliminating hard-coded GUIDs you can take advantage of WiX's advanced auto-GUID creation concept. This will change the component GUID if the absolute installation path changes. This is correct behavior for component reference counting. Auto-magic. You either set Guid="*" or just leave out the Guid attribute entirely. A few installation locations need a hard coded GUID - the WiX compiler will warn you and explain why.
If you do change the component structure (to use one file per component) you should change the installation path to "break the link to past sins" with regards to component reference counting. This is a very complex topic to explain, but changing the installation path will sort all problems for you - if you also enable the auto component GUIDs I mentioned in the previous point. Keep the path stable from then on (until you have a major new version).
You can do it as simple as adding a sub folder with the the application's major (and minor?) version to the main installation folder hierarchy: "Program Files\MyCompany\MySoftware\5" instead of "Program Files\MyCompany\MySoftware".
I would only add the major version to the path and keep the installation path stable throughout your application's lifetime and then increment when you want to break the link to previous installers for a major new software version (for example if you want to install two versions side-by-side - your application must be built to handle this properly, i.e not overwriting shared settings in the registry from both versions etc...).
You might want to consider simplifying your WiX source file by only specifying values for attributes that are non-standard (otherwise rely on defaults). This can substantially simplify your WiX source files. Here is an example: Syntax for guids in WIX?
Just a quick sample inline (same as in link above - check it out), this is all that is required to install a normal file with default attributes / parameters - all other attributes default well - unless you want to override something:
<Component>
<File Source="..\File.dll" />
</Component>
Some links:
Windows Installer Best Practices (full list).
Windows Installer Best Practices - Organizing Applications into Components (specifically for component creation).
When component reference counting has gone haywire (missing files after upgrades, unexpected removal of shared files on uninstall, etc...): WiX 3.8: Two MSI using the same registry values. How to delete registry values only if both MSI are uninstalled?
Drop the ServiceControl element in lieu of a CustomAction element with #DllEntry="WixQuietExec" set, then use a standard means of starting the service like net start foo and ignore the result. See Quiet Execution Custom Action for details.

IBM Notes: Eclipse Plugin deployment to framework directory

I am not totally sure, if this question is in the right forum here, but as it is about a development environment and deploying developments I think it is save to ask.
I have a plugin for the IBM Notes client that I need to install silently in the background.
I used "CustomizeAddon.exe" to create a package and created an install.addon.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<ibm-portal-composite>
<domain-object name="com.ibm.rcp.installmanifest">
<object-data>
<install>
<installfeature id="Jabber4Notes" required="true">
<requirements>
<feature id="com.endava.jabber4notes.feature"
version="2.11.8.298" match="compatible"
shared="true" mergeaction="add"
url="jar:${installer.root}/updateSite.zip!/" />
<feature id="com.endava.jabber4notes.IMPFragmentFeature"
version="2.11.8.298" match="compatible"
shared="true" mergeaction="add"
url="jar:${installer.root}/updateSite.zip!/" />
</requirements>
</installfeature>
</install>
</object-data>
</domain-object>
</ibm-portal-composite>
But although I use the parameter shared="true" the plugin always installs to the workspace directory instead of the feature- directory.
How can I change this behaviour?
Make sure to have write permissions on the shared site.
If that's not the problem try to use colocation affinity to specify that the deployment site should be the same of another plugin; com.ibm.rcp.site.anchor.shared.feature is always installed on the shared site so you could add this:
colocation-affinity="com.ibm.rcp.site.anchor.shared.feature"
Here you can find more information regarding this topic: LINK

Create build configuration from existing template in TeamCity using REST API

I'm trying to create build configuration for a project in TeamCity 8.0 using REST API. However instead of creating a new configuration I want to copy from an existing build configuration template. Basically, I'm looking to implement before option present in TeamCity web interface:
TeamCity REST API documentation is not extensive and it does not provide any details about how to create build configuration using existing template via REST API. Any input on how this can be done using REST API ?
I believe TC 8.x and TC 9.x REST APIs are pretty similar. This example was written for TC 9.x.
I don't know if you have sorted this out, but (for the record) you have to do what the "Create a new build configuration with all settings" says. Basically, you have to create an XML with a format like this:
<buildType id="YourBuildID" name="YourBuildName" projectId="TheProjectIDThatOwnsThis" >
<project id="TheProjectIDThatOwnsThis" name="TheProjectName" parentProjectId="TheProjectParent" href="TheProjectHREFValue" webUrl="TheWebURLOfTheProejct"
/>
<template id="TemplateID" name="TemplateName" templateFlag="true" projectName="ProjectThatHasTheTemplate" projectId="ProjectThatHasTheTemplate" href="TemplateHRef" />
<vcs-root-entries>
<!--vcs-root-entry elements are not necessary-->
</vcs-root-entries>
<settings>
</settings>
<parameters>
</parameters>
<steps>
</steps>
<features>
</features>
<triggers>
</triggers>
<snapshot-dependencies/>
<artifact-dependencies/>
<agent-requirements/>
<builds href="BuildConfigurationHREF" />
</buildType>
And do a POST to this URL: http://TCServerName:Port/httpAuth/app/rest/buildTypes
That is the XML expected by TeamCity, so it's up to you in which programming language you will create it. I have done this with C#/LINQ to XML and worked just fine.
Hope this helps.