Log_begin ("Install the widget ");
Cactivescheduler * activescheduler = new cactivescheduler ();
Cactivescheduler: Install (activescheduler );
Rwssession wssession;
User: leaveiferror (wssession. Connect ());
Tapatasklist tasklist (wssession );
Const tuid kinstalleruid = {0x101f875a };
While (tasklist. findapp (kinstalleruid). exists ())
{
Log_write ("Waiting install to finish ");
User: After (ttimeintervalmicroseconds32 (1000000 ));
}
Rapalssession lssession;
User: leaveiferror (lssession. Connect ());
Cleanupclosepushl (lssession); // + lssession
Tfilename widgetname;
Widgetname. Copy (rprocess (). filename (). Left (2 ));
Widgetname. append (_ L ("// system // data // mywidget. WGT "));
Tthreadid ID;
Tint err = lssession. startdocument (widgetname, ID );
Log_format2 (_ L ("Start the Widget: % s (% d)"), & widgetname, err );
User: After (ttimeintervalmicroseconds32 (2000000 ));
Cleanupstack: popanddestroy ();
Delete activescheduler;
Log_end ("Install the widget ");