I can define a product version variable like so :
<?define ProductVersion="!(bind.FileVersion.ServiceExeFile)" ?>
which I can reference inside string parameters like this :
$(var.ProductVersion)
..but it is displayed as literal text if I use it in my InstanceTransforms productName parameter.
Can anyone suggest how I might work around this?
Related
I am having installer with version 1.2.3.4, which is hardcoded in wxs file as below:
<Product Id="B91BEF19-0975-DB9185E716FC" Name="Installer" Language="1033" Version="1.2.3.4" Manufacturer="XX" UpgradeCode="c2a8ba27-bb8-186cbcd4d743">
Now i need to change the version like "1.2.3.4_temp".i.e, assigning the string to version.
As we know version attribute takes x.x.x.x and x as integer.
Is any way to get the version as 1.2.3.4_temp?
Is any way to assign ProductName (as xxxx) to version in wxs file?
You need to use product version as a numeric value.
Though Wix toolset documentation says Version attribute as The product's version string, you need to look up at the Windows Installer documentation for details about Version attribute.
It says for ProductVersion : "String format of the product version as a numeric value. (Required)"
For details about ProductVersion, please go to this link.
How to assign dynamic variable value from file in izPack.
Can you please post some code snippet?
I tried it with the following syntax:
<variable name="EXIST_IP_ADDRESS" file="${INSTALL_PATH}/test.properties"
type="options" key="IpAddress"/>
But am getting error says that value attribute is mandatory. If I assign value with some string then this cannot be loaded from file. Please check what mistakes am doing.
Dynamic variables have their own section, I guess you are trying to use it in "variables" section.
<dynamicvariables>
<variable name="previous.JAVA_HOME" escape="false" file="${INSTALL_PATH}/run.cmd" type="options" key="SET JRE" ignorefailure="true">
</dynamicvariables>
We can get the productversion in wix using !(bind.fileVersion.Product.exe). This returns the version as 3.8.2363.0. How can I get the version up to build version, i.e. 3.8.2363.
I followed Binding WIX FileVersion sub values? this link, but using
"!(bind.property.ProductVersion.Major)" do not solve my problem.
<?define ProductVersion123="!(bind.fileVersion.mainexe_dll)" ?>
<Product Id="{7BDF78BF-95E8-4ABB-8A0F-4A1483D7FDD1}" Name="SpreadsheetConverter !(bind.property.ProductVersion123.Major)" Language="1033" Version="!(bind.property.ProductVersion123.Major)" Manufacturer="ABC" UpgradeCode="$(var.ProductUpgradeCode)" Codepage="1252">
This gives error:
Unresolved bind-time variable Mainexe !(bind.property.ProductVersion123.Major).
Please Help.
Thanks
You have to realize what !(bind.property.X) does. It retrieves the value of the X property from the MSI's Property table. You have not setup a ProductVersion123 property in the MSI, you have created a WiX preprocessor variable ProductVersion123.
So what you have to do is assign the Product's Version attribute to $(var.ProductVersion123) (which sets the ProductVersion property of the MSI). Now you can access that with !(bind.property.ProductVersion), including the !(bind.property.ProductVersion.X) extensions.
One of my goals in creating the bootstrap project is to set a default log location. I would like the location to be based on the local app data folder. I cannot figure out how to reference the builtin Burn variable LocalAppDataFolder. I have found information about how to reference these variables in code, but not in the xml.
The reference to the property looks like this:
<MsiPackage SourceFile="MyInstaller.msi" LogPathVariable="[LogLocation]" />
The property is set like this:
<Variable Name="LogLocation" Value="[LocalAppDataFolder]MyLogFolder\Setup" Type="string"/>
The log output shows:
Initializing string variable 'LogLocation' to value
'[LocalAppDataFolder]MyLogFolder\Setup'
What am I missing to resolve [LocalAppDataFolder] ?
thanks in advance.
It's normal for the log output to show the un-formatted value, so that part looks correct. I think what you are missing is LogPathVariable should be specified without the brackets.
<MsiPackage SourceFile="MyInstaller.msi" LogPathVariable="LogLocation" />
I have a defines.wxi-file which contains some good definitions used in all my wxs-files.
When I attempt to reference the defined value from one of the <Fragment>-files I get Undefined preprocessor variable '$(var.IMAGE_FOLDER)' back in my face.
I guess there is something trivial I am missing here...
Any ideas?
Edit 19:th April.
Found that issue only occurs if reference from a Fragment-file.
Re-wrote sample to match that.
defines.wxi
<Include>
<?define IMAGE_FOLDER="Images" ?>
</Include>
some-Fragment.wxs
<Fragment>
<?Include defines.wxi ?>
<Component Id='c.Images' Guid=".." Directory='INSTALLDIR.Images' >
<File Id='f.sample.jpg' Source='$(var.IMAGE_FOLDER)sample.jpg' Name='sample.jpg' />
</Component>
Solved it.
Where it in the sample says:
<?Include defines.wxi ?>
it should be lower case...
<?include defines.wxi ?>
then it works like a charm!
/L
Ok, another try.
Do you reference anything in that <Fragment/> from the main <Product/> ? The contents of the fragment are visible to the rest of the code in case you reference anything from it. For instance, you can reference a component (<ComponentRef/>) or component group (<ComponentGroupRef/>). Once anything is referenced, the entire fragment is included.
Hope this helps.
In the text of the error message you provided it says "Undefined preprocessor variable '$(var.MAGE_FOLDER)'", not $(var.IMAGE_FOLDER) - the leading 'I' is missing. This made me think that you reference the same variable somewhere in the rest of your code, but misspelling it.
In this case, the candle.exe is absolutely right - it can find IMAGE_FOLDER, but can't find MAGE_FOLDER.
Hope this is the case and you'll fix it quickly. ;-)