*
Microsoft.com Home|Site Map
MSDN*
Search Microsoft.com for:
Sign out of the Microsoft Passport Network   Welcome back Sandiway Fong!
Home Search My Threads Edit Profile Member List Top Answerers Faq  
Visual C++ General
Running a very simple Win32 app on a comp without VC++ 2005 Express

Thread Starter: Andreas_   Started: 10 Dec 2005 9:13 PM UTC   Replies: 44
 MSDN Forums » Visual C++ » Visual C++ General » Running a very simple Win32 app on a comp without VC++ 2005 Express
New Post
      « Previous Thread   Next Thread »
  12-10-2005, 9:13 PM UTC
Andreas_


Posts 2
Running a very simple Win32 app on a comp without VC++ 2005 Express
Answered Question Was this post helpful ?
Reply Quote
Hi!

I have installed VC++ 2005 Express and the Platform SDK according to the instructions on MSDN:
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
Compiling and running the following program on the dev computer works like a charm:
http://www.winprog.org/tutorial/simple_window.html

I then changed to release-mode, turned off debugging in the project properties and copied the .exe to another computer without VC++ 2005 Express on. I pretty much expected problems, so I wasn't very surprised when I got the error message saying that there was something wrong with the program configuration, like the one here:
http://forums.microsoft.com/msdn/showpost.aspx?postid=23371&siteid=1

I have since then combed this forum and eventually found a number of different posts containing instructions how to deploy correctly, examples of these are:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=54317&SiteID=1
http://forums.microsoft.com/msdn/showpost.aspx?postid=75707&siteid=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=156255&SiteID=1
I have also read about "Redistributing Visual C++ Files" on msdn:
http://msdn2.microsoft.com/en-us/library/ms235299.aspx

None(!) of these seems to do it for me, I suspect that this is mostly because the above examples does not deal with the Express-version, but I'm not sure.

For someone pretty new to the VS-environment it is a nightmare, so far, to find out how to go about to deploy the applications correctly.

Therefore, I would deeply appreciate it if someone could give a straight-up and complete guide on how to get this application (see the beginning of this post) to run on another computer (the one I have is running WinXP SP2, but if there's any difference in the approach when it's supposed to run on Win98-Win2K then please explain that as well). I know this is a lot to ask, but you will have my eternal thanks :).

   Report Abuse 
  12-11-2005, 1:14 AM UTC
Ayman Shoukry


Posts 2,498
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
The proper way is to use vcredist_x86.exe.  More details are mentioned at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=149470&SiteID=1 or to just link statically to the CRT using the /MT compiler switch.

For more info, please see:
http://msdn2.microsoft.com/en-us/library/ms235624.aspx
http://msdn2.microsoft.com/en-us/library/zebw5zk9.aspx


Thanks,
  Ayman Shoukry
  VC++ Team


This posting is provided "AS IS" with no warranties, and confers no rights.

   Report Abuse 
  12-11-2005, 4:37 PM UTC
Ted.


Posts 747
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
But he's using Express which doesn't even come with a vcredist_x86.exe.  The only way with Express is using the merge modules that come with Express in the folder:

\program files\common files\merge Modules

plus ensuring that Windows Installer 3.x engine is available on the user's machine, and if it's not, installing that as well. 

The two methods that work with something higher than Express, are:

1) using vcredist_x86 in:

C:\program files\microsoft visual studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86

plus ensuring that Windows Installer 3.x engine is available on the user's machine, and if it's not, installing that as well. 

2) Copying these folders to your program folder (keeping the sub folder names):
\program files\microsoft visual studio 8\VC\redist\x86


   Report Abuse 
  12-11-2005, 5:28 PM UTC
Ted.


Posts 747
Answer Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Answer Was this post helpful ?
Reply Quote

OK, due to popular demand, and my frustration with seeing so many people using Express that simply want to run an app on another machine, without the hassle of learning about merge modules, Windows Installer, etc, etc, etc, here is a way to perform deployment option number 2 above (i.e. installing C Runtime library applocal) for Express.

