0

I have an old C++ application that I have recently added CLR support to. This was so that I could use mage.exe to generate the manifest files necessary to create the app as a ClickOnce app. After some frustrating work, I was able to get the manifest files created.

Now, I want to create the setup.exe file similar to what you would get if you use the Publish option in a C# project. The file would check for the Prerequisites of .NET Framework 4.0, Windows Installer 3.1, and Visual C++ 2010 x86 Redistributable, and install if necessary.

I have tried using the Bootstrapper Manifest Generator but I am not sure how to get it to check for and install all 3 prerequisites and launch the ClickOnce .application file that I have. Documentation for the product is a little piecemeal.

I have also tried unsuccessfully to use msbuild /target:publish to imitate the publish option you would see in a C# project.

I have even tried editing the .vcxproj file to include a BootstrapperFile (as demonstrated here: http://msdn.microsoft.com/en-us/library/ms164294.aspx and CustomAction succeeds on development computer, fails on deployment computer) to no avail.

Is it possible to add some dependency in my application manifest (myapp.exe.manifest) similar to how the CLR is set as a preRequisite?

<dependency>
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
          <assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.30319.0" />
</dependentAssembly>
</dependency>

So, can anyone provide any guidance as to how I might generate an install package that checks for the prerequisites I mentioned above, install if necessary, then launch my ClickOnce .application file? I think the difficult part here is that it is a C++ CLI Clickonce application and there is no IDE support to create the setup package.

Community
  • 1
  • 1
iCode
  • 1,254
  • 1
  • 13
  • 16
  • Making CO apps from C++/CLI code was traditionally impossible due to the dependency on the CRT. So you won't find a lot of help around about it. You've got a shot at it again with VS2010, it no longer uses the CRT in the side-by-side cache. You'll need to deploy at least msvcr100.dll as well. – Hans Passant Aug 22 '12 at 14:39
  • Oh okay, that's at least promising. I added a Setup & Deployment project just to see what it picked up as Detected Dependencies. It showed Microsoft_VC100_CRT_x86.msm and Microsoft_VC100_MFC_x86.msm then packaged msvcp100.dll, mfc100u.dll, mfc100.dll, mfcm100.dll, mfcm100u.dll, and msvcr100.dll. Do you think that it would it be a bad idea to include those as files copied to the client machine by ClickOnce (.deploy files)? – iCode Aug 22 '12 at 15:04
  • You *have* to deploy them, it won't run without them. – Hans Passant Aug 22 '12 at 15:06
  • I do understand that I would have to deploy them. I was just wondering if it is proper to install them to the same location as the exe as file dependencies of ClickOnce. Update: I installed the dlls in the executable directory on a machine without the C++ Redistributable and voila it worked! Just wondering, how does the exe know to find those dlls there and use them? I suppose it checks the executable directory, then system directories if they aren't found there? – iCode Aug 22 '12 at 16:15

0 Answers0