Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WiX and the MStudioDAQmx.2012 merge module

Solved!
Go to solution

I am using Visual Studio 2012 + NI-DAQmx 9.7.5 (and tried 9.7.0 before that) and want to create an installer that includes the necessary merge modules MStudioDAQmx.2012.msm, its dependency MStudioCommon.2012.msm (and the Visual Studio C++ runtime) using WiX.

 

My problem is that the files contained in MStudioCommon.2012.msm seem to be installed in the GAC, where they belong, but the two files contained in MStudioDAQmx.2012.msm are copied into a folder "Module Retargetable Folder" in the installation directory - and that's where they IMHO do not belong. The difference between MStudioCommon.2012.msm and MStudioDAQmx.2012.msm is that, although both contain a custom action that rewrites the  MergeRedirectFolder into a GAC folder,

 

MStudioCommon.2012.msm:

CA_RetargetDir.1C9B2EB5_9E34_4944_BA92_B30CCA4E9205    51    MergeRedirectFolder.1C9B2EB5_9E34_4944_BA92_B30CCA4E9205    [GAC.1C9B2EB5_9E34_4944_BA92_B30CCA4E9205]   

MStudioDAQmx.2012.msm:

CA_RetargetDir.58D97DB1_77E6_476E_9B14_C9529BFA6F94    51    MergeRedirectFolder.58D97DB1_77E6_476E_9B14_C9529BFA6F94    [GAC.58D97DB1_77E6_476E_9B14_C9529BFA6F94]    

Only MStudioCommon.2012.msm contains such a directory (GAC.1C9B2EB5_9E34_4944_BA92_B30CCA4E9205) in its directory table.

 

MergeRedirectFolder.1C9B2EB5_9E34_4944_BA92_B30CCA4E9205    TARGETDIR    tdf6yy0s|Module Retargetable Folder
GAC.1C9B2EB5_9E34_4944_BA92_B30CCA4E9205    TARGETDIR    boziguka|Global Assembly Cache
TARGETDIR        SourceDir

 

MStudioDAQmx.2012.msm is missing such an entry.

MergeRedirectFolder.58D97DB1_77E6_476E_9B14_C9529BFA6F94    TARGETDIR    tdf6yy0s|Module Retargetable Folder
TARGETDIR        SourceDir

 

Is this the reason why the two files are installed in the wrong directory or am I doing something wrong? The corresponding parts of the WXS files are the following:

 

...

<Merge Id="VCRedist100" SourceFile="$(var.MergeModulesFilesDir)\Microsoft_VC100_CRT_x86.msm" DiskId="1" Language="0"/>
<Merge Id="MStudioCommon.2012" SourceFile="$(var.MergeModulesFilesDir)\MStudioCommon.2012.msm" DiskId="1" Language="0"/>
<Merge Id="MStudioDAQmx.2012" SourceFile="$(var.MergeModulesFilesDir)\MStudioDAQmx.2012.msm" DiskId="1" Language="0"/>

...

 

...

<Feature Id="VCRedist" Title="Visual C++ 10.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1">
      <MergeRef Id="VCRedist100"/>

</Feature>
    
<Feature Id="MStudioCommon" Title="Measurement Studio Files" AllowAdvertise="no" Display="hidden" Level="1">
      <MergeRef Id="MStudioCommon.2012"/>
      <MergeRef Id="MStudioDAQmx.2012"/>
</Feature>

...

 

I searched the web for two days, but cannot figure out what my mistake is. Any help is appreciated.

0 Kudos
Message 1 of 10
(8,076 Views)

Hi Burlow,

 

why didn't you use the setup projects provided by the Visual Studio IDE?

 

Regards,

Lars

0 Kudos
Message 2 of 10
(8,036 Views)

Hi Lars,

 