1) On the machine you have Express installed, create the following folder and subfolders in your
\program files\microsoft visual studio 8\VC folder:

redist\x86\Microsoft.VC80.CRT

2) Copy msvcr80.dll, msvcp80.dll, msvcm80.dll from
\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd

into:

\program files\microsoft visual studio 8\VC\redist\x86\Microsoft.VC80.CRT

3) in the above Microsoft.VC80.CRT folder, create a new file named:

Microsoft.VC80.CRT.manifest

4) Paste the following content into the above manifest file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright © 1981-2001 Microsoft Corporation -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <noInheritable/>
    <assemblyIdentity
        type="win32"
        name="Microsoft.VC80.CRT"
        version="8.0.50608.0"
        processorArchitecture="x86"
        publicKeyToken="1fc8b3b9a1e18e3b"
    />
    <file name="msvcr80.dll"/>
    <file name="msvcp80.dll"/>
    <file name="msvcm80.dll"/>
</assembly>

Now you have a new folder in your Visual C++ Express installation that can be re-used when ever you need it.

To deploy these files, simply copy the Microsoft.VC80.CRT folder you just created to your program folder.  That's it.  So for example, if your application executable resides in C:\Program Files\MyApp, you'll have a folder named:

C:\Program Files\MyApp\Microsoft.VC80.CRT

that contains the 4 files I mentioned (3 DLLs and one manifest file you created by hand)

No installation of anything else is necessary.  Just click on your EXE file, and your app will run.  No special installation engines are necessary, just make your setup program (installer) create that subfolder Microsoft.VC80.CRT along with what you normally install with your app)

Let me know if you need similar instructions for MFC and I'll create them. 


   Report Abuse 
  12-12-2005, 7:43 PM UTC
Andreas_


Posts 2
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
Thank you VERY much Ted, an explanation like yours was exactly what I was looking for, and it worked perfectly :).

   Report Abuse 
  12-12-2005, 8:10 PM UTC
hathawa


Posts 5
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
This procedure did not seem to work for me where I have a single DLL with an embedded manifest which is called from Java via JNI.  I put the Microsoft.VC80.CRT subdirectory in the same location as the dll.  Any ideas?

   Report Abuse 
  12-12-2005, 9:27 PM UTC
Ted.


Posts 747
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
Andreas, good to hear.  I wish they would've include those files in the default Express installations.

hathawa, I don't know how applocal installation is supposed to work in cases where you have no control over the main executable (i.e. you can only just put the manifest in the DLL and not the executable file)  I'll have to research that some more. 

   Report Abuse 
  12-13-2005, 5:51 AM UTC
Saurabh.Garg


Posts 2
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
Dear Ted,

thanks for the information you provided for copying CRT files.
I want to do same for MFC based application also and I followed similar step for

Microsoft.VC80.MFC
Microsoft.Tools.VisualCPlusPlus.Runtime-Libraries

copying dlls in them and creating a manifest file which I copied and modified from winsxs\manifests but still my application is not working on a machine with no visual studio 2005. Did I miss something? can you please provide step for doing same.

thanks,
Saurabh

   Report Abuse 
  12-13-2005, 2:22 PM UTC
Ted.


Posts 747
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
For Microsoft.VC80.MFC after copying the manifest please open it up in notepad and change the version to 8.0.50608.0 

I just tried on my test machine and it worked.  Can you tell me what error you got?  Try using dependency walker to see if it picks up the DLLs.

For the other one you mentioned I don't think you need it or require for your app if it's a 2005 app. It's for apps written in Visual C++ 6.0.    I woudn't recommend manifest for those DLLs if you require them.  Just copy them to system32 folder.

Ted.

   Report Abuse 
  05-05-2006, 3:33 PM UTC
BobLane


Posts 10
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote

I just install VC++ 2005 Express this week to make use of the new SerialPort class in MFC and am having a couple fo deployment problems. I have had my user install the framework redistributable for 2.0.

These problems are new to VC++ 2005 Express.

