Quantcast

How to add a single image file to the Windows executable

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to add a single image file to the Windows executable

Coyot Linden (Glenn Glazer)
Part of our application is a Tkinter GUI.  The frames use the same, single logo image in all of them in addition to whatever text or buttons are required. 

I am looking for the simplest possible method of adding it to the executable and any additional steps required to reference it in the code (For Linux and Mac, we do not use pyinstaller, so they just look in an installed directory.  Not sure how that translates to the exe environment.).

It seems like I should be using the -r flag to add the location of the image file, but I find this:

-r RESOURCE, --resource RESOURCE
     Add or update a resource to a Windows executable. The RESOURCE is one to four items, FILE[,TYPE[,NAME[,LANGUAGE]]]. FILE can be a data file or an exe/dll. For data files, at least TYPE and NAME must be specified. LANGUAGE defaults to 0 or may be specified as wildcard * to update all resources of the given TYPE and NAME. For exe/dll files, all resources from FILE will be added/updated to the final executable if TYPE, NAME and LANGUAGE are omitted or specified as wildcard *.This option can be used multiple times.


to be very vague.  If FILE is the path to the file (is it?), what is NAME?  What are valid TYPEs? 

Any suggestions on the simplest way to do this would be greatly appreciated.

Best,

coyot
GLENN GLAZER | Senior Software Engineer
m:
562.305.2920 | email:  [hidden email] | Second Life: Coyot Linden
LINDEN LAB | Create Virtual Experiences

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add a single image file to the Windows executable

Hartmut Goebel
Am 13.09.2016 um 01:03 schrieb Coyot Linden (Glenn Glazer):
I am looking for the simplest possible method of adding it to the executable and any additional steps required to reference it in the code (For Linux and Mac, we do not use pyinstaller, so they just look in an installed directory.  Not sure how that translates to the exe environment.).

I suggest reading the fine manual, there is a section about adding data-files.


--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/totgeburt-volksverschlusselung
Kolumne: http://www.cissp-gefluester.de/2011-02-fleisige-datensammler-fur-lukratives-geschaeftsmodell-gesucht

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add a single image file to the Windows executable

Coyot Linden (Glenn Glazer)
On 9/13/16 05:23, Hartmut Goebel wrote:
> Am 13.09.2016 um 01:03 schrieb Coyot Linden (Glenn Glazer):
>> I am looking for the simplest possible method of adding it to the
>> executable and any additional steps required to reference it in the
>> code (For Linux and Mac, we do not use pyinstaller, so they just look
>> in an installed directory.  Not sure how that translates to the exe
>> environment.).
>
> I suggest reading the fine manual, there is a section about adding
> data-files.

I did.  It was, like this comment, not helpful.

Best,

coyot

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add a single image file to the Windows executable

davecortesi
In reply to this post by Coyot Linden (Glenn Glazer)
I have zero experience with the windows resource system so can't comment on that part. But to K.I.S.S., why not use the same arrangement as the other platforms? See the manual on how to find things at run time:

http://pythonhosted.org/PyInstaller/runtime-information.html

Or, you can add the logo.png to a bundle as a data file, see

http://pythonhosted.org/PyInstaller/spec-files.html#adding-files-to-the-bundle


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add a single image file to the Windows executable

Coyot Linden (Glenn Glazer)
On 9/13/16 07:43, davecortesi wrote:

> I have zero experience with the windows resource system so can't
> comment on that part. But to K.I.S.S., why not use the same
> arrangement as the other platforms? See the manual on how to find
> things at run time:
>
> http://pythonhosted.org/PyInstaller/runtime-information.html
>
> Or, you can add the logo.png to a bundle as a data file, see
>
> http://pythonhosted.org/PyInstaller/spec-files.html#adding-files-to-the-bundle
>
>

Thanks, Dave.

The first link was very helpful and I didn't see in context of looking
for bundling.  I'm going to try pointing the exe to the " Files the user
has placed with the app bundle.

The second link I had read before but shied away from.  This running of
pyinstaller will happen from within a Cmake run and I'd rather rely on
arguments to pyi-Makespec than to add custom spec files to the build.  
Which is why I tried to (and still don't) understand the parameter to
that flag.

Best,

coyot

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Loading...