Slowcheetah app.config pass parameters to transform file - xslt

I have following transform file app.Release.config to transform my app.config using SlowCheetah. How do I pass the BUILD_NUMBER from TeamCity so that the transform file replaces a particular xml elements value.
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyApp.Data.Model" publicKeyToken="866d4a0fa0599fe0" culture="neutral" />
<bindingRedirect name="MyApp.Data.Model.BR" oldVersion="0.0.0.0-$(BUILD_NUMBER)" newVersion="$(BUILD_NUMBER)" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</dependentAssembly>
</assemblyBinding>
If I hard code the value then SlowCheetah does the transformation. But, I don't know how to pass in the build_number as a argument so that for each build I can replace the correct version.

I could not find a way to pass parameters to slowcheetah transform files. I'm using a XmlPoke Task to modify the contents of app.config.
My answer for this can be found at this link

Related

Powershell cannot use COM object when registration-free COM is used

I am trying to use COM object in regitration-free fashion in powershell. My component is x86 and poweshell_ise.exe is x86 also.
To do this I have created manifest for dll-based com server:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="ComComponent" processorArchitecture="X86" type="win32" version="1.0.0.0"></assemblyIdentity>
<file name="ComComponent.dll" hashalg="SHA1">
<comClass clsid="{<CLASS_CLSID>}" tlbid="{<TLB_CLSID>}" progid="ComComponent.ComComponent" description="ComComponent Class"»
<typelib tlbid="{<TLB_CLSID>}" version="1.0" resourceid="2" helpdir="" flags="HASDISKIMAGE"></typelib>
</file>
</assembly>
And manifest for the powershell script:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="PSScript" type="win32" />
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="ComComponent" version="1.0.0.0"
processorArchitecture="x86" />
</dependentAssembly>
</dependency>
</assembly>
In powershell I am using it in the following way:
$actctx = New-Object -COM Microsoft.Windows.ActCTX
$actctx.Manifest = "<path to manifest>"
$obj= $actctx.CreateObject("ComComponent.ComComponent")
$obj.ComMethod()
After that I am getting the following error:
Method invocation failed because [System.__ComObject] does not contain a method named 'ComMethod'.
I can see that ComComponent.dll is loaded into powershell_ise.exe in Process Explorer. Also I can see that powershell for some reason is trying to read HKCR\TypeLib\{<TLB_CLSID>} registry key.
The same functionality is working in powershell with registred COM. I have tried to put type library into separate file with the same result.
What can be the problem?
Thank you
I would try the following approach:
$myDll = Add-Type –memberDefinition #”
[DllImport("ComComponent.dll")]
public static extern bool myFunction(<parameters>);
“# -name "myDll" -namespace Win32Functions –passThru
$myDll::myFunction(<Parameters>) | Out-Null

WiX Heat.exe generates different output after VS2008 -> VS2015 upgrade

