How to autostart an application on boot up using Startup List Management API
Article Metadata
Code Example
Article
Contents |
Startup List Management API
Steps for auto-starting an EXE on boot time in S60 3rd Edition.
1. Create an .RSS file in your project's directories (e.g. in the <PRJ_DIRECTORY>\DATA directory, where the other RSS files are located too)
For example: 06000001.rss
Here a number is used for the name, which is the same as the Package UID (pUID) of the project. This might help later in identifying the resource and is a good reminder when adding the entry in the PKG file. The name is however irrelevant at this point.
Add the following code to the new .rss file:
#include <startupitem.rh>
RESOURCE STARTUP_ITEM_INFO startexe
{
executable_name = "c:\\sys\\bin\\StartEXE.exe";
recovery = EStartupItemExPolicyNone;
}
In the code above:
- c: represents the drive where the program to be started is expected to have been installed
- If the drive is not known (will be selected at install time) use the wild card encoding for drives, the !:
- StartEXE.exe is the name of the application to be started and this will of course depend on your choice of name for your project. Must be the same as specified for the TARGET statement in the MMP file.
2. Open your .MMP file.
Add the following lines to include the new resource in the build.
START RESOURCE ..\DATA\06000001.rss
END
- The path specified above is relative to the MMP file location, usually in the <PRJ_DIRECTORY>\GROUP. The path must point to the new RSS file created so make sure that the string is in sync with the file location decided at step 1. above.
3. Add the following entry in your .PKG file:
"C:\Symbian\9.1\S60_3rd_MR\Epoc32\data\06000001.rsc"-"c:\private\101f875a\import\[06000001].rsc"
- Application can be installed on any drive (either phone memory or memory card) but resource file [uid].rsc must be in c:\private\101f875a\import\ .
- C:\Symbian\9.1\S60_3rd_MR\ represent the install path (aka EPOCROOT) of the SDK you use. If the PKG file is used exclusively under Carbide.c++ you can replace this string with the macro $(EPOCROOT)
- The *.rsc file is the result of compiling the *.rss file created at step one. It will not exist before re-building the project. Also, the extension might be different if your project's supported languages set does not include "SC", e.g. the extension could be *.r01. See Internationalization.
- The resource file must be always copied on the drive c:, in a special data cage, so the destination path is always the same: c:\private\101f875a\import\
- The name of the file must be changed when copied on the device. It will always be the Package UID (pUID) (as specified in the header of the PKG file) but without the 0x prefix and enclosed by square brackets ([ and ]).
4. That's it. Now just build re-build the project making sure that the new resource file is built and if everything else is ok with the project you will obtain a sis files ready to install on the phone. On the next phone reboot your application will be started automatically.
Notes
- If the EXE exits within a few (about 5?) seconds of starting up, a message is displayed, reading: Unable to start <name of EXE>. Application may need to be removed.
- There are several Known Issues and Technical Solutions about using the Startup List logged in the Developer Library. Search for "Startup List" to get an up-to-date overview.
- Startup List Management API does not work with Self-Signed application. It should be signed with a trusted certificate (Open Signed Online or Open Signed Offline during R&D stage and Symbian Signed when released) even if otherwise the capabilities required for the project do not justify it.
- It is observed that on some phones (tested on E61) this startup list manager API works for self-signed apps with capability WriteUserData (and unprotected-range UID) too.
- The exe to be started must be installed directly from the root of the package that contains the resource file (not accepted from embedded file)
Useful links
- Read this whole thread which contains all the possible cases working with Strtup List Management API http://www.developer.nokia.com/Community/Discussion/showthread.php?138079-Auto-Startup-Application-Signing!
- In case your application (on 3rd Ed FP1 device) is not starting o phone restart, after following exactly the same steps (obtaining protected range UID3 and Open Signed Online/Offline (for development purpose)) try .rsc instead of .r01.
e.g. first compile the application with the method as told above - "$(EPOCROOT)Epoc32\data\2002F1C8.r01" -"c:\private\101f875a\import\[2002F1C8].r01" once .r01 is generated, rename it to .rsc "$(EPOCROOT)Epoc32\data\2002F1C8.rsc" -"c:\private\101f875a\import\[2002F1C8].rsc" and recompile the file.
- This Nokia developer library link also explains the whole autostart up process along with an example as how to add multiple exe's to autostart withing single installable file : Using Startup List Management API (See the section Adding multiple executables)


