开发者

Duplicate Manifest causes 'Unable to Create Process'

开发者 https://www.devze.com 2023-02-25 06:31 出处:网络
I\'ve been trying a get an update App working with UAC and after doing some digging I needed to include a manifest in my app.

I've been trying a get an update App working with UAC and after doing some digging I needed to include a manifest in my app.

The manifest is called MyApp.manifest. In order to include this in the project I've created an RC file which is called MyApp.rc. This is built into a file called MyApp.rec with a Pre-Build Command brcc32 $(PROJECTNAME).rc -fo$(PROJECTNAME).rec

Then in my DPR I Have

{$R *.REC}
{$R *.RES}

begin
  Application.Initialize;

This allows Delphi to handle things like version information.

This all works fine when the App is copied into windows 7.

I went to debug the app today and my dev environment is Windows XP where I immediately get:

Duplicate Manifest causes 'Unable to Create Process'

After some more digging I was pointed to the XN Resource Editor. Which immediately showed the following problem:

Duplicate Manifest causes 'Unable to Create Process'

The first of these Manifests (the one ma开发者_C百科rked 1) is the MyApp.manifest (which is maybe why it works ok in windows 7?) and sure enough if I delete the second manifest the app works perfectly. Strangely if I change the number in the RC file the number 1 changes with it but the second manifest remains at number 2.

I think the second manifest may have something to do with runtime themes but disabling that simply doesn't work (I untick the checkbox, close project options, open project options and the checkbox is ticked).

so what is causing the second manifest to appear? and how do I get rid of it?

Delphi Version is 2007


If you wanna use your own manifest , you must disable the manifest generated by delphi following these steps depending of you delphi version.

  1. Remove any TXPManifest component from your project
  2. Remove any reference to the XpMan unit in your project
  3. Disable the option "Enable runtime themes", present in the project -> options -> application


What version of Delphi? Check the uses clause in all of your project files for UxTheme; it's the old theme manager from Mike Lischke at SoftGems that was incorporated into the VCL. You can also look for XPMan, which adds a manifest to Delphi 7; it's also from Mike. Prior to the inclusion in the VCL, he had it as free OS on his web site.

You'll also need to do a Project->Build rather than just a compile afterwards (or after changing the 'runtime themes' setting as well), in order to force all units to be recompiled and the executable to be fully recreated.


I came back to this project after working on something else for a while and deleted the existing .res file before opening the project

I think Delphi caches the projects .res file in memory and only updates it when compiling/building since this problem has entirely disappeared.

0

精彩评论

暂无评论...
验证码 换一张
取 消