×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Red face Placing data files and using py2sis option --extrasdir

    Hi!

    I’ve read a most of thread about signing and UID. I hope I am right:

    Because I have no publisher ID (and therefore cannot sign my app), I have to take an UID for my app from the unprotected Range 0xA0000000 - 0xAFFFFFFF (Class A). Due that, my app is not able to access to its folder e.g. \private\0xA1234567. So I have to place the images and data files into another folder, for example \resource\apps\, which is often suggested.

    For this I must take the –x option using py2sis of (great) Ensymble. But I always get “Too may path components”

    Does anybody can give be an example for the option –extrasdir, please? Thx!

  2. #2
    Super Contributor
    Join Date
    May 2004
    Location
    Tampere, Finland
    Posts
    524

    Re: Placing data files and using py2sis option --extrasdir

    Quote Originally Posted by andipro View Post
    Because I have no publisher ID (and therefore cannot sign my app), I have to take an UID for my app from the unprotected Range 0xA0000000 - 0xAFFFFFFF (Class A). Due that, my app is not able to access to its folder e.g. \private\0xA1234567. So I have to place the images and data files into another folder, for example \resource\apps\, which is often suggested.
    First of all, every application can access its own private directory. Just let Ensymble create a test range UID for you and use the --verbose option to see what the UID is. There is no "0x" in the private directory path. If your UID is 0xe798022a, for example, the private directory is \private\e798022a\ on the root of the drive where you installed the SIS.

    Quote Originally Posted by andipro View Post
    For this I must take the –x option using py2sis of (great) Ensymble. But I always get “Too may path components”
    This means that you are trying to give Ensymble a path that is not on the root of the folder where your other project files are. Here's an example of proper directory structure:

    Code:
    myapp/
      default.py
      mymodule1.py
      mymodule2/
        __init__.py
        modulefunc1.py
        modulefunc2.py
      data/
        resource/
          apps/
            mydata.dat
    You then use the --extrasdir option like this:

    Code:
    ensymble.py py2sis --extrasdir=data --verbose myapp

  3. #3
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Lightbulb Re: Placing data files and using py2sis option --extrasdir

    Thank you jethro.fn

    Yes you are right. Of course there is no leading 0x in the own folder name.

    And thank you for the -x example. Now I understand the syntax and makeing a working sis file is okay.

    Only the problem with the access still exists. Independent if I set to the own folder \private\0xA1234567 or the comman folder \resource\apps\. It seems that opeing my data file forces an error "permission denied" (also only in "r" mode). But an access to a graphic file before, runs without problems...
    Last edited by andipro; 2008-12-21 at 13:43. Reason: permission instead of access denied

  4. #4
    Super Contributor
    Join Date
    May 2004
    Location
    Tampere, Finland
    Posts
    524

    Re: Placing data files and using py2sis option --extrasdir

    Quote Originally Posted by andipro View Post
    Only the problem with the access still exists. Independent if I set to the own folder \private\0xA1234567 or the comman folder \resource\apps\. It seems that opeing my data file forces an error "permission denied" (also only in "r" mode). But an access to a graphic file before, runs without problems...
    There's that pesky 0x again...

    Just a thought. You are aware, that the Python literal string syntax uses a backslash character for special purposes, right? To enter a literal backslash, used by Symbian OS and Windows as path separator, you need to either type two backslashes to prevent this escape character processing or use the "raw" literal string syntax:

    Code:
    # Escape special characters
    path = "C:\\resource\\apps\\myfile.dat"
    
    # Raw string
    path = r"C:\resource\apps\myfile.dat"

  5. #5
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Arrow Re: Placing data files and using py2sis option --extrasdir

    Thanks again. I toke the solution with "\\". And for example "e:\\python\\myapp\\myfile.dat" is working"

  6. #6
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Question Re: Placing data files and using py2sis option --extrasdir

    What could be the reason, if the SIS with extradir opition does not work, suddenly?

    All was working perfect before. I improved my program. Also the help-file became better and a needed data file got larger. I made a new SIS and installed the application, all without any error. But then, I was wondering, because the help file was the old version and I was missing new data records from the data file. The program itself was up to date.

    Next attempt was uninstalling and installing again. Because after uninstalling the extra directory (data/myapp) still was existing, I deleted it manually. After the new installation, no folder (data/myapp) and of course no help or data file were installed.

    I can verify that the files are sure in the SIS file; because of the size and because of verbose option during the py2sis process.

    I do not understand; about two weeks ago the same steps were successful.

    Happy New Year!
    ProAndi

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Placing data files and using py2sis option --extrasdir

    Quote Originally Posted by andipro View Post
    What could be the reason, if the SIS with extradir opition does not work, suddenly?

    All was working perfect before. I improved my program. Also the help-file became better and a needed data file got larger. I made a new SIS and installed the application, all without any error. But then, I was wondering, because the help file was the old version and I was missing new data records from the data file. The program itself was up to date.

    Next attempt was uninstalling and installing again. Because after uninstalling the extra directory (data/myapp) still was existing, I deleted it manually. After the new installation, no folder (data/myapp) and of course no help or data file were installed.

    I can verify that the files are sure in the SIS file; because of the size and because of verbose option during the py2sis process.

    I do not understand; about two weeks ago the same steps were successful.

    Happy New Year!
    ProAndi
    hello andipro

    i guess the steps you have mentioned above are exactly perfect and its strange that this sort of thing is happening with the sis file.
    i will insist you to try and make another sis using the extrasdir option and then try it i guess the problem may be with the procedure of making sis.

    Enjoy Pythoning
    Gaba88

  8. #8
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Placing data files and using py2sis option --extrasdir

    Quote Originally Posted by andipro View Post
    What could be the reason, if the SIS with extradir opition does not work, suddenly?
    ...
    I do not understand; about two weeks ago the same steps were successful.
    Did you install 1.9? It contains a different version of Ensymble.

    Cheers,

    --jouni

  9. #9
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Re: Placing data files and using py2sis option --extrasdir

    thanks for support.

    @JOM I've still 1.4.5
    @gaba88 I've tried; was making all files new. Same problem.

    I've also made I a simple as possible sis (with extradir).

    But with this installation the same problem occurs.
    No error. But also no extra directory.

    Could it be, that an other app or the update of an app makes some problem?

  10. #10
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Placing data files and using py2sis option --extrasdir

    Ok,

    Couple stupid questions == there are no stupid questions:

    1) Did you check content of SIS file? Are the new files in there? With correct path?

    2) Maybe you could put all data files in "root" of your app? Why do you need to use --extrasdir at all?

    Wondering,

    --jouni

  11. #11
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Placing data files and using py2sis option --extrasdir

    hello andipro again

    once i also faced the similar kind of problem when packaging my files. But after lot of searching the forum i found a thread which helped to package the files in a different way. So if you want please follow the instruction of post 1 in this thread.

    Hope this helps you
    Enjoy Pythoning
    Gaba88

  12. #12
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Re: Placing data files and using py2sis option --extrasdir

    @JOM

    The files are inside of the SIS and path is correct
    Reason for that way, was access problems to apps own folder

    @gaba88

    thx, very interesting and promising summary. I toke this longer way, but also no success.

    The files will not copied to the device, but without error. If do this per hand, the app runs perfect.

    Because I thought, it is because of a device failure, I tried with another one, also without success.

  13. #13
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: Placing data files and using py2sis option --extrasdir

    Quote Originally Posted by andipro View Post
    Hi!
    Does anybody can give be an example for the option –extrasdir, please? Thx!
    I could not use it as well. In fact, I would like to have some -extrasfile ;-) for adding my mif file.
    So, for a while, I decided to convert my mif file in a python file (this way emsymble packs it together my *.py files) and I regenerate it when running the app, only at first time.

    Ungly ? Maybe ... but it works.

    My "mif2py", used to generate icons.py:

    Code:
    import zlib
    
    fi = open('wordmobi.mif','rb')
    fo = open('icons.py','wt')
    
    fo.write( "ICONS = '''")
    data = zlib.compress(fi.read())
    for p in range(0,len(data),40):
        line = data[p:p+40]
        fo.write( "\n" )
        d = "".join([ "%02X" % ord(b) for b in line ])
        fo.write( d )
    
    fo.write( "'''\n")
    fo.close()
    fi.close()
    My decode routine, py2mif:

    Code:
    import zlib
    from icons import ICONS
    
    fo = open('wordmobi2.mif','wb')
    
    data = "".join(ICONS.split("\n"))
    data = [ "%c" % chr(int(data[p:p+2],16)) for p in range(0,len(data),2) ]
    data = "".join(data)
    fo.write( zlib.decompress(data) )
    fo.close()
    the icons.py seems like below:

    Code:
    ICONS = '''
    789CED9DDB6E5CD9718619033112070E12C040AE127438371EA4D95CE7836CC5C8C88E13408907F0
    38412E39626B445B430A24E7E4ABDCE63E405E24C8BBE40DF218F9FE5A9B6293DC925A1267343628
    
    .... <large block of hexa> ....
    
    D0BA45FE4A5B45B56DD97FF4A3E73136608EAA89D563086F34CCE9BBBD925A992DBEABA887619FA8
    2465B6548DE679D6D14167A38AECD14559C219CAC359567E1D532BDF891C5DA973FC7FE9C4D742'''

  14. #14
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Re: Placing data files and using py2sis option --extrasdir

    Hi marcelobarrosalmeida,

    I am really happy to hear not to be the only having problems with install additional files files via SIS

    Your idea is really very interesting. But I've to install about dotzend of PNG files and a datafile with about 1000 records.

    In the meantime I was trying the procedur also with another PC to locate the trouble shooting. But the problem still exists, with extrasdir and also without it, by placing the files in the apps own folder.

  15. #15
    Registered User
    Join Date
    Oct 2006
    Location
    Austria - Vienna
    Posts
    30

    Arrow Re: Placing additional files and using py2sis

    I have achieved a working SIS file with the mergesis way.

    But I am not really happy, because the users have to confirm the installation of the second package, too.

    Also, the images of this file package installed in a folder with free access. So, for example, they are shown in the gallery and of course they are not protected (against delete).

    So I am still interested in, why the additional files like PNG and E32DBM are not copied into the apps own folder during the installation with py2sis and folder declaration.

Posting Permissions

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