×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    107

    Installing embedded sis files silently using SwInst API

    I'm trying to get an application to install a set of required libraries at the end of the normal install process. I've created a simple console app to do the installation based on the example on the wiki. It looks like this:
    Code:
    #include "silentinstaller.h"
    #include <e32base.h>
    #include <e32std.h>
    #include <swinstapi.h>
    #include <swinstdefs.h>
    #include "AOSync.h"
    
    LOCAL_C void MainL() {
    	CAOSync* waiter = CAOSync::NewL();
    	CleanupStack::PushL(waiter);
    	
    	SwiUI::RSWInstSilentLauncher iLauncher; 
    	SwiUI::TInstallOptions iOptions;
    	SwiUI::TInstallOptionsPckg iOptionsPckg;  
    	 
    	iOptions.iUpgrade = SwiUI::EPolicyAllowed;
    	iOptions.iOCSP = SwiUI::EPolicyNotAllowed;
    	iOptions.iDrive = 'C';   
    	iOptions.iUntrusted = SwiUI::EPolicyAllowed; 
    	iOptions.iCapabilities = SwiUI::EPolicyAllowed; 
    	iOptions.iIgnoreOCSPWarnings = SwiUI::EPolicyAllowed;
    
    	iOptionsPckg = iOptions;  
     
    	iLauncher.Connect();     
    	TBuf<100> FName(_L("C:\\system\\apps\\test.sisx"));		 
    	iLauncher.SilentInstall(waiter->iStatus, FName,iOptionsPckg);
    	waiter->Execute();
    	
    	CleanupStack::PopAndDestroy(waiter);
    }
    
    LOCAL_C void DoStartL() {
    	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    	CleanupStack::PushL(scheduler);
    	CActiveScheduler::Install(scheduler);
    	MainL();
    	CleanupStack::PopAndDestroy(scheduler);
    }
    
    GLDEF_C TInt E32Main() {
    	__UHEAP_MARK;
    	CTrapCleanup* cleanup = CTrapCleanup::New();
    
    	TRAPD(mainError, DoStartL());
    
    	delete cleanup;
    	__UHEAP_MARKEND;
    	return KErrNone;
    }
    I have added the corresponding executable to the .pkg file from my main application using the FR, RI and RW options, so that it should be launched by the installer process. Both apps have the TrustedUI capability and the installer has been Symbian Signed as required. The test.sisx file referenced in the code above was created from the Carbide UI application wizard and the code hasn't been updated at all. When I build the test.sisx file for the emulator and run the installer app from eshell, it works correctly. When I try it on an actual phone, the main app is installed as normal but it never appears to install the test.sisx file. Is there anything obvious I'm doing wrong? Is there an easy way to debug the installation process, or at least check for an error/panic code?

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: Installing embedded sis files silently using SwInst API

    you can not install two things at the same time, since only one installer can be running at any given time, so instaal the second sis on the first run of the applciation, and do not run it during installation.

  3. #3
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Installing embedded sis files silently using SwInst API

    I will also add that a CONE (ie GUI application) is also required to use the silent installer
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  4. #4
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Installing embedded sis files silently using SwInst API

    U can use Embedded sis file concept in your PKG file, Search in SK help about EMBEDDED sis.

    Or if you want to install programatic then first install main sis file and install test.sis file from your main APP code, as Yukks said you can not install 2 sis file at same time.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  5. #5
    Registered User
    Join Date
    Mar 2006
    Posts
    107

    Re: Installing embedded sis files silently using SwInst API

    Quote Originally Posted by symbianyucca View Post
    you can not install two things at the same time, since only one installer can be running at any given time, so instaal the second sis on the first run of the applciation, and do not run it during installation.
    I'm not sure that's an option, because the main application depends on the dlls in the extra sis files - on some devices it may not be able to start properly at all until these files are installed, which is why I wanted to do it this way in the first place. Is there another alternative? Some way I can launch a background process from the main installer which will continue to run after the installer has finished and can install the extra .sis files silently?

    Quote Originally Posted by Paul.Todd View Post
    I will also add that a CONE (ie GUI application) is also required to use the silent installer
    Where is that documented?? I was able to get the code I posted above working in the emulator, and it's just a plain console app...

    Quote Originally Posted by aamitgupta View Post
    U can use Embedded sis file concept in your PKG file, Search in SK help about EMBEDDED sis.

    Or if you want to install programatic then first install main sis file and install test.sis file from your main APP code, as Yukks said you can not install 2 sis file at same time.
    I know about embedding sis files, the problem is that if I do it that way, the user has to click through a bunch of extra installation confirmations when they're installing the app, and that's hardly ideal. Installing them silently seemed like a better solution.

  6. #6
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Installing embedded sis files silently using SwInst API

    yes but at same time u can not install 2 sis file, do one thing, put wait in your lancher exe which launch through FR,RI, and after 2 min it install test.sis file.

    Aur launch auncher exe from your main aaplication when main application will run first time.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  7. #7
    Registered User
    Join Date
    Mar 2006
    Posts
    107

    Re: Installing embedded sis files silently using SwInst API

    Quote Originally Posted by aamitgupta View Post
    yes but at same time u can not install 2 sis file, do one thing, put wait in your lancher exe which launch through FR,RI, and after 2 min it install test.sis file.

    Aur launch auncher exe from your main aaplication when main application will run first time.
    OK, but won't the installer close the executable I launch with FR, RI after the installation is completed? Or will it be allowed to keep running after that?

  8. #8
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: Installing embedded sis files silently using SwInst API

    It depends on your pkg script. FR, RI, RW (run-wait) would ask the installer to wait for the exe to finish (which is not good for you). Using just FR, RI will get your file started and the installer can finish its job.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  9. #9
    Registered User
    Join Date
    Mar 2006
    Posts
    107

    Re: Installing embedded sis files silently using SwInst API

    OK, that's good. My next question is if I can somehow check when the main installer finishes, since I assume any attempts to do the silent installs will fail while it remains active...

  10. #10
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: Installing embedded sis files silently using SwInst API

    You can check when the installer process finishes or you can monitor a P&S key and then wait something like X seconds. First approach recommended.

    I am rather sure that the wiki contains all this in a ready made example (if not two). Try this one: http://wiki.forum.nokia.com/index.ph...sing_sis_files
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  11. #11
    Registered User
    Join Date
    Mar 2006
    Posts
    107

    Re: Installing embedded sis files silently using SwInst API

    Quote Originally Posted by ltomuta View Post
    You can check when the installer process finishes or you can monitor a P&S key and then wait something like X seconds. First approach recommended.

    I am rather sure that the wiki contains all this in a ready made example (if not two). Try this one: http://wiki.forum.nokia.com/index.ph...sing_sis_files
    Thank you for that link, it looks like it'll be very helpful. The one thing I'm not clear about is the UID issues. The app I'm trying to install already has a UID allocated to it from the 0x2xxxxxxx range. The wiki page seems to be saying that I need another UID from the same range to apply to the installer itself, since I presumably can't reuse the one I already have.

    Is this correct - should I request another UID from SymbianSigned before I go any further?

  12. #12
    Registered User
    Join Date
    Mar 2006
    Posts
    107

    Re: Installing embedded sis files silently using SwInst API

    I went ahead and obtained another 0x2xxxxxxx range UID, and was able to get the example modified to install my test.sisx file silently. I think I can extend it from there to install the other sis files I need.

    One final problem though. As I understand it, following the structure of the example application, I would have to get two applications Symbian Signed before distribution - the original application and the installer application. I would also have to include the original app.sis file in the signed installer to have it installed along with everything else.

    Is there any way I can set things up so that executable which performs the installations is actually a part of the original app.sis file, and is launched from there, rather than the other way around? It seems like the sort of configuration used in the example would greatly complicate the process of getting an app properly Symbian Signed.

  13. #13
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: Installing embedded sis files silently using SwInst API

    You did right about the UID, each application needs one, including the installer application. There might be some further discussion here depending on what exactly you do and why but the safe way to go is have your own UID.

    As for your other question, there is no way around it, the installer app must be outside the package to be installed and that implies a double layer. You will have to install first the inner files (those that the installer will work with) and then pack the signed files together with the installer in a wrapper file, which also needs to be signed.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  14. #14
    Registered User
    Join Date
    Mar 2006
    Posts
    107

    Re: Installing embedded sis files silently using SwInst API

    Quote Originally Posted by ltomuta View Post
    As for your other question, there is no way around it, the installer app must be outside the package to be installed and that implies a double layer. You will have to install first the inner files (those that the installer will work with) and then pack the signed files together with the installer in a wrapper file, which also needs to be signed.
    Maybe I'm misunderstanding you, but I managed to get it working without doing that...what I did was take my original application and modify its pkg file. I changed it to install my modified SoftwareInstaller executable (using FR, RI), plus the test.sisx file. Then I just added the TrustedUI capability in the corresponding mmp file and signed the main app as I normally would. When I tried installing it on a phone, it all seemed to work correctly and the test.sisx file was installed...

  15. #15
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: Installing embedded sis files silently using SwInst API

    Maybe I misunderstood your query so let's use pseudo-pkg to describe this clearly

    The following will work:

    Code:
    dependency.sisx
        depfile1
        depfile2
        depfile3
    
    app.sisx
        appfile1
        appfile2
        appfile3
        dependency.sisx
        silentinstaller.exe, FR,RI
    The following will work as well but it is not really needed:

    Code:
    wrapper.sis
        @app.sisx
        dependency.sisx
    The Nokia Silent Installer for Symbian uses the later approach but it does so since the app.sisx contains the installer only and it is a totally independent from the application is supposed to help deploying. It also has the aim of not letting the deployed application be visible in the phone until all dependencies are deployed and the application has all the needed support to be able to run.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

Similar Threads

  1. PC Suite error: (Code: Init IMediaControl2) HELP?!
    By chunkyspudmonkey in forum General Development Questions
    Replies: 29
    Last Post: 2008-06-30, 11:47
  2. Data files in SIS / emulator with Carbide C++
    By jonmccune in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-06-29, 21:36
  3. Installing emebedded SIS files
    By rihoe in forum Symbian
    Replies: 0
    Last Post: 2007-11-23, 10:15
  4. Signing embedded sis with different certificate
    By kwillms in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2007-11-12, 09:40
  5. Embedded SIS & App.Manager's "View Details"
    By vtatti in forum Symbian
    Replies: 1
    Last Post: 2004-09-30, 15:01

Posting Permissions

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