We execute the following command line with heat (3.0.5210.0):
heat.exe -srd -suid file OurLib.dll -out bin_OurLib.tmp
OurLib.dll is a VC++ 2008 dll file, it's a COM component.
Output (bin_OurLib.tmp)
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="OurLib.dll" Guid="PUT-GUID-HERE">
<File Id="OurLib.dll" KeyPath="yes" Source="SourceDir\OurLib.dll">
<Class Id="{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}" Context="InprocServer32" Description="OurProduct.OurLib">
<ProgId Id="OurProduct.OurLib" Description="OurProduct.OurLib" />
</Class>
</File>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
This works fine.
Now we updated the VS to 2015, and compiled OurLib with it.
Running the same heat command now results in different output:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="OurLib.dll" Guid="PUT-GUID-HERE">
<Class Id="{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}" Context="InprocServer32" Description="OurProduct.OurLib">
<ProgId Id="OurProduct.OurLib" Description="OurProduct.OurLib" />
</Class>
<File Id="OurLib.dll" KeyPath="yes" Source="SourceDir\OurLib.dll" />
<RegistryValue Root="HKCR" Key="CLSID\{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}\InProcServer32" Value=""[#OurLib.dll]"" Type="string" Action="write" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
And when wix is linking, it gives error:
error LGHT0130 : The primary key 'reg51A1FC16367511AF81E9B18CA009A1C6' is duplicated in table 'Registry'. Please remove one of the entries or rename a part of the primary key to avoid the collision.
Checking the wixobj file, reg51A1FC16367511AF81E9B18CA009A1C6 is related to line
<Class Id="{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}...." and <RegistryValue Root="HKCR" Key="CLSID\{B1AB.... - obviously.
Anwyay, this is obviously due to the generated wix output files are different.
Why is that if compiling a dll with a newer C++ compiler will cause WIX HEAT to generate different output, while running the same options, etc.
And how can I have back the same "old" output, which we need.
Tried with -scom and -sreg, none of them gave back the "old" output.
Well primary key duplicated means you've got that same RegistryValue in two different places in your wix source code somehow.
Or maybe the newer DLL is self-registering differently? It's putting the InProcServer32 value in quotes. I don't think that's normal.
Or have you checked that your 2008 and 2015 DLL source and project files are identical? The VS project upgrade process changes things...

impossible to publish artifacts for.... java.io.IOException: missing artifact lib#MyService;1.0!MyService.jar

Basically I am exploring IVY, to version my binary artifacts and how to do version control automatically using ivy. I found that publish, pubrevision could help me out.
Hence I am trying to publish my jar through IVY. However I am getting below error and build failed.
impossible to publish artifacts for lib#MyService;working#Localhost java.io.IOException: missing artifact lib#MyService;1.0!MyService.jar
Please find my ivy.xml
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="lib" module="MyService" />
<configurations defaultconfmapping="default->default;sources->sources;test->default">
<conf name="sources" transitive="false" visibility="private" />
<conf name="test" transitive="false" visibility="private" />
<conf name="default" transitive="false" />
</configurations>
<publications>
<artifact name="MyService" type="jar"/>
</publications>
<dependencies defaultconf="default">
<dependency org="lib" name="commons-logging-1.1" rev="1.1" />
<dependency org="lib" name="commons-collections-3.2" rev="3.2" />
<dependency org="lib" name="commons-beanutils" rev="1.7.0" conf="default" />
</dependencies>
</ivy-module>
Publish task : Note: dist will resolve my dependency and compile and jar
build.xml
<target name="publish" depends="dist">
<ivy:publish resolver="local" pubrevision="1.0" module="MyService" status="release" forcedeliver="true" update="true">
<artifacts pattern="publish/[organisation]-[artifact].[ext]"/>
</ivy:publish>
</target>
MyService.jar is being created in my build folder.
Can you please assist me, what is wrong with my code. I am pretty new to IVY. So any inputs will be appreciated very much.
Thanks.

Is it possible that a directory copied and pasted to a particular directory using XHTML plugin in DITA OT 1.8.5

Is it possible that a directory or a file copying from 'resource' folder in org.dita.xhtml to out put folder generated by the XHTML DITA OT transform.
If its possible using xsl changes in plugin its possible means provide me the code.
Any other way is there means please guide me the steps to do.
Please assist me.
You should use the depend.preprocess.post extension point, or another one that fits your needs, to call a new Ant target.
plugin.xml
<plugin id="com.example.extendchunk">
<feature extension="depend.preprocess.post" value="copyfiles"/>
<feature extension="dita.conductor.target.relative" file="myAntStuffWrapper.xml"/>
</plugin>
myAntStuffWrapper.xml
<dummy>
<import file="myAntStuff.xml"/>
</dummy>
myAntStuff.xml
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="myAntStuff">
<target name="copyfiles">
<copy todir="foo">
<fileset>
<include name="**/*.bar"/>
</fileset>
</copy>
</target>
</project>

MakeCat failed in Windows 8

I´m having troubles creating a catalog with MakeCat in Windows 8.
After calling with verbose, MakeCat shows the next error:
Failed: CryptCATCDFOpen. Last Error: 0x00000003
If I do it with Windows 7 over the same file, I don't have troubles.
The Catalog Definition File has this content:
[CatalogHeader]
Name=Digi.dll.cat
ResultDir=C:\Users\JoséÁngel\Documents\Visual Studio 2010\Projects\project
[CatalogFiles]
<HASH>Digi.dll.manifest=Digi.dll.manifest
Digi.dll.manifest=Digi.dll.manifest
And the manifest of the dll has this content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="Digi" processorArchitecture="x86" publicKeyToken="82292917b7a6e156" type="win32" version="10.0.0.217"></assemblyIdentity>
<dependency optional="yes">
<dependentAssembly>
<assemblyIdentity type="win32" name="Digi.Resources" version="10.0.0.217" processorArchitecture="x86" publicKeyToken="82292917b7a6e156" language="*"></assemblyIdentity>
</dependentAssembly>
</dependency>
<file name="Digi.dll" hashalg="SHA1" hash="69447737c3bfaf30c611c1755bcfd0f31fbb4557">
<asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform>
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod>
<dsig:DigestValue>GLP5Lao75uVf0ITDkD3b+yN/U8I=</dsig:DigestValue>
</asmv2:hash>
</file>
</assembly>
Solved,
The path of the result directory in the catalog definition file is too large.
Changing everything to a sorter path works correctly.