2

I've got a C++-CLI project, I've already create the final .exe and all redist with Advance Installer.

It doesn't work.. and after a big fight I realize that the problem is the Visual runtime x86. After researching in the internet I found that only the redist can be download.The runtime comes with VS (please let me know otherwise).

As well there were some issues with the C++-CLI that I don't fully understand, regarding the final lib.

How you create then the final .exe?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118

2 Answers2

1

C++/CLI is meant to run on top of the CLR. Joel Spolsky has written about the consequences of the CLR here, and one of those consequences is that you do not get an independent stand alone EXE file.

Your installer needs to check that the correct version of .NET has been installed on the target machine.

riwalk
  • 14,033
  • 6
  • 51
  • 68
  • Sorry very new into this... how I do that? – user1609284 Sep 24 '12 at 13:47
  • @user1609284, the only experience I have with installers came from some work I did with WiX (http://wix.sourceforge.net/), and there is a flag you can set for the minimum .NET version required. You need to investigate whatever installer you are using and what version of .NET you need. – riwalk Sep 24 '12 at 16:20
1

The client machine needs to have the proper Target Framework installed:

Older versions aren't generally relevant anymore. Most Windows installations come with a recent version of the .NET Framework out of the box. (e.g. Windows 7, it includes the .NET Framework 3.5.1 as an OS component).


Update If you really want to have an independent executable image, you can use Mono mkbundle to create one.

You will end up with a largish executable, depending on how much of the framework libraries you actually use in the program.

See

Sadly, this won't work with MSVC++ proprietary extensions, like C++/CLI

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633
  • (Sadly, this won't work with MSVC++ proprietary extensions, like C++/CLI ) – user1609284 Sep 24 '12 at 13:46
  • Actually, when you compile pure-managed assemblies with C++/CLI then mkbundle.exe should work. However, mixed mode assemblies are pretty much guaranteed not to work with mkbundle.exe. (PS. you did install the ***correct*** Target Platform version ***on the install client***, right?) – sehe Sep 24 '12 at 22:25
  • I've tried everything I think so far. All .Net version the redist the Microsoft_VC90_CRT_x86.. Nothing looks it can work. I've read that it's not possible to create a deploy from my project. It's that correct?. Please, need to confirm for my boss. – user1609284 Sep 27 '12 at 10:39
  • I'm not sure what you mean by "deploy _from_ (?) my project". Of course, you can deploy .NET applications, in general; This includes C++/CLI applications. I'm not sure what exactly the limitations are that you are running into. – sehe Sep 27 '12 at 10:52
  • by deploy i mean to crate an .exe – user1609284 Sep 27 '12 at 11:53
  • That is called compilation/linkage. Also, that directly contradicts `I've already create the final .exe and all redist with Advance Installer` from the question. Perhaps you should read the answers here first: http://stackoverflow.com/questions/12583514/is-c-sharp-code-compiled-to-native-binaries – sehe Sep 27 '12 at 12:00
  • Sorry for my late response and lack of knowledge. I though deployment was...Deployment is the process by which you distribute a finished application or component to be installed on other computers..http://msdn.microsoft.com/en-us/library/zebw5zk9.aspx. – user1609284 Sep 29 '12 at 09:53
  • @user1609284 It is. That has nothing to do with "create an .exe" - IMHO :) ( Allthough the linked MSDN page talks about _native applications_ only) – sehe Sep 29 '12 at 10:05
  • Sorry for my late response and lack of knowledge. I though deployment was...Deployment is the process by which you distribute a finished application or component to be installed on other computers..http://msdn.microsoft.com/en-us/library/zebw5zk9.aspx. Anyway, my project run/compile/works in any machine that got VS due to it needs the VS C++ 2010 runtime x86, not without it (redist doesn't make the job). And it's looks like CLI/C++ is a nightmare to make a final application to run in any machine. – user1609284 Sep 29 '12 at 10:16
  • I've try everything I found in the internet including this..http://weblogs.asp.net/avnerk/archive/2007/08/30/unmanaged-deployment-is-a-true-dll-hell.aspx, but nothing works..Please help and thanks for your time Sehe.. – user1609284 Sep 29 '12 at 10:17