Author Topic: Problem when deploying Windows app.  (Read 5477 times)

etimar

  • Guest
Problem when deploying Windows app.
« on: December 19, 2007, 06:10:58 pm »
Hi all,

I developped a very simple C command line program. It works quite well on my machine where C::B is installed, but refuse to execute on another machine, though I deploy it with the "msvcr80.dll" and the corresponding ".exe.manifest" file... It only displays an alert box with the following error message: "This application cannot be launched because application configuration is uncorrect" (approximative translation from the french original message).

I tried to add several other DLLs, tried to rebuild my app with differents compilation options, but nothing worked...

Both machines are under Windows XP SP2
I use C::B with the Microsoft Visual C++ 2005 compiler

Does anybody have an idea ?
Thanks.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Problem when deploying Windows app.
« Reply #1 on: December 19, 2007, 07:06:36 pm »
Did you try it on you own machine after setting PATH?

Open CMD window, after copying all the files needed to folder c:\test. I use dotest for your command name.

cd c:\test
SET PATH=c:\test
dotest


If the above works, I have no idea on how to proceed. If it fails, add a single path from your normal PATH setting to determine which folder contains the needed DLLs. Once you find the folder look at the DLLs in the folder.

Note, it might be easier to use an tool to find the problem, but they sometimes fail for weird code.
Tools like PEInfo.exe or depends.exe

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Problem when deploying Windows app.
« Reply #2 on: December 19, 2007, 07:09:20 pm »
Run depends path\to\your\program.exe

That should show all needed libraries. Then make sure they're accessible via path, like stahta01 said (usually, such a problem is . missing in PATH).
« Last Edit: December 19, 2007, 07:10:51 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Problem when deploying Windows app.
« Reply #3 on: December 20, 2007, 06:32:08 am »
I developped a very simple C command line program. It works quite well on my machine where C::B is installed, but refuse to execute on another machine, though I deploy it with the "msvcr80.dll" and the corresponding ".exe.manifest" file... It only displays an alert box with the following error message: "This application cannot be launched because application configuration is uncorrect" (approximative translation from the french original message).

I tried to add several other DLLs, tried to rebuild my app with differents compilation options, but nothing worked...

Both machines are under Windows XP SP2
I use C::B with the Microsoft Visual C++ 2005 compiler

I guess you are the victim of the Side-by-side Assemblies implementation which has been introduced in MSVC 2005. When you distribute the manifest file, the SXS manager reads it to find out the shared library your application is looking for. It generally starts the search for C Runtime DLLs %WINDIR%\WinSXS\{crappy-named-folder}\msvcrt.dll. Read it more at the following link.

Quote
http://msdn2.microsoft.com/en-us/library/aa376307.aspx


To fix these read the following articles to find out how you want to do it.

Quote
http://msdn2.microsoft.com/en-us/library/ms235285(VS.80).aspx

But I can't tell you which one is the best deployment method as I have never tried them. :)
Be a part of the solution, not a part of the problem.

etimar

  • Guest
Re: Problem when deploying Windows app.
« Reply #4 on: December 20, 2007, 12:17:28 pm »
Thank you very much for all your answers.

I finally succeeded in deploying my app, by running "vcredist_x86.exe" on the target computer, as explain in http://msdn2.microsoft.com/en-us/library/ms235291(VS.80).aspx.

It is obviously not the best way for deploying apps, but it seems to be the only way for those who have the "Express" (free) version of MSVC 2005...

Thank you again, and long life to C::B.

Offline Ibbur

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Problem when deploying Windows app.
« Reply #5 on: December 20, 2007, 02:15:42 pm »
Hello,
you could use NSIS for deploying your app with an installer. That's like the other method with the vs-setup-project.

If you want to start your app everywhere without having to install anything, instead of /MD use the /MT compiler option, which statically links your app to the multithreaded c/c++ runtime. This compiler flag is also available via the Code::Blocks project's build options dialog.
« Last Edit: December 20, 2007, 02:20:32 pm by Ibbur »