I would like to use %IF_INSTALLPATH% to set a Registry value with InstallForge, but it doesn't resolve the variable. So the registry value created is "%IF_INSTALLPATH%\bin" instead of "C:\MyApp\bin".
How can I use %IF_INSTALLPATH% in setting a registry value?
Related
I have a Wix Toolset project with a component such as the one below, where MYLANGUAGE is a public property that can be set when installing the product:
<Component Id='language_reg' Guid='*' Permanent='yes'>
<Condition>MYLANGUAGE</Condition>
<RegistryValue Type='string' Root='HKLM' Key='Software\MyCompany\MyProduct' Name='language'
Value='[MYLANGUAGE]' KeyPath='yes' />
</Component>
Now I am upgrading this software package from 32-bit 64-bit. The key above from the existing 32-bit versions of my software is stored under HKLM\Software\WOW6432Node\MyCompany\MyProduct because of WOW64.
After an upgrade to a new 64-bit version of the package the upgrade I would like to have the value set in the HKLM\Software\MyCompany\MyProduct key too. The value shall be set like this:
If the public property MYLANGUAGE is set when installing then the value of that property shall be stored in HKLM\Software\MyCompany\MyProduct language
If the public property MYLANGUAGE is not set and HKLM\Software\MyCompany\MyProduct key doesn't exist and HKLM\Software\WOW6432Node\MyCompany\MyProduct language value is set then I want the value copied from HKLM\Software\WOW6432Node\MyCompany\MyProduct language to HKLM\Software\MyCompany\MyProduct language
How can I do this with WIX Toolset?
This is the WiX remember property pattern but a little more complicated.
Define property MyLanguageDefault with a default value for MYLANGAUGE
Use AppSearch/Reglocator (Property/RegistrySearch) to read 64bit value into 64bit temp property.
Use AppSearch/Reglocator (Property/RegistrySearch) to read 32bit value into 32bit temp property.
Use SetProperty custom action to assign 64bit temp property to MYLANGUAGE if MYLANGUAGE is null (maybe they passed it at the command line ) and 64bit temp property is not null
Use SetProperty custom action to assign 32bit temp property to MYLANGUAGE if MYLANGUAGE is null (maybe they passed it at the command line ) and 32bit temp property is not null
Use SetProperty custom action to assign MyLanguageDefault to MYLANAGUGE if MYLANGUAGE is null (nothing passed at command line and nothing found in 32bit or 64bit then use default value )
Display MYLANGUAGE in a dialog if you want them to be able to be able to edit it.
Use MYLANAGUAGE in a Component/RegistryValue to write the value to the 64bit registry. The component needs to have the Win64 attribute set to yes.
Please note that MYLANGUAGE also needs to be marked as a Secure Custom Public Property by using the Secure="yes" attribute.
I'd like to use something similar to the following in my web.xml:
<param-value>${CONF_DIR:config/files}/my.xml</param-value>
but I'd like to use the default not only if $CONF_DIR is not set but also when it's empty string.
When you create a new key there is always a (Standard) value inside, which is a REG_SZ.In one case I want it to be a REG_EXPAND_SZ.How do I do it?I want to do this so I can link a custom URI protocol to a file that can only be found via %APPDATA%. If you put a path with a sysvar like that in a REG_SZ it doesn't seem to work.
Try using RegSetKeyValue and set dwType argument set to REG_EXPAND_SZ.
Using QTP, I need to import environmental variables from an XML sheet, but there that is the imported ones are the imported Environmental variables are on read only mode, it cannot be edited.
I need to know if there is any way to import environment variables and edit them and i need to know, somehow, is there any method to create environment variables from code(programmatically)
To create environment variables from code, use below loc:
Environment("variablename")="Variablevalue" ' Create and intialise environment variable
Print Environment("variablename") 'To retrieve value of variable
How can I declare a variable name by using the value of a property?
For example, I have the property propertyName with the value propertyValue. I want to declare a variable with the name propertyValue.
I've tried like ${${__P(variableName)}} but such constructions doesnt work.
You may need to evaluate the property name, using the ${__V()} function.
Thus, you'd probably end up with something like ${__V(${__P(propertyName)})} which would only declare a variable with a null value.
Basics on properties & command line:
if you need to pass variables through the command line, properties are indeed the correct choice.
The flag to set a property is -JpropertyName The function to read a property is ${__P(propertyName)}
For full details, see:
http://wiki.apache.org/jakarta-jmeter/JMeterFAQ#How_do_I_pass_parameters_into_my_Test_scripts.3F_I_want_to_be_able_to_use_the_same_script_to_test_with_different_numbers_of_threads_and_loops.2C_and_I_don.27t_want_to_have_to_change_the_script_each_time.
Give up using properties files, try using Variables From CSV plugin. It is pretty simple and robust way to have variables loaded from file.
Property files are great!!! For my requirement, I have created a simple config element for JMeter to read property files.
Please check here.
http://www.testautomationguru.com/jmeter-property-file-reader-a-custom-config-element.