×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    158

    Packaging an app

    I went through the documenation but I can't find out how I should package my script and images to convert them to one .sis file. I know py2sis can take a directory as an argument, but what should then be the path (in my source) to the imagefile?

    And can I improve the application speed by compiling the app to a .pyc file?

  2. #2
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    209

    Re: Packaging an app

    Originally posted by bercobeute
    I went through the documenation but I can't find out how I should package my script and images to convert them to one .sis file. I know py2sis can take a directory as an argument, but what should then be the path (in my source) to the imagefile?

    And can I improve the application speed by compiling the app to a .pyc file?
    If I remember correctly the conversion to ".pyc" file did not necessarily help (might be wrong here).

    First part of the question:

    "py2sis" takes everything from the directory given as command line parameter and puts those files inside the created sis-file ("testi" is the directory to be packaged):

    Code:
    C:\Nokia\Tools\Python_for_Series_60\testi>dir
     Volume in drive C has no label.
     Volume Serial Number is 28DF-1C50
    
     Directory of C:\Nokia\Tools\Python_for_Series_60\testi
    
    16.08.2005  11:22    <DIR>          .
    16.08.2005  11:22    <DIR>          ..
    15.08.2005  10:36             2,635 default.py
    15.08.2005  10:36             2,635 myPNG.png
                   2 File(s)          5,270 bytes
                   2 Dir(s)  19,815,137,280 bytes free
    
    ...
    
    C:\Nokia\Tools\Python_for_Series_60>py2sis testi c:\temp\myTest.sis --uid=0x0123
    4567 --leavetemp --appname=myTest
    Creating SIS for SDK2.0 and later
    Processing C:\Nokia\Tools\Python_for_Series_60\temp\myTest.pkg...
    Created c:\temp\myTest.sis
    
    C:\Nokia\Tools\Python_for_Series_60>dir temp
     Volume in drive C has no label.
     Volume Serial Number is 28DF-1C50
    
     Directory of C:\Nokia\Tools\Python_for_Series_60\temp
    
    16.08.2005  11:23    <DIR>          .
    16.08.2005  11:23    <DIR>          ..
    16.08.2005  11:23             2,635 default.py
    16.08.2005  11:23             2,635 myPNG.png
    16.08.2005  11:23             1,692 myTest.app
    16.08.2005  11:23               401 myTest.pkg
    16.08.2005  11:23               337 myTest.rsc
                   5 File(s)          7,700 bytes
                   2 Dir(s)  19,816,230,912 bytes free
    
    C:\Nokia\Tools\Python_for_Series_60>cd \temp
    
    C:\Temp>unsis
    usage: unsis.pl <sis file or dir> <target dir> at C:\Program Files\Common Files\
    Symbian\Tools/unsis.pl line 14.
    
    C:\Temp>mkdir myTemp
    
    C:\Temp>unsis myTest.sis myTemp
    
    Processing: myTest.sis
    
    C:\Temp>tree myTemp
    Folder PATH listing
    Volume serial number is 28DF-1C50
    C:\TEMP\MYTEMP
    +---system
        +---apps
            +---mytest
    
    C:\Temp>cd myTemp\system\apps\mytest
    
    C:\Temp\myTemp\system\apps\mytest>dir
     Volume in drive C has no label.
     Volume Serial Number is 28DF-1C50
    
     Directory of C:\Temp\myTemp\system\apps\mytest
    
    16.08.2005  11:29    <DIR>          .
    16.08.2005  11:29    <DIR>          ..
    16.08.2005  11:29             2,480 default.py
    16.08.2005  11:29             2,635 mypng.png
    16.08.2005  11:29             1,692 mytest.app
    16.08.2005  11:29               337 mytest.rsc
                   4 File(s)          7,144 bytes
                   2 Dir(s)  19,816,194,048 bytes free
    
    C:\Temp\myTemp\system\apps\mytest>
    In the above I used the freely available "unsis" tool (Symbian site) to check the contents of the package. The question of how to find the right path to the png-file is a bit trickier at the moment. The short answer is that the fileis located in one of the drives of the target device (normally "C:" or "E:" drive, see programming guide Chapter 6) which depends on the drive the user selected during sis-installation. So you could look all the target device drives for paths "/system/apps/mytest/" and if you have this path you should find the png-file.

    Another possibility exists also, although not recommended, check the contents of the ".pkg"-file which was left into the "temp" directory by "py2sis" ("--leavetemp" switch):
    Code:
    C:\Nokia\Tools\Python_for_Series_60\temp>more myTest.pkg
    ;
    ; Standalone Python for S60 app
    ;
    ;Languages
    &EN
    ;
    ;
    #{"myTest"},(0x01234567),1,0,0
    ;
    ;Supports Series 60 v 2.0
    ;
    (0x101F7960), 0, 0, 0, {"Series60ProductID"}
    ;
    ; Files to install:
    
    "default.py"            -"!:\system\apps\myTest\default.py"
    "myPNG.png"             -"!:\system\apps\myTest\myPNG.png"
    "myTest.app"            -"!:\system\apps\myTest\myTest.app"
    "myTest.rsc"            -"!:\system\apps\myTest\myTest.rsc"
    
    C:\Nokia\Tools\Python_for_Series_60\temp>
    The above output is the structure for the created sis-file. Modify the exclamation marks (!) to hardcode the paths e.g to point to "C:"-drive and use the "makesis" utility to handle the pkg-file. This will create a package where the location for the files is known. Notice that the hardcoding option is not very user friendly as it forces the installation to a certain drive (and if the drive is full or missing you end up in troubles).

    In summary I think a function to reveal in which folder or drive the application dll was loaded from would be useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •