Merging C++/CLI Console App with dll's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wylbur
    New Member
    • Mar 2010
    • 3

    Merging C++/CLI Console App with dll's

    Hi all;

    I would like to merge a C++/CLI console exe with some dll's to produce
    one small package for distribution.

    Does anyone know how to do this?

    Thanks!
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Visual Studio has a "publish" feature you can look into. Otherwise what kind of packaging scheme are you looking to use? RPM, DEB, you can use nullsoft install suite.

    Comment

    • Wylbur
      New Member
      • Mar 2010
      • 3

      #3
      Hi RedSon;


      > Visual Studio has a "publish" feature you can look into.

      From what I've seen of it, this seems like a web apps tool for installing a
      completed web app to a web server - which is not quite what I am after here.

      I've yet to see anything relating to a windows console app, but I'll keep looking
      after I've posted this.

      I would think that there would be a simpler way.

      I thought I had found it a while ago, but I have a bit of a problem ...


      > Otherwise what kind of packaging scheme are you looking to use?
      > RPM, DEB, you can use nullsoft install suite.

      What I am after is an exe that is "self-contained", where the dll's are extracted
      at runtime and made available to the app.

      So far, I've found ILMerge.
      Explore research at Microsoft, a site featuring the impact of research along with publications, products, downloads, and research careers.



      I've tried to use it, but I've ran into a bit of a problem.


      Running this from a batch file,
      =============== =============== =============== ======
      @set exefile="F:\Pro gram Files\Microsoft \ILMerge\ILMerg e.exe"
      @set dmsvcr90="F:\Pr ogram Files\Microsoft Visual Studio 9.0\VC\redist\x 86\Microsoft.VC 90.CRT\msvcr90. dll"
      %exefile% /target:winexe /out:test.exe test01.exe %dmsvcr90%
      =============== =============== =============== ======


      I get the following error message:
      =============== =============== =============== ======
      An exception occurred during merging:
      ILMerge.Merge: Could not load assembly from the location
      'F:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x 86
      \Microsoft.VC90 .CRT\msvcr90.dl l'.
      Skipping and processing rest of arguments.
      at ILMerging.ILMer ge.Merge()
      at ILMerging.ILMer ge.Main(String[] args)
      =============== =============== =============== ======


      I've used Windows Explorer to navigate to that folder, and I can see that
      the file is indeed there.


      The executable was compiled with the following command line parameters
      in a build operation with Visual Studio 2008:
      =============== =============== =============== ======
      /GL /D "WIN32" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MD
      /Fo"Release\\" /Fd"Release\vc90 .pdb" /W3 /nologo /c /Zi /clr:safe
      /TP /errorReport:pro mpt
      /FU "c:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\System.dll"
      /FU "c:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\System.Data.d ll"
      /FU "c:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\System.XML.dl l"
      /FU "c:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\mscorlib.dll"
      =============== =============== =============== ======

      Linking with the following:
      =============== =============== =============== ======
      /OUT:"N:\Project s\testing\Relea se\test01.exe"
      /INCREMENTAL:NO /NOLOGO /MANIFEST
      /MANIFESTFILE:"R elease\test01.e xe.intermediate .manifest"
      /MANIFESTUAC:"le vel='asInvoker' uiAccess='false '" /LTCG /DYNAMICBASE
      /FIXED:No /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PRO MPT
      =============== =============== =============== ======


      I tried to add the dll as a reference in project > properties, but it came
      back with the following error message:
      =============== =============== =============== ======
      Could not add a reference to the file
      'F:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x 86\Microsoft.VC 90.CRT\msvcr90. dll'
      bacause it is neither a .NET assembly or registered ActiveX control.
      =============== =============== =============== ======


      GRRRRRR!!!

      Why could ILMerge not load the assembly?

      Could it be because it is "neither a .NET assembly [n]or registered ActiveX control."?

      Any ideas?

      Thanks for the response!!!

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        I'm pretty sure you can publish and make an .msi file which you can install on your computer.

        Comment

        • Wylbur
          New Member
          • Mar 2010
          • 3

          #5
          Hi RedSon;

          > I'm pretty sure you can publish and make an .msi file which you can install on your computer.

          Perhaps, but I'd rather create a simple executable that doesn't require
          installation - much like the executables back in the days of DOS.

          From what I've seen so far, I believe that there is a way to do this.
          I just haven't figured out the "odds-and-ends" of that process.

          Maybe someone else reading this forum has done this before (?)

          Thanks for the response!!!

          Comment

          Working...