I am not sure I understand your question correctly. WiX is - as far as I know - the installer recommended by NI (see page 1-7 in http://www.ni.com/pdf/manuals/373225c.pdf - Visual Studio 2012 only offers "InstallShield Limited Edition" which needs to be activated). The "rest" of the installer works fine. It's just that this merge-module is installed in the wrong directory and I do not understand why. 

 

It is just my guess that something is wrong with this merge-module since the above mentioned document also states that "Measurement Studio merge modules for Visual Studio 2012 install the Measurement Studio assemblies by default to the Global Assembly Cache (GAC)."

 

Note: I do not own Measurement Studio and use only the examples and DLLs provided by the NI-DAQmx installer. The merge-modules are the same.

 

Regards & Thanks

 

Stephan

 

0 Kudos
Message 3 of 10
(8,019 Views)

Hi Stephan,

 

You are not using the Measurement Studio merge module, what you see is the DAQmx merge module.

 

The Measurement Studio merge module is installed with Measurement Studio, it's not exactly the same as the DAQmx merge module.

The dependencies are installed with Measurement Studio and the user guide is meant to work with installed measurement studio merge modules, wich contain additional functionalities and informations as well as datatypes.

 

The merge modules are installed, where they are supposed to be. if you want certain files to end up in different directories, you can always use the WIX module to change the locations after the installation is made. Be sure to double check the paths.

 

Unfortunately the WIX module itself is open source, although it's recommended by National Instruments to use, it's most likely not support by National Instruments, because of it beeing open source.

 

Best Regards,

Lars

 

 

 

0 Kudos
Message 4 of 10
(7,984 Views)

Hi Lars,

 

thanks for the reply. In this case the names of the NI-DAQmx merge-modules seem rather unsuitable ("MStudio.....") and the DLL names seem to be identical too if I am not mistaken. Additionally the reason for the existence of the CA_RetargetDir rule in one of the merge-modules still eludes me, since it is missing the respective target.

 

I'll give retargeting the merge module via "ConfigurationData" a try.

 

Cheers & Thanks a lot

 

Stephan

0 Kudos
Message 5 of 10
(7,979 Views)
Solution
Accepted by topic author Burlow

.... to answer myself. Perhaps this will help someone else:

 

I had a look at the "Deployment" example in the evaluation-version of Measurement Studio 2013.

 

1.) The merge module MStudioCommon* seems to be identical for both NI-DAQmx and the Measurement Studio 2013. The "Deployment" example of the Measurement Studio also works in the case of the NI_DAQmx MStudioCommon* merge module.

 

2.) The following fragment installs the MStudioDAQmx* merge module in the installation directory. I am not 100% sure whether the two additional ConfigurationData lines are necessary or not. This works, and I did not try to remove the two lines. Feel free to try.

 

