Harvesting referenced assemblies does not work

Add-in Express™ Support Service
That's what is more important than anything else

Harvesting referenced assemblies does not work
 
Leonid Yankulin




Posts: 7
Joined: 2014-05-22
I used vdproj to wix converter for VS2010 setups. The resulted project launch heat.exe with project argument to retrieve output of the referenced project. However, in WiX 3 the heat.exe has a bug which cause to retrieve only the primary output of the project and it does not harvest all referenced assemblies that are copied into the project output folder. It is advised to use heat.exe with dir option instead and bring on all files that the project build yields to the project output directory.
Please, advise what should be changed in the output of the converter so I can have a working WiX setup.

Thank you,
Leonid
Posted 12 Jun, 2014 03:23:00 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Leonid,

The Converter product scans all referenced assemblies and adds them as usual files during conversion. So, the resulting WiX project should have all assemblies. Please check this.
Posted 12 Jun, 2014 06:19:15 Top
Leonid Yankulin




Posts: 7
Joined: 2014-05-22
There is a misunderstanding about a term of "referenced assemblies". The converter takes every files or project that is referenced by the setup project and does what you said. However, the original vdproj knows to take the referenced project and all assemblies that the project is referencing too. For example, the solution has Project1 and Setup1 projects. Project1 references 3rd party assemblies Assembly1 and Assembly2 and Setup1 references File1 and output of the Project1.
For above configuration the vdproj setup creates an installation containing Project1, Assembly1, Assembly2 and File1. The wix setup that the converter creates will build an installation containing Project1 and File1.
It is happening because "heat.exe project Project1" harvests *ONLY* the binary file that the project Project1 creates i.e. primary output of the Project1. See http://sourceforge.net/p/wix/bugs/2082/ about the problem with heat.exe
My problem is that the converter does not produce the same installation setup as the original vdproj does.
There is a workaround by using "heat.exe. dir Project1/bin/$(Configuration)" which harvests all files that are in the output dir of the Project1. However, it is unclear how this workaround can be applied for the result of the converter work.
Posted 12 Jun, 2014 06:50:07 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Leonid,

Probably I do not quite understand the root of the problem you are faced with. I have just created a small Windows Forms Application that contains two "3rd party" assemblies in the References section. Then I created a vdproj setup project and added the Primary Output of my application to the Application Folder. Please have a look at what I got:
User added an image

Note, I have Assembly1 and Assembly2 in the References section of my main project *as well as* in the Detected Dependencies section of my vdproj setup project.

Then I converted the vdproj setup project and got the following in the Product.wxs file:

<!-- The directory tree of the installation package. -->
<Directory Id='TARGETDIR' Name='SourceDir'>
    <Component Id='com_07477707_8844_4833_B93A_AC21F370D8BD' Guid='FEF6A85C-8237-41DD-ACD5-B0609424E2BB' Permanent='no' SharedDllRefCount='no' Transitive='no'>
        <File Id='_07477707_8844_4833_B93A_AC21F370D8BD' DiskId='1' Hidden='no' ReadOnly='no' System='no' Vital='yes' Compressed='yes' Name='Assembly1.dll' Source='..Assembly1inDebugAssembly1.dll' KeyPath='yes' />
    </Component>
    <Component Id='com_773F9677_A296_081C_C5F7_A39843F3441E' Guid='069A9673-ECE6-4F49-B644-6A52A4321E2E' Permanent='no' SharedDllRefCount='no' Transitive='no'>
        <File Id='_773F9677_A296_081C_C5F7_A39843F3441E' DiskId='1' Hidden='no' ReadOnly='no' System='no' Vital='yes' Compressed='yes' Name='Assembly2.dll' Source='..Assembly2inDebugAssembly2.dll' KeyPath='yes' />
    </Component>
    <!-- The 'TestApplication' project output. -->
    <Directory Id='TestApplication.Binaries' />
</Directory>


As you can see, I have got 3 items in the target folder - my project output and 2 referenced assemblies. Is this what you are trying to achieve? Please let me know.
Posted 12 Jun, 2014 07:28:45 Top
Leonid Yankulin




Posts: 7
Joined: 2014-05-22
I do not know how to append pictures to the post. However, I see a discrepancy between Detected dependencies in setup project and references of the project which primary output i like to setup.
As well, your example shows that if I change references of my project, the wix setup will not pick them up as result of the wix script that converter produces.
I would like to rephrase the question then:
Is there any way that you can advise about changing invokation of "heat.exe project" to be "heat.exe dir" so I guarantee that all references of the project will be *ALWAYS* attached to the setup regardless of the project evolution in the future?

Thank you,
Leonid
Posted 12 Jun, 2014 07:41:56 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Leonid,

I do not know how to append pictures to the post.


You need to upload a picture to a web-site, click the IMG button (it is located at the top of the Reply Form) and insert the full URL of the picture.

However, I see a discrepancy between Detected dependencies in setup project and references of the project which primary output i like to setup.


I can assume that your Visual Studio setup project (vdproj) is outdated or "broken" somehow. You can try to right-click the "Detected Dependencies" node and do "Refresh Dependencies". Probably this will solve the issue.

As well, your example shows that if I change references of my project, the wix setup will not pick them up as result of the wix script that converter produces.


Yes, it is so. The Converter is purposed for converting an existing Visual Studio setup project to WiX. In other words, the Converter creates a "copy" of your original Visual Studio setup project in WiX. You are responsible for all future modifications of the resulting WiX setup project.

Is there any way that you can advise about changing invokation of "heat.exe project" to be "heat.exe dir" so I guarantee that all references of the project will be *ALWAYS* attached to the setup regardless of the project evolution in the future?


Sorry, I don't know such a way.
Posted 12 Jun, 2014 08:29:38 Top
Leonid Yankulin




Posts: 7
Joined: 2014-05-22
OK. Got it about images (you do not have away to attach the image and can display it only with external storage).
The "Refresh Dependencies" option does not work. However, in the list of files that are added into Product.wxs I do not see even those files that appear in the Detected Dependencies list. I see only Project.Binaries file which is mapped by heat.exe to the output of the referenced project and another file which is explicitly added into vdproj file. I am sorry but the production case is always differs from home made test case. If I can provide you with some converter log, tell me how to generate it and I will send it. Unfortunately, I cannot upload projects as they are legacy software and part of the very large solution.
Posted 12 Jun, 2014 09:55:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Leonid,

Please add the following registry entry that instructs the converter to produce extra information in the Output window:

HKEY_LOCAL_MACHINE\SOFTWARE\Add-in Express\InstalledProducts\VDProj to WiX
Converter\
DWORD EnableLog = 1

After you create this entry you need to restart Visual Studio. Then please rebuild and re-convert the vdproj project.
Posted 12 Jun, 2014 12:09:48 Top
Leonid Yankulin




Posts: 7
Joined: 2014-05-22
OK. I forgot to mention that I convert vdproj in VS2013 which does not support Install projects. As result, I do not have "Detected Dependencies" folder in the vdproj of the VS2013. I will send you a log once I get to work.

Thank you,
Leonid
Posted 13 Jun, 2014 06:10:24 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Leonid,

As I mentioned in my previous posts, the Converter uses information from a vdproj file to retrieve a list of assemblies and their dependencies. I would suggest that you open your solution in Visual Studio 2010, make sure that your Visual Studio setup project contains all necessary project outputs and dependencies, build the setup project (to ensure it is built without errors and warnings), save the solution and then convert your setup project.
Posted 13 Jun, 2014 06:32:00 Top