03 Sep
2009
Autostart of applications during the device boot is a very important feature. S60 3rd Edition offers completely new approach for realization of such feature. Previous S60 2nd allows to realize autostart with the help of the file recognizers - currently such approach is not suitable because of the Platform Security.
Article contains useful and important information, you have to clearly understand all parts of the article for success. Anyway you should also remember about Symbian Signed Criteries - it's necessary to switch off autostart by default.
26 Sep
2009
Autostart is an important feature to start application at device boot-up. Although autostart feature can also be applied to GUI applications, this feature is more important in background running exes, which monitor some events to occur. Startup List Management API, which is introduced from S60 release 3.0 and onwards, provides means for third party developers to add their native applications into the device’s modifiable startup list in order to launch the application at device boot-up.
Article describes how to use Startup List Management API for S60 3rd Edition and S60 5th Edition devices. Each section of article is important to implement autostart. Application that use Startup List Management API can not work with self-signed certificate, so do not forgot to use trusted certificate to sign application.
Honestly, at-least 2 beginners ask the question "how do i start application on boot-up" everyday in Forum Nokia Discussion Boards and people suggest them to read this article.
Hi ,
I did the above steps but unable to autostart the application. I am using NokiaE61 device.
Where I am wrong?
---Sumit
@Sumit: Have you signed your .Sis file with Self-Sign Certificate or with Developer Certificate?
Contents
Autostart not working when installed on memory card on N73
I am using steps specified in "Startup List Management API" in "S60 3rd Edition SDK for Symbian OS API" reference guide. Startup of the exe works ok when application is installed on c. However, if application is installed on memory card, exe does not start-up. No error is shown. Handset is an N73 with firmware v3.0638.0.0.1.
Anybody know solution for this?
Difficulty in following the steps
Hi, I am using carbide.vs 3.0.1 with visual studio.net 2005 and S60 3rd edition FP1. I am developing for Nokia N95. I am trying to make the sample helloworld to start on boot. I am having following difficulties in following the steps mentioned:
So when I add "C:\Symbian\9.2\S60_3rd_FP1\epoc32\Data\06000001.rsc"-"c:\private\101f875a\import\[06000001].rsc" to my PKG file and build with configuration GCCE UREL to generate SIS, I get I/O error on the line added in the PKG file.
Please give me some suggestions to proceed.
NB, is it sufficient to sign my SIS through symbiansigned.com with all capabilities granted so that it may start on boot?
--Tanvir
==> I have found the 06000001.RSC in C:\Symbian\9.2\S60_3rd_FP1\Epoc32\Data\z\resource\apps and as I added "C:\Symbian\9.2\S60_3rd_FP1\epoc32\Data\z\resource\apps\06000001.RSC" - "!:\private\101f875a\import\[06000001].rsc" in the PKG file, SIS is now built seamlessly. I have signed through symbiansigned.com and it successfully installs on Nokia N95.
But it starts on boot only when SIS is installed on phone memory and not on the memory card.
NB, SISExplorer gave me a kind of ground about what to expect inside a SIS. Whether to use "c:\private\101f875a\import\[06000001].rsc" or "!:\private\101f875a\import\[06000001].rsc"
-Tanvir
Making the article more generic
I've seen recently some conflicting edits in this article and based on that information I would like to suggest that the article should be made to look more generic:
For example the file name in the resource can be formated so as to indicate that it is a component that the developer would need to change it according to his own project. Italic text and maybe color coding can be used.
ltomuta 16:26, 19 June 2008 (EEST)
Just made some changes accordingly, please verify it and correct it if you find anything improper.
--kiran10182 16:57, 19 June 2008 (EEST)
About the RSS file
At least I had to put the new RSS file in the data folder (instead of group).
-witherd-
That indeed the standard location for rss files however the locations is not that relevant if you specify the correct path in the MMP file.
ltomuta 13:16, 8 July 2008 (EEST)
About point#2
1) I could see something ' in the '..DATA\.... Is it intentional or a typo?
2) Some comments regarding .r01 has been removed. I guess we had a discussion about this in Making the article more generic
--kiran10182 20:26, 8 July 2008 (EEST)
Ok, consider it fixsed :)
ltomuta 21:37, 8 July 2008 (EEST)
As far as my first point was concerned, i was referring to ´ character which was there previously. I guess it was typo and i removed that character. :)
--kiran10182 22:57, 8 July 2008 (EEST)
ltomuta 23:00, 8 July 2008 (EEST)
Hi Lucian, i am bit lost here. I am not able to understand your statement. Perhaps i am sleepy and sitting in the dark room. ;)
--kiran10182 23:46, 8 July 2008 (EEST)
Just as I could not understand you before. It was a long day today ... :)
ltomuta 23:53, 8 July 2008 (EEST)
Mazhar cse - Autostart not working in 3rd Edition
I have created an application and added auto-start feature. It works well in 3rd edition Feature pack2 (N95). but when I build same application for 3rd edition (N73, N93), auto-start doesn't work.
Is there any difference for 3rd edition Fp2 and 3rd Edition? Do any one know the solution?mazhar_cse 11:55, 20 August 2011 (EEST)
Hamishwillee - Try asking on discussion boards
Hi Mazhar cse
Suggest you ask on the forums. Unless there is a specific issue with the article, you're likely to get more answers where the developers "hang out".
If however you do get an answer, updating the document would be helpful to others
Regards
Hamishhamishwillee 05:25, 23 August 2011 (EEST)
Swtdol - autostart feature not working
I added above lines to my code but still autostart feature on device reboot is not working for me on nokia e5..HELP!!swtdol 15:56, 16 June 2012 (EEST)