[wix-users] unable to make AssemblyFileVersion work

Brannon King Brannon.King at asirobots.com
Thu Jan 28 16:09:34 PST 2016


I was never able to get assemblyFileVersion to compile. However, the fileVersion binding started working correctly for me after I marked my executable with Assembly=".net" . It now returns the file version instead of the assembly version, which is what I wanted.




From: Phill Hogland<mailto:phill.hogland at rimage.com>
Sent: Thursday, January 21, 2016 3:37 PM
To: WiX Toolset Users Mailing List<mailto:wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] unable to make AssemblyFileVersion work

Another observation is that Product/@Version needs to exist prior to compile time so the compiler can use the version number.  A named bindpath variable as you defined it is only resolved in the binding phase after linking.  I use MSBuild to get/generate the version string and either have MSBuild generate a .wxi file or use a MSBuild property with a -d Comipler Tool Setting

 -dPreprocessorVar="$(MSBuildProperty)"

To define a preprocessor var to be used as $(var. PreprocessorVar)



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Brannon King
Sent: Thursday, January 21, 2016 4:28 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] unable to make AssemblyFileVersion work

Thanks for the suggestion. I just attempted it with no luck. It appears that approach is for custom bindings. I’m not attempting to use a custom binding. According to the documentation, assemblyFileVersion is built in: http://wixtoolset.org/documentation/manual/v3/overview/light.html

The documentation on the “-b” is somewhat confusing: it says it defaults to the current directory. I assume that is the WSX directory, similar to how C# projects compile. I doubt any files get copied into that folder during a build. However, it can clearly match files from any source directory. After all, using bind.fileVersion.* works fine for me (but I need the other version number).


From: Phill Hogland<mailto:phill.hogland at rimage.com>
Sent: Thursday, January 21, 2016 3:02 PM
To: WiX Toolset Users Mailing List<mailto:wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] unable to make AssemblyFileVersion work

A named binding path is generally defined in the .wixproj file ( or in the VS IDE select the Project's Properties and look at the Tool Settings page).  Look for something like this:

-b assemblyFileVersion =some_path

Or (if the path has spaces enclose in quotes with two trailing backslashes
-b assemblyFileVersion ="some path\\"



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Brannon King
Sent: Thursday, January 21, 2016 3:52 PM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] unable to make AssemblyFileVersion work

I'm attempting to use the AssemblyFileVersion binding (as seen in the full WSX below). I always get this compilation error:

error LGHT0298: Unresolved bind-time variable !(bind.assemblyFileVersion.filMobiusExe)

Can you see something wrong? I've declared my referenced filMobiusExe as a .net assembly, which it is a .NET executable. Do I need to use some additional command line switch or extension? I'm using 3.10.2.2516. I use Heat to generate the AsiWix_Generated ComponentGroup.


<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
         xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

    <Product
        Id="..."
        Name="MyStuff"
        Language="1033"
        Version="!(bind.assemblyFileVersion.filMobiusExe)"
        Manufacturer="Autonomous Solutions, Inc."
        UpgradeCode="...">

        <Package Id="*"
         InstallerVersion="200"
         Compressed="yes"
         InstallScope="perMachine"
         Description="My Stuff"/>
        <Property Id="TARGETSERVERADDRESS" Value="http://localhost:18080/"/<http://localhost:18080/%22/>>

        <MediaTemplate EmbedCab="yes" CompressionLevel="high" MaximumUncompressedMediaSize="10000"/>

        <Property Id="ARPNOREPAIR" Value="yes" Secure="yes" />
        <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
        <Property Id="MSIFASTINSTALL" Value="1" /><!-- disable restore point creation -->

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramMenuFolder">
                <Directory Id="ProgramMenuDirAsiRoot" Name="ASI">
                    <Directory Id="ProgramMenuDirAsi" Name="Mobius">
                    </Directory>
                </Directory>
            </Directory>

            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLDIRROOT" Name="ASI">
                    <Directory Id="INSTALLDIR" Name="Mobius">
                        <Component Id="cmpMobiusExe" Guid="*">
                            <File Id="filMobiusExe" KeyPath="yes" Source="$(var.AsiWixSourceDir)\Mobius.exe" Vital="yes" Assembly=".net"
                                    AssemblyApplication="filMobiusExe" ProcessorArchitecture="msil">
                                <Shortcut Id="ApplicationStartMenuShortcut" Name="Mobius" Description="Client" WorkingDirectory="INSTALLDIR" Advertise="yes" Directory="ProgramMenuDirAsi" />
                            </File>
                            <File Id="filMobiusConfig" Source="$(var.AsiWixSourceDir)\Mobius.exe.config" />
                        </Component>
                    </Directory>
                </Directory>
            </Directory>
        </Directory>

        <Component Id="SetConfigToServerAddress" Guid="..." KeyPath="yes" Directory="INSTALLDIR">
            <Condition>TARGETSERVERADDRESS</Condition>
            <util:XmlFile Id="AppConfigSetServerAddress" Action="setValue" Permanent="yes"
                        File="#filMobiusConfig" Name="value"
                        ElementPath="/configuration/appSettings/add[\[]@key='ServerAddress'[\]]"
                        Value="[TARGETSERVERADDRESS]" />
        </Component>

        <Component Id="SetConfigToServerExe" Guid="..." KeyPath="yes" Directory="INSTALLDIR">
            <Condition>TARGETSERVEREXE</Condition>
            <util:XmlFile Id="AppConfigSetServerExecutable" Action="setValue" Permanent="yes"
                        File="#filMobiusConfig" Name="value"
                        ElementPath="/configuration/appSettings/add[\[]@key='ServerPath'[\]]"
                        Value="[TARGETSERVEREXE]" />
        </Component>

        <Feature Id="ProductFeature" Title="Mobius.Setup" Level="1">
            <ComponentRef Id="cmpMobiusExe"/>
            <ComponentGroupRef Id="AsiWix_Generated"/>
            <ComponentRef Id="SetConfigToServerAddress"/>
            <ComponentRef Id="SetConfigToServerExe"/>
        </Feature>

        <SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize" />
    </Product>

</Wix>

PS This is reposted from StackOverflow due to lack of support in that venue.
This message contains confidential information and is intended only for the recipient. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately if you have received this e-mail by mistake and delete this e-mail from your system. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

This message contains confidential information and is intended only for the recipient. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately if you have received this e-mail by mistake and delete this e-mail from your system. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

This message contains confidential information and is intended only for the recipient. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately if you have received this e-mail by mistake and delete this e-mail from your system. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.


More information about the wix-users mailing list