vs2010 breaks the content of parameters.xml - visual-studio-2010

I've got the file Parameters.xml that contains the following
<parameter name="Identity Suffix" description="Suffix of the identity services of the environment" tags="" >
<parameterEntry kind="TextFile" scope="\\web.config$" match="__IDENTITY_SUFFIX__"/>
<parameterValidation type="AllowEmpty" />
</parameter>
After I run Build deployment package the output file does not contains any parameterValidation and I have to edit the file manually. How to fix this behavior ?

IIS supports two schemes:
<parameterValidation kind="AllowEmpty" />
<parameterValidation type="AllowEmpty" />
VS supports only first one

Related

Ansible remove comment above specific line

I am doing a script to automate file editing on server when deploying an agent of some service, the file is config.xml and I am editing fields using replace, so for eg.:
- name: Update config.xml - PROXY HOST
replace:
path: "{{agent_path}}{{ cfg_agent }}/agent/config.xml"
regexp: "YOUR_PROXY_HOST"
replace: "{{cfg_proxyhost}}"
Config.xml looks like:
<!--
<parameter name="mid.proxy.use_proxy" value="true"/>
<parameter name="mid.proxy.host" value="YOUR_PROXY_HOST"/>
<parameter name="mid.proxy.port" value="YOUR_PROXY_PORT"/>
-->
So when I run this particular task it will replace YOUR_PROXY_HOST for a value under {{cfg_proxyhost}}, let's say like that:
<!--
<parameter name="mid.proxy.use_proxy" value="true"/>
<parameter name="mid.proxy.host" value="http://proxy.foo"/>
<parameter name="mid.proxy.port" value="YOUR_PROXY_PORT"/>
-->
But then I need to remove those <!-- above and --> below to make it working.
There is a lot of other parameters in the file commented in the same way.
I need to remove these particular ones.
How can it be done using ansible?
Actually I have resolved it by using Jinja2 template, replacing the files with a pre-defined variables within a template, but if any of You could answer how to just remove that comment, that will be nice :)

MsiPackage conditional install: Don't uninstall if it detects package is already installed

I'm using Wix Bootstrapper and want to install a few applications through .msi packages alongside my main application. These applications may be installed in the target PC already so I need to detect these first and skip installation if they are already installed. Furthermore, during uninstallation, these applications should not be uninstalled since the Wix Bootstrapper did not install them.
I've tried to use the InstallCondition attribute but (as expected) it uninstalls if it detects the application is already installed.
My Bundle.wxs looks like this:
...
<Bundle>
<util:FileSearch Id='CheckApplicationX' Path='[ProgramFilesFolder]ApplicationX\ApplicationX.exe' Variable='ApplicationXFile' Result='exists' />
<Chain DisableRollback="yes">
...
<MsiPackage Id="InstallApplicationX" Vital="yes" Compressed="yes" DisplayInternalUI="no" EnableFeatureSelection="no" SourceFile="..\application-x.msi" Name="Application X" DisplayName="Application X" ForcePerMachine="yes" InstallCondition="NOT ApplicationXFile" />
...
</Chain>
</Bundle>
...
Any help/hints are appreciated!
You can try to detect if the applications are installed by looking in the Windows Registry and try to identify if there are "traces" left by those applications.
You can use the RegistrySearch tag to perform a conditional evaluation of the registry entries you're looking for and then deny the installation.
There's an example on Wix Website available at this link.
The following example shows how you can define if .NET 2.0 is installed on the target machine
<Property Id="NETFRAMEWORK20">
<RegistrySearch Id="NetFramework20"
Root="HKLM"
Key="Software\Microsoft\NET Framework Setup\NDP\v2.0.50727"
Name="Install"
Type="raw" />
</Property>
<Condition Message="This application requires .NET Framework 2.0. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK20]]>
</Condition>

Freeswitch update profile using mod_xml_curl

