WIX - RegistrySearch returns wrong Installlocation - search

My WIX-installer shall check for a previously installed version of the software. If there is an older installation it shall be installed in the same path. I'm using RegistrySearch to perform this check.
<Property Id="TARGETDIR">
<RegistrySearch Id="InstallLocation" Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[ANYVERSION]" Name="InstallLocation" Type="directory" Win64="no" />
</Property>
where [ANYVERSION] is defined in
<Upgrade Id="MyGUID">
<UpgradeVersion Property="OLDVERSION" IncludeMinimum="yes" IncludeMaximum="no" Maximum="$(var.VERSION)" Minimum="0.0.0.0" OnlyDetect="no" />
<UpgradeVersion Property="NEWVERSION" IncludeMinimum="no" Minimum="$(var.VERSION)" Maximum="99.99.99.99" IncludeMaximum="no" OnlyDetect="yes" />
<UpgradeVersion Property="EQUALVERSION" IncludeMinimum="yes" Minimum="$(var.VERSION)" Maximum="$(var.VERSION)" IncludeMaximum="yes" OnlyDetect="yes" />
<UpgradeVersion Property="ANYVERSION" IncludeMinimum="yes" Minimum="0.0.0.0" Maximum="99.99.99.99" IncludeMaximum="yes" OnlyDetect="yes" />
</Upgrade>
My check works fine when there is already another version of my software installed.
When there is no earlier installation of my software, the checks works as well with one exception: when there is another application installed which writes an entry (with the name installLocation) without subnode (GUID) in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall the check returns the installLocation of this application.
What is wrong in my check?
Why is RegistrySearch returning the installLocation of the an entry without a subnode?
Is there a possibility to make this work with registrySearch, or do I need to write my own CustomAction?

That's because ANYVERSION will be empty if none is found, and the path will then be evaluated to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
One solution (not too elegant though) is to capture the registry search in another property, and only set the property that should contain your installation directory (TARGETDIR is probably not the correct choice here either) if ANYVERSION is defined, through a property settings custom action.

Related

Mule 3 retrieving the placeholder value dynamically

I have a use-case that I need to retrieve the value from my properties file but that key should be derived dynamically from my query params.
How to handle this in MEL or Groovy? I am aware it is possible in DW.
Http request
https://localhost:9898/getStore?search=customer.weststore.name
And my placeholders are -
file.properties
customer.weststore.name=TESTING
customer.eaststore.name=IRERRER
So the way I need to access something like this
<set-variable variableName="westDetail" value="#[message.inboundProperites['customer.weststore.name']" doc:name="Variable"/>
<logger message="${westDetail}" level="INFO" /> --> Failed as no placeholder available
When I tried the above it's failing due to no placeholder as "westDetail" available whereas I need the fetch that particular key from the properties file.
This is something related to this article - https://help.mulesoft.com/s/question/0D52T00004mXTQUSA4/dynamically-read-property-values-from-a-properties-file-in-mule but the only solution provided with DW not MEL or Groovy.
How anyone advises, Is it possible?
I understand that the problem is that you want to query the properties by a key that is obtained at execution.
You are doing it incorrectly. ${} is for evaluating the value of a property, which is done at initialization time of the application. You missed that get the actual value in the set-variable.
#[] is for executing a MEL expression, which happens at execution time. flowVars.westDetail is a MEL expression that returns the value of flow variable westDetail. You can't use a MEL expression to evaluate the property placeholder ${}, because they are evaluated at different times.
A solution is to use a Spring bean to store the properties, instead of a configuration properties placeholder. Then you can assign it to a flow variable and access it like a map.
Example:
<spring:beans>
<spring:bean id="myProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<spring:property name="location" value="classpath:items.properties"/>
</spring:bean>
</spring:beans>
<flow name="myFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-variable value="#[app.registry.myProperties]" variableName="props"></set-variable>
<logger message="a=#[flowVars.props['a']]" level="INFO"/>
</flow>
items.properties:
a=1
b=2
c=3
Output:
a=1

IgniteConfiguration properties - do these properties still exist?

When porting from gridgain to ignite, I can't find matching properties for the following in IgniteConfiguration. Have they been totally purged or is there something else we should be using ?
<bean id="abstractGridConfiguration" abstract="true"
class="org.apache.ignite.configuration.IgniteConfiguration">
.......
<!--<property name="restEnabled" value="false"/>-->
<!--<property name="executorServiceShutdown" value="true"/>-->
<!--<property name="systemExecutorServiceShutdown" value="true"/>-->
To disable REST add this:
<property name="connectorConfiguration"><null/></property>
As for the thread pools, in Ignite you can only specify sizes (see IgniteConfiguration.setXxxThreadPoolSize() properties). Thus having shutdown flags doesn't make sense anymore.

Spring Webflow Flow Registry Configuration

