重复清单导致“无法创建进程”

发布于 2024-11-01 04:43:09 字数 1047 浏览 2 评论 0原文

我一直在尝试使用 UAC 获取更新应用程序,经过一番挖掘后,我需要在我的应用程序中包含一个清单。

该清单称为MyApp.manifest。为了将其包含在项目中,我创建了一个名为 MyApp.rc 的 RC 文件。这是使用预构建命令 brcc32 $(PROJECTNAME).rc -fo$(PROJECTNAME).rec 构建到名为 MyApp.rec 的文件中

,然后在我的 DPR 中Have

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

begin
  Application.Initialize;

这允许Delphi 处理诸如版本信息之类的事情。

当应用程序复制到 Windows 7 中时,这一切都工作正常。

我今天去调试应用程序,我的开发环境是 Windows XP,我立即得到: Unable to Create Process

经过更多挖掘后,我被指向了 XN 资源编辑器。这立即显示出以下问题:

Duplicate Manifest

这些清单中的第一个(标记为 1 的)是 MyApp .manifest (这也许就是它在 Windows 7 中工作正常的原因?)并且如果我删除第二个清单,应用程序可以完美运行。奇怪的是,如果我更改 RC 文件中的数字,数字 1 也会随之改变,但第二个清单仍为数字 2。

我认为第二个清单可能与运行时主题有关,但禁用它根本不起作用(我取消选中复选框,关闭项目选项,打开项目选项并勾选该复选框)。

那么是什么导致第二个清单出现呢?我该如何摆脱它?

Delphi版本是2007年

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:
Unable to Create Process

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

Duplicate Manifest

The first of these Manifests (the one marked 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

未央 2024-11-08 04:43:09

如果您想使用自己的清单,则必须根据您的 delphi 版本按照以下步骤禁用由 delphi 生成的清单。

  1. 从项目中删除任何 TXPManifest 组件
  2. 删除所有引用到项目中的 XpMan 单元
  3. 禁用项目中存在的选项“启用运行时主题”->选项->应用

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
ヤ经典坏疍 2024-11-08 04:43:09

德尔福是什么版本的?检查所有项目文件中 UxTheme 的 use 子句;它是 SoftGems 的 Mike Lischke 的旧主题管理器,已合并到 VCL 中。您还可以查找 XPMan,它向 Delphi 7 添加了清单;这也是迈克发来的。在纳入 VCL 之前,他将其作为免费操作系统放在他的网站上。

您还需要执行“项目”->“构建”,而不仅仅是事后进行编译(或在更改“运行时主题”设置之后),以便强制重新编译所有单元并完全重新创建可执行文件。

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.

蓝天白云 2024-11-08 04:43:09

我在处理其他事情一段时间后回到这个项目并删除了现有的.res文件在打开项目之前

我认为Delphi将项目.res文件缓存在内存中并且仅在编译/时更新它自从这个问题完全消失以来。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文