<Fragment>
    <DirectoryRef Id="INSTALLDIR" DiskId="1">
 
      <!-- Common x86 -->
      <?if $(var.Platform) = "x86" ?>
      <Merge Id="MStudioDAQmx" Language="0" SourceFile="$(var.MergeModulesDir)\MStudioDAQmx.2012.msm" >
        <ConfigurationData Name="ReconfiguredDir.58D97DB1_77E6_476E_9B14_C9529BFA6F94" Value="[INSTALLDIR]"/>
        <!-- I think one does not need the following two lines because the assembly won't be installed in the GAC anyway, -->
        <!-- since the CustomAction cannot(?) retarget the Source to a target not existing in the directory table -->
        <ConfigurationData Name="Config_DAQmxCompModel.58D97DB1_77E6_476E_9B14_C9529BFA6F94" Value="DAQmx.ComponentModel.dll.58D97DB1_77E6_476E_9B14_C9529BFA6F94"/>
        <ConfigurationData Name="Config_DAQmx.58D97DB1_77E6_476E_9B14_C9529BFA6F94" Value="DAQmx.dll.58D97DB1_77E6_476E_9B14_C9529BFA6F94"/>
      </Merge>
      <?endif?>
 
      <!-- Common x64 -->
      <?if $(var.Platform) = "x64" ?>
      <Merge Id="MStudioDAQmx" Language="0" SourceFile="$(var.MergeModulesDir)\MStudioDAQmx.2012_x64.msm" >
        <ConfigurationData Name="ReconfiguredDir.39EA4820_BBEB_48AD_B8AA_89A933155601" Value="[INSTALLDIR]"/>
        <!-- I think one does not need the following two lines because the assembly won't be installed in the GAC anyway, -->
        <!-- since the CustomAction cannot(?) retarget the Source to a target not existing in the directory table -->
        <ConfigurationData Name="Config_DAQmxCompModel.39EA4820_BBEB_48AD_B8AA_89A933155601" Value="DAQmx.ComponentModel.dll.39EA4820_BBEB_48AD_B8AA_89A933155601"/>
        <ConfigurationData Name="Config_DAQmx.39EA4820_BBEB_48AD_B8AA_89A933155601" Value="DAQmx.dll.39EA4820_BBEB_48AD_B8AA_89A933155601"/>
      </Merge>
      <?endif?>
      
    </DirectoryRef>

 
    <FeatureGroup Id="MStudioDAQmx_MergeModules">
      <!-- MStudioDAQmx -->
      <MergeRef Id="MStudioDAQmx" />
 
      <!-- Dependencies -->
      <?if $(var.Platform) = "x86" ?>
        <MergeRef Id="Microsoft_VC100_CRT_x86" />
        <MergeRef Id="MStudioCommon" />
      <?elseif $(var.Platform) = "x64" ?>
        <MergeRef Id="Microsoft_VC100_CRT_x64" />
        <MergeRef Id="MStudioCommon" />
      <?endif?>
    </FeatureGroup>
  </Fragment>

 plus

 

<FeatureGroupRef Id="MStudioDAQmx_MergeModules"/>

 in the <Feature> of the product.

 

3.) It would be great if NI could also ship such an example with the NI-DAQmx drivers.

 

Cheers

 

Stephan

Message 6 of 10
(7,951 Views)

Hi,

 

What is needed.. 😉

 

Getting started guide for Measurement Studio, DaqMX and WiX.. Simple step-by-step from a scratch..

 

I have been using InstallShield and use it also today in the old Visual Studio development environment. The new VS 2012 & MS 2013 are still waiting for a working deployment solution.

 

I have seen no development in this topic since last spring.. But maybe I am missing something..

 

Havea nice day,

Ilkka

 

0 Kudos
Message 7 of 10
(7,858 Views)

Thank you very much.. WiX installation is working now.. 😉 No need to use InstallShield anymore! 

 

BR, Ilkka

0 Kudos
Message 8 of 10
(7,800 Views)

Excellent work!

 

I really appreciate you coming back and posting this.  I think it would have taken me a long time to figure it out.  Your solution worked like a charm.

 

Unless my search attempts missed something, I don't believe that the NI R&D team has a WiX example showing how to add DaqMx merge modules.  They do have one with the Measurement Studio merge modules, but a very large percentage of MStudio apps (mine included) will also need DaqMx.

 

I've "housed" your <Fragment> in a .wxs file that can be dropped into a setup project based on NI's "All Libraries" WiX deployment example.  Just

 

  1. Unzip the archive
  2. Add the file to your Setup project
  3. Add <FeatureGroupRef Id="MStudioDAQmx_MergeModules"/> to the <Feature> element in Product.wxs.

 

Cheers,

Stephen

 

Message 9 of 10
(7,134 Views)

Hi Stephen, Everybody,

 

I don't understand why this isn't working for me?  I've followed all the instructions and I still get an exception when I launch my VB.NET application that says, "Could not load file or assembly 'NationalInstruments.DAQmx.dll' or one of its dependencies."

 

This should work such that I do not have to download and distribute the NI DAQmx installer to all my clients, correct?  (except where I'm actually talking to hardware)    

 

Any help is greatly appreciated!

 

Thanks,

 

Andy

0 Kudos
Message 10 of 10
(6,873 Views)