I am currently working on a project that updates profiles on a freeswitch server, using mod_xml_cur.
My problem is the following
My project is a selfhosted owin webapi that creates a profile and when requested uses owin to create an xml that should be loaded by freeswitch.
when i use the command "sofia profile test start" it fetches the profile(named test) from my owin url.
on the Console I see "Reload XML [succes]
but then it states [WARNING] sofia.c:5603 No Such Profile 'test'
the downloaded XML file is in /tmp with a temporary name .
And when I rename it and move it to /etc/freeswitch/sip_profiles#
and start it again, it loads the profile.
My understanding is that using mod_xml_curl the profile should load from memory when the xml is opened from my owin url.
What am I doing wrong here?
<document type="freeswitch/xml">
<section name="configuration">
<profiles>
<profile name="Your profile name">
<gateways>
<gateway name="Your gateway name">
<param name="username" value="Your username"/>
<settings>

How to change the Windows service startup type in a WiX installer

We need to modify the Startup type of our Windows service from "Automatic" to "Automatic Delayed Start". How do I do this?
My code is like this:
<ServiceInstall
Id="WinServiceInstall"
Name="ServiceManager"
DisplayName="ServiceManager"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Vital ='yes'
Description ='Monitoring and running the jobs'
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]">
<util:ServiceConfig
FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType ="restart"
cRestartServiceDelayInSeconds ="10" />
</ServiceInstall>
And how do I set the Restart service time? I would like to set Restart service after 2 minutes if failed.
Place a ServiceConfig element within the ServiceInstall element.
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall ="yes" />
If you need to support really old versions of Windows, then you will need to set it with a reg-value, because MSI < 5.0 doesn't recognize this option with ServiceConfig. Otherwise, you should use the ServiceConfig method.
<RegistryValue Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\[ServiceName]"
Type="integer" Name="DelayedAutostart" Value="1"/>
I put this in the same component as the ServiceInstall, and everything seems to work fine. I imagine you could do the same thing for the service restart time.

Wix Conditionally Install Component if Registry Key Exists

I have a component I need to install only if a registry key exists which means an application has been installed.
I need to assign the value of the registry key (it is a directory) to a property then use this property to copy files from.
I have the following script so far but get an error "The system cannot find the file '[MYTESTDIR]fileToCopy.dat'."
Any help would really be appreciated.
<Property Id="MYTESTDIR">
<RegistrySearch Id="NetFramework20"
Root="HKLM"
Key="SOFTWARE\TEST\VALUE\1.00"
Name="MyName"
Type="directory" />
</Property>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="TEST" Name="Test">
<Component Id="MyComponent" Guid="E5FF53DE-1739-42c4-BE37-60F810C9CD69">
<Condition>MYTESTDIR</Condition>
<File Id="fileToCopy.dat" Name="fileToCopy.dat" Source="[MYTESTDIR]fileToCopy.dat">
<CopyFile Id="fileToCopy.datCopy" DestinationProperty="WEBSERVICEBINFOLDER" />
</File>
</Directory>
</Directory>
</Directory>
<Feature Id="MyFeature" Title="MyFeature" Level="1">
<ComponentRef Id="MyComponent" />
</Feature>
Based on my reading of the Wix Schema documentation, your problem is that you have the CopyFile element nested under a File element. Ditch the File element and just have the CopyFile sit under the Component:
<Component Id="MyComponent" Guid="E5FF53DE-1739-42c4-BE37-60F810C9CD69">
<Condition>MYTESTDIR</Condition>
<CopyFile Id="fileToCopy.datCopy" SourceName="[MYTESTDIR]fileToCopy.dat" DestinationProperty="WEBSERVICEBINFOLDER" />
</Component>
The way you had it, nested under the File, Wix was looking for the file on your system during the build - rather than setting up a copy command to be run at install time.
MYTESTDIR is a windows installer property which will get its value on the target system when the package is being installed.
However, you are trying to use this property in a Source attribute, which is used to point to files on the system where the setup package is being build.
Obviously that is not going to work. Windows installer properties don't even exist while the Source attribute is being evaluated, so Source can definitely not support such use.
Bryan's answer is the correct solution for what you're trying to do here. Using CopyFile under a File element is not illegal, but it is intended for copying files which you also install. In this case, you want to copy a file which is already on the target system, so the File element is not appropriate.

Resources