游戏开发论坛

 找回密码
 立即注册
搜索
查看: 15945|回复: 31

怎么修改可执行文件的版本信息和图标??

[复制链接]

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
发表于 2007-7-21 18:31:00 | 显示全部楼层 |阅读模式
我的脚本系统已经可以生成可执行文件了,但是还有个问题。
怎么修改这个可执行文件的版本信息和图标??
谢谢各位帮忙解答。
[em20] [em5] [em5]
sf_2007721183120.png

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2007-7-21 18:33:00 | 显示全部楼层

Re: 怎么修改可执行文件的版本信息和图标??

[em5]
sf_2007721183234.png

16

主题

280

帖子

280

积分

中级会员

Rank: 3Rank: 3

积分
280
QQ
发表于 2007-7-21 20:32:00 | 显示全部楼层

Re: 怎么修改可执行文件的版本信息和图标??

A genius

32

主题

1259

帖子

1351

积分

金牌会员

Rank: 6Rank: 6

积分
1351
发表于 2007-7-21 21:07:00 | 显示全部楼层

Re:怎么修改可执行文件的版本信息和图标??

UpdateResource()

support win2k/xp.

61

主题

1429

帖子

1430

积分

金牌会员

Rank: 6Rank: 6

积分
1430
发表于 2007-7-22 12:52:00 | 显示全部楼层

Re:怎么修改可执行文件的版本信息和图标??

A games

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2007-7-22 13:45:00 | 显示全部楼层

Re: Re:怎么修改可执行文件的版本信息和图标??

Devil: Re:怎么修改可执行文件的版本信息和图标??

UpdateResource()

support win2k/xp.

[em5]
Thanks!

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2007-7-22 13:46:00 | 显示全部楼层

Re: Re:怎么修改可执行文件的版本信息和图标??

使命召唤: Re:怎么修改可执行文件的版本信息和图标??

A games

a就已经是“一个”,单数了,怎么game后面还要加s??

187

主题

6490

帖子

6491

积分

论坛元老

团长

Rank: 8Rank: 8

积分
6491
 楼主| 发表于 2007-7-22 19:39:00 | 显示全部楼层

Re:怎么修改可执行文件的版本信息和图标??

UpdateResource Function
Adds, deletes, or replaces a resource in a portable executable (PE) file. There are some restrictions on resource updates in files that contain Resource Configuration (RC Config) data: language-neutral (LN) files and language-specific resource (.mui) files.

Syntax


BOOL UpdateResource(          HANDLE hUpdate,
    LPCTSTR lpType,
    LPCTSTR lpName,
    WORD wLanguage,
    LPVOID lpData,
    DWORD cbData
);
Parameters

hUpdate
[in] A module handle returned by the BeginUpdateResource function, referencing the file to be updated.
lpType
[in] Pointer to a null-terminated string specifying the resource type to be updated. Alternatively, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined resource types, see Resource Types.
lpName
[in] Pointer to a null-terminated string specifying the name of the resource to be updated. Alternatively, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is a resource ID. When creating a new resource do not use a string that begins with a '#' character for this parameter.
wLanguage
[in] Specifies the language identifier of the resource to be updated. For a list of the primary language identifiers and sublanguage identifiers that make up a language identifier, see the MAKELANGID macro.
lpData
[in] Pointer to the resource data to be inserted into the file indicated by hUpdate. If the resource is one of the predefined types, the data must be valid and properly aligned. Note that this is the raw binary data to be stored in the file indicated by hUpdate, not the data provided by LoadIcon, LoadString, or other resource-specific load functions. All data containing strings or text must be in Unicode format. lpData must not point to ANSI data.
If lpData is NULL, the specified resource is deleted from the file indicated by hUpdate.

cbData
[in] Specifies the size, in bytes, of the resource data at lpData.
Return Value

Returns TRUE if successful or FALSE otherwise. To get extended error information, call GetLastError.

Remarks

It is recommended that the resource file is not loaded before this function is called. However, if that file is already loaded, it will not cause an error to be returned.

An application can use UpdateResource repeatedly to make changes to the resource data. Each call to UpdateResource contributes to an internal list of additions, deletions, and replacements but does not actually write the data to the file indicated by hUpdate. The application must use the EndUpdateResource function to write the accumulated changes to the file.

This function can update resources within modules that contain both code and resources.

Windows 95/98/Me: UpdateResourceW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .

Windows Vista or later: As noted above, there are restrictions on resource updates in files that contain RC Config data: LN files and .mui files. The restrictions are as follows:

Action LN file .mui file
1. Add a new type that doesn't exist in the LN or .mui files. Add type in the LN file and treat as language-neutral (non-localizable) and add new type or item in the RC Config data The only additions allowed are the following types: file Version, RC Config data, Side-by-side Assembly XML Manifest.
2. Add a new resource item to an existing type. Uses the RC Config data to check whether the type exists in the .mui files associated with this LN file. If the type doesn't exist in the .mui files, add the item and treat new item as un-localizable. If the type exists in the .mui files, then adding is not allowed. Only items of the following types may be added: File Version, RC Config data, Side-by-side Assembly XML Manifest.
3. Update a resource item. Uses the RC Config data to check whether the type exists in the .mui files associated with the LN file. If the type doesn't exist in the .mui files, then this resource item update is allowed in the LN file. Otherwise, if the type exists in the .mui files associated with this LN file, then this update is not allowed. The only updates allowed are items of the following types: file Version, RC Config data, Side-by-side Assembly XML Manifest.
4. Add a type/item for a new language. Not allowed. Not allowed.
5. Remove an existing type/item. Works similarly to case 3. Uses the RC Config data to check whether the type exists in the .mui files associated with the LN file. If not, then the removal of the type/item from the LN file is allowed. Otherwise, if the type/item exists in the .mui files associated with this LN file, then the removal is not allowed. The only types allowed to be removed are: file Version, RC Config data, Side-by-side Assembly XML Manifest; also, only items of these types may be removed.
6. Add/delete/update a type not included in the RC Config data (such as Version, Side-by-side Assembly XML Manifest, or RC Config data itself).  Allowed. Allowed.
7. Other update of non-localizable data, such as TYPELIB, reginst, and so on. Update type or item in the LN file, treat as non-localizable, and add new type or item in the RC Config data. Not applicable.
8. Add RC Config data. Can be done but the integrity of the RC Config data is not checked. Can be done but the integrity of the RC Config data is not checked.


Example

For an example, see Updating Resources.

Function Information

Minimum DLL Version kernel32.dll
Header Declared in Winbase.h, include Windows.h
Import library Kernel32.lib
Minimum operating systems Windows NT 3.1
Unicode Implemented as ANSI and Unicode versions.  

9

主题

688

帖子

688

积分

高级会员

Rank: 4

积分
688
发表于 2007-7-22 21:17:00 | 显示全部楼层

Re:怎么修改可执行文件的版本信息和图标??

冒昧问一下:是如何生成可执行文件的?

15

主题

202

帖子

207

积分

中级会员

Rank: 3Rank: 3

积分
207
QQ
发表于 2007-7-22 21:30:00 | 显示全部楼层

Re:怎么修改可执行文件的版本信息和图标??

同上问..
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-25 16:56

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表