I agree with your analysis - I especially like the idea of bitmaps, Icons and 
cursors to check for resources first, and then to look at the file system 
(would solve the problem of running in "dev" mode with the perl command line, 
or running the exe direct). 

How easy would it to be load other binary objects in from the exe? For example, 
having other image formats or storable created objects.

As for adding resources - I can see the benefits of having a native solution, 
but it would create massive scope to mess around with the perl exe:) Perhaps 
the first step is to point to ResHacker, with a step by step guide on how to 
use it?

jez.


  ----- Original Message ----- 
  From: Steve Pick 
  To: Jez White ; Win32-GUI 
  Sent: Wednesday, February 18, 2004 10:40 PM
  Subject: Re: [perl-win32-gui-users] Shipping resources with your exe


  I'd find this functionality kinda handy. Loading resources from the exe is 
very simple, and it would not be too difficult to extend the 
Win32::GUI::Bitmap, Icon, etc. objects to accept an additional argument that 
indicates that the resource should be loaded from the exe rather than from a 
real file on disk (in fact, it would actually be a trivial matter to do this).

  What is less trivial is getting the resources in there in the first place. 
While ResHacker lets you do it, it'd be nice to see a Win32::GUI native way of 
doing it. Microsoft provides functions for adding, deleting and replacing 
resources in executable files and I propose we either:

  1. Add this update/add/delete functionality into Win32::GUI so that 
applications can fiddle with their own resources. This may be an exceptionally 
bad idea (what exe file will it think it's using when running straight from 
Perl? We dont want it messing with perl.exe's resources)

  2. Create a small tool that is distributed with Win32::GUI to pack resources 
into the exe. I doubt we can re-dist ResHacker with win32::gui and it'd be nice 
if there was this functionality provided. The Win32::GUI::Bitmap, Icon and 
Cursor objects could then be modified to first check for a resource identified 
by the given filename in the current running exe, and if it's not found attempt 
to use the given filename to load an external file. This seems the best mode of 
operation to me.

  Steve
    ----- Original Message ----- 
    From: Jez White 
    To: Win32-GUI 
    Sent: Wednesday, February 18, 2004 6:34 PM
    Subject: [perl-win32-gui-users] Shipping resources with your exe


    Hi,

    One the problems I have when I ship my exe is ensuring that all the 
resources (bitmaps, cursors and config files) are valid when my app starts up. 
Typically, just including them in a sub directory can cause problems since the 
user could delete or alter them. The ideal solution would be to package the 
resources into the exe and extract them at runtime. See: 

    
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Resources.asp

    Adding the resources to the exe is quite straightforward (with reshacker) 
but I'm not sure how easy it would be to implement these function calls (or 
even it is possible), would anyone find this kind of functionality useful? 

    Cheers,

    jez.

Reply via email to