| Reply | « Previous Thread | Next Thread » |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
Hi
I am trying to implement a feature for updating my application. Just a "Check for updates" menu entry that downloads the latest .sis file and installs it. Checking and downloading the sis is really easy but when I call Content_handler to execute it things go bad. It seems that Content_handler runs in the same thread of the calling application. So, when the installer asks for killing the current running application, it is killed as well. In fact, it becomes something like a "zombie" and can not be removed from tasklist anymore. ![]() Reading Python docs, I found e32.start_exe(): e32.start_exe(filename, command [,wait ]) So, it seems that I can call the installer using the sis as its argument. The question is: where is the installer or any application launcher in S60 ? Is the path for this installer the same for all S60 phones ? ![]() Documentation talks about e32.start_server call as well. Is it possible to call a non-ui script and use Content_handle from it ? ![]() Suggestions are very welcome ! Marcelo Barros |
|
Quote:
Quote:
Quote:
Quote:
You could create two SIS files with Ensymble and merge them. One for your application and one for an "update agent", which handles the update procedure from a separate process. Your application could then run the update agent periodically or on demand and it would determine if there are updates available and install them. |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
He could do that mergesis, but I think that's not the point. He said that he can download the package but don't know how to install the .sis file downloaded. He would still have the same issue if using mergesis. Actually, I don't know any way to do this, I will search more ![]() BR, Rafael. |
|
Continuing the idea of an update agent...
The agent itself would probably need to be updated less frequently. A PyS60 program can overwrite its own files under the private directory, so updates to the update agent could be in the form of a zip file or something similar. The update agent would unpack the zip file in the private directory, overwriting its files with new ones. The only downside is that there can be no changes to files outside the private directory. |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
![]() I think he wouldn't need files outside the private directory, so this should be the best option ![]() BR, Rafael. |
|
Quote:
By the way, there's also open_standalone() for Content_handler(). It uses a separate process and might allow the original application to close before the update takes place. |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
![]() open_standlone() seems to be a good option ![]() BR, Rafael. |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
Hi !
Before testing something more elaborated, like sis with two programs, I tested open_standalone(). I really seemed to be the solution. I did something like below: Code:
viewer = Content_handler( lambda: None )
try:
viewer.open_standalone( local_file )
except:
note(u"Impossible to open %s" % local_file,"error")
Documentation statement: "The handler application is started in its own process". So, what happened ? ![]() |
|
Quote:
|
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
![]() BR, Rafael. |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
Hum... But I dont have any file opened (at least I think that I dont have !). The job is done by urllib:
urllib.urlretrieve( file_url, local_file ) The code is here: http://code.google.com/p/wordmobi/so...rdmobi.py#1063 |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
I did two more tests:
1) I generated a html file, put the download link inside it and tried to call open() and open_standalone() using this file. open() => browser opens but installation fails (as expected and discussed here) open_standalone() => browser does not open but file remains open(). So, I think it was started but its window does not show up.![]() |
|
It can very well be that you cannot start the installer from the application that is about to be updated. Some resource is kept allocated by the application (even if using open_standalone() and closing the application afterwards), causing the installer to terminate.
|
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
Yes, I agree ... And it is related to the interpreter, in my opinion. So, talking about the other option, I mean, running an update agent, I would like to know some details:
* I read about mergesis and I think it is easy to concatenate the application and the update agent. But, how can I run this update agent from my application ? Is there any kind of launcher ? |
|
Quote:
Remember that the user may install the SIS file in the internal memory or on a memory card. You can limit the installation with the --drive option to the py2sis command of Ensymble, but the PyS60 runtime may have been installed in another drive. This can cause application startup problems. Maybe the best way is to try to run the agent from the same drive your application is installed in. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| howto check what feature pack is in phone | miikkis | General Symbian C++ | 2 | 2008-09-05 11:40 |
| Check List. | fmhunter | Mobile Java Tools & SDKs | 2 | 2005-08-06 20:38 |
| 6310i voice dialing feature with Headset | lubaru | Bluetooth Technology | 1 | 2003-02-27 06:09 |
| SMS Msg using VB Application | gurup83 | General Messaging | 2 | 2002-07-11 05:48 |
| WML feature 'accesskey' | cschlaep | Browsing and Mark-ups | 1 | 2002-05-13 10:41 |