Please bear with me as this is my first question. Let me know what I can do to improve future questions.
I am trying to learn Spring Webflow, and am slowly wrapping my head around it. I am finding that there are a lot of conventions that the programmer is expected to "just know", and the examples online don't seem to work.
I have cobbled together one example that works as expected, but now I am trying to extend my understanding to the next level in another small project, with my long term goal being a much more complex application. The goal of this exercise is to build a login system that supports different types of client (phone, desktop, etc) with different webflows.
As near as I can tell, I am having trouble configuring the flow registry, probably because I am misunderstanding the convention.
The textbook example I am emulating is this:
<!-- The registry of executable flow definitions -->
<webflow:flow-registry flow-builder-services="flowBuilderServices"
id="flowRegistry" base-path="/WEB-INF/flows/">
<webflow:flow-location path="/welcome/welcome.xml" />
</webflow:flow-registry>
My configuration is this:
<!-- The registry of executable flow definitions -->
<webflow:flow-registry id="flowRegistry"
flow-builder-services="flowBuilderServices"
base-path="/WEB-INF/pages/">
<webflow:flow-location path="d/login.xml" />
<webflow:flow-location path="d/signup.xml" />
</webflow:flow-registry>
The log states:
DEBUG o.s.w.d.r.FlowDefinitionRegistryImpl - Registering flow definition 'ServletContext resource [/WEB-INF/pages/d/login.xml]' under id 'd'
DEBUG o.s.w.d.r.FlowDefinitionRegistryImpl - Registering flow definition 'ServletContext resource [/WEB-INF/pages/d/signup.xml]' under id 'd'
Since, under the covers, the flow registry is a simple HashMap, only one of the flow files is being registered, and not as what I would expect.
What am I missing?
Change configuration as mentioned below, this might help you:
<webflow:flow-registry id="flowRegistry"
flow-builder-services="flowBuilderServices"
base-path="/WEB-INF/pages">
<webflow:flow-location path="/d/login.xml" />
<webflow:flow-location path="/d/signup.xml" />
</webflow:flow-registry>
also see Spring Webflow - How to Get List of FLOW IDs

Strange error with MvcSiteMapProvider. It some how find 2 root nodes

I am using MvcSiteMapNode without xml just with the decorator's way. As i said in this post
I am sure that i have only one node with empty root node. Also it always works, except some times that i get this error.
There is more than one node declared without a parent key. The parent
key must be set for all but 1 node in the SiteMap. The node with no
parent key will be considered the root node. Note that when defining
nodes in XML, the XML file must contain the root node.
You can disable XML configuration by setting the
MvcSiteMapProvider_EnableSiteMapFile setting to "false". For an
external DI configuration, you can disable XML parsing by removing the
XmlSiteMapNodeProvider from the MvcSiteMapProvider DI module.
Alternatively, you can set the MvcSiteMapProvider_IncludeRootNodeFromSiteMapFile setting to "false"
to exclude the root node from the XML file, but include all of the
other nodes. For an external DI configuration, this setting can be
found on the constructor of the XmlSiteMapNodeProvider.
SiteMapCacheKey: 'sitemap://localhost/'
Ambiguous Root Nodes:
ParentKey: '' | Controller: 'Home' | Action: 'Index' | Area: 'Admin' |
URL: '/Admin' | Key: 'root' | Source: 'MvcSiteMapNodeAttribute'
ParentKey: '' | Controller: 'Home' | Action: 'Index' | Area: 'Admin' |
URL: '/Admin' | Key: 'root' | Source: 'MvcSiteMapNodeAttribute'
my App.Settings
<add key="MvcSiteMapProvider_EnableSiteMapFile" value="false" />
<add key="MvcSiteMapProvider_IncludeRootNodeFromSiteMapFile" value="false" />
<add key="MvcSiteMapProvider_IncludeAssembliesForScan" value="dllmain,dll2" />
<add key="MvcSiteMapProvider_UseExternalDIContainer" value="false" />
<add key="MvcSiteMapProvider_ScanAssembliesForSiteMapNodes" value="true" />
I think it has to do, with the way sitemap is it initialized. It might be vulnerable to cross-thread operation. It might get double initialized.
Do you have any advice for this?
Thanks in advance.
Please have a look at this answer for help with setting up MvcSiteMapProvider with areas. The routes have to be configured using the correct conventions or it won't work right.
If you are certain that you only have 1 node in your entire site that has not set the parent node (or has set it to null or empty string) AND you are using [MvcSiteMapNode] attributes, this could be caused by the assemblies being loaded into the AppDomain more than one time. Check the AppDomain.CurrentDomain.GetAssemblies() method to see if your target assemblies (in this case dllmain and dll2) are in the result more than once.

How to change value of existing variables in Cruise control config file

I have created a variable in cruise control configuration file
I want to change the value of this variable in cruise control later during execution. Basically what I want is while executing task1, value of 'MyVariable' should be say 'val1' and while executing task2, value should be say 'val2'.
One more thing that I want is, there should be no manual interaction or manual assignment from ui, the value should be changed automatically.
Can anybody please help me in achieving this? Any suggestion/ inputs would be great help. Thanks in advance.
I'm using the following approach to compile one MSBuild with different parameters (ccnet 1.8):
<cb:define name="Build">
<msbuild>
<some_parameter>$(MyVariable)</some_parameter>
<other_parameter>parameter_value</other_parameter>
</msbuild>
</cb:define>
and then in tasks section:
<cb:Build MyVariable="val1" />
<cb:Build MyVariable="val2" />
If those values of MyVariable are constant (I mean always the same for given task) then I'd use preprocessor. Then you can override the value with cb:scope.
For example, here's what I do with projects configuration:
<cb:scope
Project.Name = "ProjectName - Feedback - Integration tests"
Project.ShortName = "project-name-feedback-quick"
Project.Category = "Project Name - Feedback"
Project.Description = "Run integration tests"
>
<project name="$(Project.Name)" description="$(Project.Description)">
<artifactDirectory>$(CIRootFolderPath)\$(Project.ShortName)\Artifacts</artifactDirectory>
<workingDirectory>$(CIRootFolderPath)\$(Project.ShortName)\WorkingDir</workingDirectory>
<state type="state" directory="$(CIRootFolderPath)\$(Project.ShortName)" />
So you would surround each <task> with <cb:scope> block and redefine value of MyVariable in there.

Resources