×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    209

    How to add icons to a stand alone Python application ("py2sis" -generated app)

    “py2sis” does not currently offer the possibility to add icons to the SIS-files it generates. Nevertheless, you can achieve this at least in two different ways:

    Option 1:

    1. Generate a stand alone installation “.sis” from your script (e.g. "foobar.py") with “py2sis” tool and install this application to your device

    2. See e.g. the instructions at http://www.newlc.com/article.php3?id_article=197 and generate an “.aif” file for your stand-alone installation. Notice especially that the UID given as a command line parameter to “py2sis” and in the “.rss” file need to match. Also the “.aif” filename needs to match with your application.

    3. Move the “.aif” file to the device and to the folder where you have installed the application in Step 1. (e.g. in “C:\”-drive the folder is “C:\System\Apps\foobar”). In order to achieve this you probably need a file browser in your device.

    Option 2:

    1. Generate a stand-alone installation “.sis” from your script with “py2sis” tool with the undocumented switch “--leavetemp”. This leaves the temporary files added to the generated “.sis” in your “py2sis” tool folder in a new subfolder “temp”, e.g. “C:\Nokia\Tools\Python_for_Series_60\py2sis\temp”.

    2. Create the “.aif” file for your application and add this file to the created “temp” folder (see the link in Step 2. in the Option 1).

    3. Add a line to the end of “.pkg” file under the "temp" folder specifying the “.aif” file, e.g.:

    "foobar.aif" -"!:\system\apps\foobar\foobar.aif"

    4. Run “makesis” with the modified “.pkg” file:

    makesis foobar.pkg

    5. Install the created “.sis” file to your device.

  2. #2
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    67

    Re: How to add icons to a stand alone Python application ("py2sis" -generated app)

    Just to confirm that option 2 works really well for making icons applying to standalone Python applications. It's a bit of a workaround and fiddly, but it gets there in the end.

    Steve

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

    Re: How to add icons to a stand alone Python application ("py2sis" -generated app)

    There's an easier way for this in UNIX-like systems. Python-to-SIS, the next generation has a support for application icons. It takes the icon in Symbian MBM format and generates the AIF file automatically.

    http://www.nbl.fi/jussi.ylanen/py2sisng.html

  4. #4
    Regular Contributor
    Join Date
    May 2006
    Posts
    74

    Re: How to add icons to a stand alone Python application ("py2sis" -generated app)

    Is there an easy way to convert bitmaps to .mbm files on UNIX-based systems.

    I had a look on the Gimp, but it doesn't seem to directly support .mbm files.

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

    Re: How to add icons to a stand alone Python application ("py2sis" -generated app)

    Quote Originally Posted by chetbox
    Is there an easy way to convert bitmaps to .mbm files on UNIX-based systems.
    I don't know about easy, but the original bmconv from Symbian is available in source form: http://symbianos.org/download/bmconv_1.1.0-2.tar.gz

    I had to modify it a little, as it sometimes generated invalid MBMs. Patch included:

    Code:
    diff -rC3 bmconv-1.1.0-2_orig/src/pbmcomp.cpp bmconv-1.1.0-2/src/pbmcomp.cpp
    *** bmconv-1.1.0-2_orig/src/pbmcomp.cpp	Mon Jan  5 02:23:39 2004
    --- bmconv-1.1.0-2/src/pbmcomp.cpp	Thu Sep 29 17:05:45 2005
    ***************
    *** 376,382 ****
    --- 376,387 ----
      	int dataSize = aPbm->iBitmapSize - sizeof(SEpocBitmapHeader);
      
      	WriteBuf32((char*)(aPbm),sizeof(SEpocBitmapHeader));
    + #if 0
      	WriteBuf16(((char*)(aPbm)) + sizeof(SEpocBitmapHeader),dataSize);
    + #else
    + 	// WriteBuf16() cannot handle odd number of bytes (2005-09-28 by JY)
    + 	iDestFile.write(((char*)(aPbm)) + sizeof(SEpocBitmapHeader),dataSize);
    + #endif
      
      	return NoError;
      	}
    Using bmconv is covered in other Forum Nokia Discussion boards. Icon MBMs should contain a 42x29 icon (12- or 16-bit color), a 42x29 mask (1-bit monochrome), a 44x44 icon (12- or 16-bit color) and a 44x44 mask (1-bit monochrome), in that order.

Posting Permissions

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