1. An attempt to execute the Debug version of the execuatbles give the "not properly configured" error. I have tried the dll and manifest copying trick recommended to no avail.

2. Execution of the Release version of the executables causes a failure in teh SerialPort ReadExisting call in which all of the data is received as question marks (?). I saw this problem during development and the fix was to add an access to property BytesToRead before making the ReadExisting call. WHile that didn't make any sense to me at the time, it worked - but now it isn't


   Report Abuse 
  02-21-2006, 8:53 PM UTC
_Carlos_


Posts 1
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote

Hi everybody;

With regards to the Windows Installer in this version of VC++ Express,... well, how?

Whilst the one simple walkthrough that I found in the MSDN does, admittedly, state that menus and dialogues may differ dependant on settings, the 'Add New Project' dialog box that I see only contains the "Visual C++"    'node', as the walkthrough puts it, as opposed to the "Other Project Types" node mentioned there.

What have I not installed, or what am I doing wrong, or where do I need to look?!

Any help would be much appreciated!

Thanks




--- Uh? ---

   Report Abuse 
  02-21-2006, 10:50 PM UTC
Ted.


Posts 747
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote

you can use Wix

http://www.codeproject.com/cpp/vcredists_x86.asp

http://blogs.msdn.com/nikolad/archive/2005/09/02/460368.aspx


   Report Abuse 
  05-06-2006, 2:38 AM UTC
Ted.


Posts 747
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote

Bob Lane for debug versions just create a text file named:

Microsoft.VC80.DebugCRT.manifest

with the following contents:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright © 1981-2001 Microsoft Corporation -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <noInheritable/>
    <assemblyIdentity
        type="win32"
        name="Microsoft.VC80.DebugCRT"
        version="8.0.50608.0"
        processorArchitecture="x86"
        publicKeyToken="1fc8b3b9a1e18e3b"
    />
    <file name="msvcr80d.dll"/>
    <file name="msvcp80d.dll"/>
    <file name="msvcm80d.dll"/>
</assembly>

Then copy this file as well as the 3 files mentioned in the manifest to the folder where your program or DLL resides. 

Do the same for MFC: create a text file named Microsoft.VC80.DebugMFC.manifest and copy the following contents in there:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright © 1981-2001 Microsoft Corporation -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <noInheritable/>
    <assemblyIdentity
        type="win32"
        name="Microsoft.VC80.DebugMFC"
        version="8.0.50608.0"
        processorArchitecture="x86"
        publicKeyToken="1fc8b3b9a1e18e3b"
    />
    <file name="mfc80d.dll"/>
    <file name="mfc80ud.dll"/>
    <file name="mfcm80d.dll"/>
    <file name="mfcm80ud.dll"/>
</assembly>

Then copy this manifest plus the 4 DLLs mentioned to the same folder where your program or DLL resides.

It's that simple.

 


   Report Abuse 
  05-10-2006, 2:09 PM UTC
BobLane


Posts 10
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote
Ted, unfortunately, I am unable to locate the mfc*80d.dll files. Are you sure those are the right file names?
   Report Abuse 
  05-10-2006, 3:01 PM UTC
Ted.


Posts 747
Re: Running a very simple Win32 app on a comp without VC++ 2005 Express
Comment Was this post helpful ?
Reply Quote

Hi Bob, sorry, I didn't realize that it was VC++ Express.  You can't even compile an MFC application using Express (it's not supported) so no debug nor release versions of MFC DLLs are included with Visual C++ Express.  Under what situation are you finding that you require debug versions of MFC, if you can't even compile an app using MFC?

As MFC doesn't come with Express, Is it possible you're trying to use the MFC version that came with the Platform SDK? If so the only way around that would be to compile MFC as a static library (this is non-trivial)


   Report Abuse 
New Post
 Page 1 of 3 (45 items) 1 2 3 Next »
MSDN Forums » Visual C++ » Visual C++ General » Running a very simple Win32 app on a comp without VC++ 2005 Express


© 2007 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
Microsoft