Little tool - but very big size... :-(

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Durumdara

    #1

    Little tool - but very big size... :-(

    Hi !

    I have a problem.
    I have a little tool that can get data about filesystems and wrote it in
    python.

    The main user asked me a GUI for this software.

    This user is needed a portable program, so I create this kind of the
    software with Py2Exe.

    But it have very big size: 11 MB... :-(

    The dist directory:
    2006.02.21. 10:09 <DIR> .
    2006.02.21. 10:09 <DIR> ..
    2005.09.28. 12:41 77 824 bz2.pyd
    2006.02.21. 10:09 0 dirlist.txt
    2006.02.20. 12:51 611 384 library.zip
    2006.02.15. 16:22 23 558 main.ico
    2004.12.16. 17:22 348 160 MSVCR71.dll
    2005.09.28. 12:41 1 867 776 python24.dll
    2006.01.11. 12:19 102 400 pywintypes24.dl l
    2005.09.28. 12:41 405 504 unicodedata.pyd
    2005.09.28. 12:41 4 608 w9xpopen.exe
    2006.01.11. 12:19 73 728 win32api.pyd
    2006.01.11. 12:20 81 920 win32file.pyd
    2006.01.11. 12:26 106 496 win32security.p yd
    2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dl l
    2006.02.20. 12:51 40 960 wxPyHDDirList.e xe
    2005.09.28. 12:41 69 632 zlib.pyd
    2006.01.10. 19:13 626 688 _controls_.pyd
    2006.01.10. 19:12 696 320 _core_.pyd
    2006.01.10. 19:13 364 544 _gdi_.pyd
    2006.01.10. 19:13 491 520 _misc_.pyd
    2006.01.10. 19:13 548 864 _windows_.pyd
    20 file 11 485 758 byte

    I need to have more compressed result. Can I compress dll-s, pyd-s with
    Py2Exe ?
    Can I decrease the total size with something ?

    If not, how to I create an self-unpackager and self-starter program that
    use an temporary directory in the disk ? With WinRar ?

    Thanx for help:
    dd



  • bonono@gmail.com

    #2
    Re: Little tool - but very big size... :-(

    11MB is seldom a concern for today's machine.

    Durumdara wrote:[color=blue]
    > Hi !
    >
    > I have a problem.
    > I have a little tool that can get data about filesystems and wrote it in
    > python.
    >
    > The main user asked me a GUI for this software.
    >
    > This user is needed a portable program, so I create this kind of the
    > software with Py2Exe.
    >
    > But it have very big size: 11 MB... :-(
    >
    > The dist directory:
    > 2006.02.21. 10:09 <DIR> .
    > 2006.02.21. 10:09 <DIR> ..
    > 2005.09.28. 12:41 77 824 bz2.pyd
    > 2006.02.21. 10:09 0 dirlist.txt
    > 2006.02.20. 12:51 611 384 library.zip
    > 2006.02.15. 16:22 23 558 main.ico
    > 2004.12.16. 17:22 348 160 MSVCR71.dll
    > 2005.09.28. 12:41 1 867 776 python24.dll
    > 2006.01.11. 12:19 102 400 pywintypes24.dl l
    > 2005.09.28. 12:41 405 504 unicodedata.pyd
    > 2005.09.28. 12:41 4 608 w9xpopen.exe
    > 2006.01.11. 12:19 73 728 win32api.pyd
    > 2006.01.11. 12:20 81 920 win32file.pyd
    > 2006.01.11. 12:26 106 496 win32security.p yd
    > 2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dl l
    > 2006.02.20. 12:51 40 960 wxPyHDDirList.e xe
    > 2005.09.28. 12:41 69 632 zlib.pyd
    > 2006.01.10. 19:13 626 688 _controls_.pyd
    > 2006.01.10. 19:12 696 320 _core_.pyd
    > 2006.01.10. 19:13 364 544 _gdi_.pyd
    > 2006.01.10. 19:13 491 520 _misc_.pyd
    > 2006.01.10. 19:13 548 864 _windows_.pyd
    > 20 file 11 485 758 byte
    >
    > I need to have more compressed result. Can I compress dll-s, pyd-s with
    > Py2Exe ?
    > Can I decrease the total size with something ?
    >
    > If not, how to I create an self-unpackager and self-starter program that
    > use an temporary directory in the disk ? With WinRar ?
    >
    > Thanx for help:
    > dd[/color]

    Comment

    • Ravi Teja

      #3
      Re: Little tool - but very big size... :-(

      Dependency tracking is usually not perfect in exe generators. I don't
      recall how good py2exe is at this. If you understand which of those
      files will not be used by your program, you can safely delete them. A
      bit of trial and error here if you are not sure. Unless you are using
      floppies or dialup to transfer this tool, you should simply not worry
      about the file size.

      As for compression, just use an installer builder like Inno Setup



      Comment

      • Durumdara

        #4
        Re: Little tool - but very big size... :-(

        Hi !

        Yes, it is. But that tool is designed for USB PenDrive usage.
        The assessor is collect all tools it needed to see a machine(s) in the
        checked corporation.
        He/she needs little programs, because he need to store the results of
        the checkings too, not the tools only.

        So I need to minimalize the code size.

        Thanx for help:
        dd

        bonono@gmail.co m wrote:
        [color=blue]
        >11MB is seldom a concern for today's machine.
        >
        >Durumdara wrote:
        >
        >[color=green]
        >>Hi !
        >>
        >>I have a problem.
        >>I have a little tool that can get data about filesystems and wrote it in
        >>python.
        >>
        >>The main user asked me a GUI for this software.
        >>
        >>This user is needed a portable program, so I create this kind of the
        >>software with Py2Exe.
        >>
        >>But it have very big size: 11 MB... :-(
        >>
        >>The dist directory:
        >>2006.02.21. 10:09 <DIR> .
        >>2006.02.21. 10:09 <DIR> ..
        >>2005.09.28. 12:41 77 824 bz2.pyd
        >>2006.02.21. 10:09 0 dirlist.txt
        >>2006.02.20. 12:51 611 384 library.zip
        >>2006.02.15. 16:22 23 558 main.ico
        >>2004.12.16. 17:22 348 160 MSVCR71.dll
        >>2005.09.28. 12:41 1 867 776 python24.dll
        >>2006.01.11. 12:19 102 400 pywintypes24.dl l
        >>2005.09.28. 12:41 405 504 unicodedata.pyd
        >>2005.09.28. 12:41 4 608 w9xpopen.exe
        >>2006.01.11. 12:19 73 728 win32api.pyd
        >>2006.01.11. 12:20 81 920 win32file.pyd
        >>2006.01.11. 12:26 106 496 win32security.p yd
        >>2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dl l
        >>2006.02.20. 12:51 40 960 wxPyHDDirList.e xe
        >>2005.09.28. 12:41 69 632 zlib.pyd
        >>2006.01.10. 19:13 626 688 _controls_.pyd
        >>2006.01.10. 19:12 696 320 _core_.pyd
        >>2006.01.10. 19:13 364 544 _gdi_.pyd
        >>2006.01.10. 19:13 491 520 _misc_.pyd
        >>2006.01.10. 19:13 548 864 _windows_.pyd
        >> 20 file 11 485 758 byte
        >>
        >>I need to have more compressed result. Can I compress dll-s, pyd-s with
        >>Py2Exe ?
        >>Can I decrease the total size with something ?
        >>
        >>If not, how to I create an self-unpackager and self-starter program that
        >>use an temporary directory in the disk ? With WinRar ?
        >>
        >>Thanx for help:
        >>dd
        >>
        >>[/color]
        >
        >
        >[/color]

        Comment

        • bonono@gmail.com

          #5
          Re: Little tool - but very big size... :-(

          I doubt you can do much then as you mentioned you need GUI which is why
          there is the GUI related dll in the list(takes a large chunk of it),
          then the necessary python runtime.

          However, even for USB pen, I don't think 11M is that much a big deal.
          We have digicam that can produce file size like that so finding a large
          pen drive is not much of an issue. Worse come to worse, convince him to
          use a 2.5" USB drive container. It is a bit bigger than USB pen drive
          but can give you 20G+ without external power, just as convenient as a
          pen drive.

          Durumdara wrote:[color=blue]
          > Hi !
          >
          > Yes, it is. But that tool is designed for USB PenDrive usage.
          > The assessor is collect all tools it needed to see a machine(s) in the
          > checked corporation.
          > He/she needs little programs, because he need to store the results of
          > the checkings too, not the tools only.
          >
          > So I need to minimalize the code size.
          >
          > Thanx for help:
          > dd
          >
          > bonono@gmail.co m wrote:
          >[color=green]
          > >11MB is seldom a concern for today's machine.
          > >
          > >Durumdara wrote:
          > >
          > >[color=darkred]
          > >>Hi !
          > >>
          > >>I have a problem.
          > >>I have a little tool that can get data about filesystems and wrote it in
          > >>python.
          > >>
          > >>The main user asked me a GUI for this software.
          > >>
          > >>This user is needed a portable program, so I create this kind of the
          > >>software with Py2Exe.
          > >>
          > >>But it have very big size: 11 MB... :-(
          > >>
          > >>The dist directory:
          > >>2006.02.21. 10:09 <DIR> .
          > >>2006.02.21. 10:09 <DIR> ..
          > >>2005.09.28. 12:41 77 824 bz2.pyd
          > >>2006.02.21. 10:09 0 dirlist.txt
          > >>2006.02.20. 12:51 611 384 library.zip
          > >>2006.02.15. 16:22 23 558 main.ico
          > >>2004.12.16. 17:22 348 160 MSVCR71.dll
          > >>2005.09.28. 12:41 1 867 776 python24.dll
          > >>2006.01.11. 12:19 102 400 pywintypes24.dl l
          > >>2005.09.28. 12:41 405 504 unicodedata.pyd
          > >>2005.09.28. 12:41 4 608 w9xpopen.exe
          > >>2006.01.11. 12:19 73 728 win32api.pyd
          > >>2006.01.11. 12:20 81 920 win32file.pyd
          > >>2006.01.11. 12:26 106 496 win32security.p yd
          > >>2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dl l
          > >>2006.02.20. 12:51 40 960 wxPyHDDirList.e xe
          > >>2005.09.28. 12:41 69 632 zlib.pyd
          > >>2006.01.10. 19:13 626 688 _controls_.pyd
          > >>2006.01.10. 19:12 696 320 _core_.pyd
          > >>2006.01.10. 19:13 364 544 _gdi_.pyd
          > >>2006.01.10. 19:13 491 520 _misc_.pyd
          > >>2006.01.10. 19:13 548 864 _windows_.pyd
          > >> 20 file 11 485 758 byte
          > >>
          > >>I need to have more compressed result. Can I compress dll-s, pyd-s with
          > >>Py2Exe ?
          > >>Can I decrease the total size with something ?
          > >>
          > >>If not, how to I create an self-unpackager and self-starter program that
          > >>use an temporary directory in the disk ? With WinRar ?
          > >>
          > >>Thanx for help:
          > >>dd
          > >>
          > >>[/color]
          > >
          > >
          > >[/color][/color]

          Comment

          • Giovanni Bajo

            #6
            Re: Little tool - but very big size... :-(

            Durumdara wrote:
            [color=blue]
            > I need to have more compressed result. Can I compress dll-s, pyd-s
            > with Py2Exe ?
            > Can I decrease the total size with something ?
            >
            > If not, how to I create an self-unpackager and self-starter program
            > that use an temporary directory in the disk ? With WinRar ?[/color]


            You can use PyInstaller (http://pyinstaller.hpcf.upr.edu). PyInstaller easily
            builds a single executable with everything inside it. It also optionally
            compresses everything with UPX (http://upx.sourceforge.net/) so to reduce the
            size at the maximum.

            There are also other choices that can be made. For instance, wxWidgets is
            *HUGE*.
            --
            Giovanni Bajo


            Comment

            • Mikael Olofsson

              #7
              Re: Little tool - but very big size... :-(

              Durumdara wrote:[color=blue]
              > But it have very big size: 11 MB... :-(
              >
              > The dist directory:
              > [snip relatively small files]
              > 2005.09.28. 12:41 1 867 776 python24.dll
              > [snip relatively small files]
              > 2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dl l
              > [snip relatively small files]
              > 20 file 11 485 758 byte
              >
              > I need to have more compressed result. Can I compress dll-s, pyd-s with
              > Py2Exe ?
              > Can I decrease the total size with something ?[/color]

              I've snipped out the relatively small files above. Yes, true, some of
              them consume about 0.5MB each.

              It seems to me that your choice of GUI framework is a major cost here. I
              have never used wxpython. Instead my GUIs are based on tkinter. What I
              typically end up with is roughly 7MB. My last example ended up in 7.5MB.
              Zipping the whole thing reduces that to 2.6MB. Is it completly out of
              the question to have a compressed version of the tool on your memory
              stick, and to decompress it on the examined computer before actually
              running the tool?

              /MiO

              Comment

              • Gerhard Häring

                #8
                Re: Little tool - but very big size... :-(

                Durumdara wrote:[color=blue]
                > Hi !
                >
                > Yes, it is. But that tool is designed for USB PenDrive usage.
                > The assessor is collect all tools it needed to see a machine(s) in the
                > checked corporation.
                > He/she needs little programs, because he need to store the results of
                > the checkings too, not the tools only. [...][/color]

                Additional Python or wxPython tools packed using py2exe will only need a
                few kilobytes if you all copy them to the same directory on the pen
                drive. All these tools can share the same .pyd and .dll files.

                -- Gerhard

                Comment

                • Durumdara

                  #9
                  Re: Little tool - but very big size... :-(

                  Hi !
                  [color=blue]
                  >I've snipped out the relatively small files above. Yes, true, some of
                  >them consume about 0.5MB each.
                  >
                  >It seems to me that your choice of GUI framework is a major cost here. I
                  >have never used wxpython. Instead my GUIs are based on tkinter. What I
                  >typically end up with is roughly 7MB. My last example ended up in 7.5MB.
                  >Zipping the whole thing reduces that to 2.6MB. Is it completly out of
                  >the question to have a compressed version of the tool on your memory
                  >stick, and to decompress it on the examined computer before actually
                  >running the tool?
                  >
                  >/MiO
                  >
                  >[/color]
                  Yes, the wxPython use the big files, and win32api do it too...
                  I need them, but wxPython is changeable to tkinter, because it is use
                  only one special thing: a wx.GenericDirCt rl (the user can choose file or
                  directory with this control in same way).

                  The last (compressed) version is 5 MB. That is better !

                  Thanx: dd



                  Comment

                  • Larry Bates

                    #10
                    Re: Little tool - but very big size... :-(

                    Since the target is Windows only, consider using win32gui
                    (part of Mark Hammonds win32 extensions) calls to use
                    native Windows controls. That way you can eliminate
                    wxWindows altogether. If all you need is a file dialog,
                    it isn't very difficult.

                    -Larry Bates


                    Mikael Olofsson wrote:[color=blue]
                    > Durumdara wrote:[color=green]
                    >> But it have very big size: 11 MB... :-(
                    >>
                    >> The dist directory:
                    >> [snip relatively small files]
                    >> 2005.09.28. 12:41 1 867 776 python24.dll
                    >> [snip relatively small files]
                    >> 2006.01.10. 19:09 4 943 872 wxmsw26uh_vc.dl l
                    >> [snip relatively small files]
                    >> 20 file 11 485 758 byte
                    >>
                    >> I need to have more compressed result. Can I compress dll-s, pyd-s with
                    >> Py2Exe ?
                    >> Can I decrease the total size with something ?[/color]
                    >
                    > I've snipped out the relatively small files above. Yes, true, some of
                    > them consume about 0.5MB each.
                    >
                    > It seems to me that your choice of GUI framework is a major cost here. I
                    > have never used wxpython. Instead my GUIs are based on tkinter. What I
                    > typically end up with is roughly 7MB. My last example ended up in 7.5MB.
                    > Zipping the whole thing reduces that to 2.6MB. Is it completly out of
                    > the question to have a compressed version of the tool on your memory
                    > stick, and to decompress it on the examined computer before actually
                    > running the tool?
                    >
                    > /MiO[/color]

                    Comment

                    • BJ in Texas

                      #11
                      Re: Little tool - but very big size... :-(

                      bonono@gmail.co m wrote:
                      || 11MB is seldom a concern for today's machine.
                      ||

                      A good windows/microsoft attitude.. :-)


                      --
                      "Last week, I stated this woman was the ugliest woman I had ever
                      seen. I have since been visited by her sister, and now wish to
                      withdraw that statement." -- Mark Twain


                      Comment

                      • Peter Hansen

                        #12
                        Re: Little tool - but very big size... :-(

                        Larry Bates wrote:[color=blue]
                        > Since the target is Windows only, consider using win32gui
                        > (part of Mark Hammonds win32 extensions) calls to use
                        > native Windows controls. That way you can eliminate
                        > wxWindows altogether. If all you need is a file dialog,
                        > it isn't very difficult.[/color]

                        A good point, and one the developer of Venster thought of as well, since
                        he's already done much of this work (and without even requiring
                        win32gui, as he went through the lighter-weight ctypes).
                        http://venster.sourceforge.net/htdocs/index.html

                        (I haven't tried using this myself, but there's an 800K example of a
                        Windows GUI app included on that page for download.)

                        -Peter

                        Comment

                        • Sion Arrowsmith

                          #13
                          Re: Little tool - but very big size... :-(

                          BJ in Texas <bjtexas@hotmal e.con> wrote:[color=blue]
                          >bonono@gmail.c om wrote:
                          >|| 11MB is seldom a concern for today's machine.
                          >A good windows/microsoft attitude.. :-)[/color]

                          I wish 8-( :

                          PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
                          3715 root 15 0 288m 128m 154m S 1.0 6.3 14902:42 XFree86
                          735 <user> 15 0 156m 84m 40m S 0.3 4.2 3:55.48 firefox-bin
                          3533 root 16 0 85652 74m 1572 S 0.0 3.7 0:00.22 pcscd
                          3904 <user> 15 0 67768 49m 17m S 0.3 2.4 4:48.16 gnome-terminal
                          449 <user> 16 0 58484 41m 39m S 0.0 2.1 16:18.60 kmail
                          4010 <user> 16 0 49056 34m 22m S 0.0 1.7 0:01.63 kdeinit
                          31724 <user> 16 0 94708 32m 34m S 0.0 1.6 0:49.03 epiphany
                          3892 <user> 15 0 41696 22m 19m S 0.0 1.1 0:20.60 nautilus
                          28992 <user> 15 0 57984 19m 22m S 0.0 1.0 5:53.66 kdeinit
                          3902 <user> 16 0 26948 18m 11m S 0.0 0.9 1:50.81 xemacs
                          4237 <user> 15 0 29784 15m 22m S 0.0 0.8 0:01.24 python
                          444 <user> 16 0 24384 15m 20m S 0.0 0.7 0:08.99 gaim
                          4026 <user> 15 0 29924 14m 28m S 0.0 0.7 0:12.59 kdeinit
                          4012 <user> 16 0 27352 14m 25m S 0.0 0.7 0:33.24 kdeinit
                          5388 <user> 15 0 26008 13m 24m S 0.0 0.7 0:02.06 kdeinit
                          350 <user> 15 0 20456 12m 17m S 0.0 0.6 0:05.05 gnome-panel

                          --
                          \S -- siona@chiark.gr eenend.org.uk -- http://www.chaos.org.uk/~sion/
                          ___ | "Frankly I have no feelings towards penguins one way or the other"
                          \X/ | -- Arthur C. Clarke
                          her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump

                          Comment

                          • Max

                            #14
                            Re: Little tool - but very big size... :-(

                            Giovanni Bajo wrote:[color=blue]
                            > There are also other choices that can be made. For instance, wxWidgets is
                            > *HUGE*.[/color]

                            Indeed. Remember Tkinter is built-in. (I never got the hang of Tkinter
                            and prefer wx, but if size is important...)

                            --Max

                            Comment

                            • Gerhard Häring

                              #15
                              Re: Little tool - but very big size... :-(

                              Max wrote:[color=blue]
                              > Giovanni Bajo wrote:
                              >[color=green]
                              >>There are also other choices that can be made. For instance, wxWidgets is
                              >>*HUGE*.[/color]
                              >
                              > Indeed. Remember Tkinter is built-in. [...][/color]

                              Tkinter is only built-in in the sense that it's shipped with Python by
                              default. It is not automatically part of a minimal Python runtime that's
                              created with py2exe or a similar tool.

                              A Tkinter hello weights here 1,95 MB (2.049.264 Bytes)

                              compared to the small wxPython tool that I compressed recently: 2,80 MB
                              (2.942.543 Bytes)

                              All self-extracting LZMA compressed archives using 7ZIP.

                              -- Gerhard

                              Comment

                              Working...