Wykluczenie zasobów przy kompilacji

0

Bardzo często spotykam się z problemem, gdzie w zasobach pliku EXE Delphi generuje dużo śmieci.
Większość tego jest w Bitmapie/Kursorach. Dodawane są przez komponenty zewnętrzne i ich usunięcie nie wpływa na pracę z aplikacją.

Każdorazowe usuwanie ręczne np.: Restoratorem jest żmudne, czasochłonne i można pomylić się przy usuwaniu.

Czy istnieje zastosowanie np.: dyrektywy w stylu

{$ExcludeResource 'NAZWA'}

gdzie NAZWA to nazwa zasobu.

A może jest inny sposób na hurtowe usunięcie tych zasobów.

Proszę o wskazówki i pomoc :)

0

z tego co mi wiadomo to NIE MA takiego cusia :(

0

Nawet żaden ResourceHaker, Restorator czy inny nie potrafi hurtowo tego usunąć ? Np.: skryptem w BAT ?

Eh...

0

znaczy ja się odniosłem czy do delphi coś takiego jest :). Czy jest coś co grzebie już w exe to nie wiem

0

http://webcache.googleusercontent.com/search?q=cache:eQa-_ORaqfgJ:www.askvg.com/tutorial-all-about-resource-hacker-in-a-brief-tutorial/+resource+hacker+command+line&cd=1&hl=pl&ct=clnk&gl=pl

Using Scripts in Resource Hacker

We can also run Resource Hacker using Command Prompt and can use scripts to automate lots of repeatative tasks to save our time.

You can use scripts in 2 ways:
Single Command
Multiple Commands

[Single Command]

You can use following commands in Command Prompt to perform actions using Resource Hacker:

-add ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-addskip ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-addoverwrite ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-modify ExeFileName, ResultingFileName, ResourceAddress, ResourceType, ResourceName,
-extract ExeFileName, ResourceAddress, ResourceType, ResourceName,
-delete ExeFileName, ResultingFileName, ResourceType, ResourceName,

Where:
ExeFileName - Source file name
ResultingFileName - Output file name
ResourceAddress - Resource location (e.g. Bitmap path stored in your hard disk)
ResourceType - Resource type (e.g. Bitmap, AVI, etc.)
ResourceName - Resource name (e.g. 131, 1020, etc.)

Example:

ResHacker.exe -addoverwrite explorer.exe, explorer1.exe, MyImage.bmp , bitmap, 143,

[Multiple Commands]

You can also run a series of commands using script. First you'll need to create the script file using Notepad and then you can run it using following command:

ResHacker.exe -script ScriptFileName

Where, ScriptFileName is the name of the script file which you created in Notepad.

Following is the required format of the script file:

[FILENAMES]
Exe=
SaveAs=
Log=
[COMMANDS]
-addoverwrite ResourceAddress, ResourceType, ResourceName

Where:

EXE= contains source file name
SaveAs= contains output file name
Log= contains LOG file name which will store a detailed log of the operation

[COMMANDS] section contains the command-set which we want to perform on the source file.

PS: You can omit the LOG= entry in script file. In this case, Resource Hacker will automatically create a LOG file with the name "ResHacker.log".

That's all for now. If you have any query, please feel free to ask in our comments section.
0

A jednak :) Nareszcie....

Dzięki cimak :)

1 użytkowników online, w tym zalogowanych: 0, gości: 1