javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java
changeset 56 abc41079b313
parent 35 85266cc22c7f
child 64 0ea12c182930
equal deleted inserted replaced
50:023eef975703 56:abc41079b313
    97      * Return value which indicates that installer must not exit with
    97      * Return value which indicates that installer must not exit with
    98      * System.exit(). This return value is only used for internally.
    98      * System.exit(). This return value is only used for internally.
    99      */
    99      */
   100     static final int RET_NO_SYSTEM_EXIT = 100;
   100     static final int RET_NO_SYSTEM_EXIT = 100;
   101 
   101 
       
   102     /** Id for installer cancel Comms message. */
       
   103     private static final int INSTALLER_CANCEL_MESSAGE_ID = 603;
       
   104     /** Id for installer cancel Comms response message. */
       
   105     private static final int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604;
       
   106 
   102     // ThreadDumper instance.
   107     // ThreadDumper instance.
   103     private static ThreadDumper iThreadDumper = null;
   108     private static ThreadDumper iThreadDumper = null;
   104 
   109 
   105     // Installer CommsServer.
   110     // Installer CommsServer.
   106     private static CommsServerEndpoint iInstallerServer = null;
   111     private static CommsServerEndpoint iInstallerServer = null;
   321         {
   326         {
   322             Log.log("JAVA_BIN_ROOT=" + javaBinRoot);
   327             Log.log("JAVA_BIN_ROOT=" + javaBinRoot);
   323         }
   328         }
   324 
   329 
   325         StartUpTrace.doTrace("Installer.mainWithResult " + aArgs[0] + " begins");
   330         StartUpTrace.doTrace("Installer.mainWithResult " + aArgs[0] + " begins");
   326         StringBuffer buf = new StringBuffer("Java install process started with command: ");
   331         StringBuffer buf = new StringBuffer("Java install process started with command:");
   327         for (int i = 0; i < aArgs.length; i++)
   332         for (int i = 0; i < aArgs.length; i++)
   328         {
   333         {
   329             buf.append(" ").append(aArgs[i]);
   334             buf.append(" ").append(aArgs[i]);
   330         }
   335         }
   331         Log.logInfoPrd(buf.toString());
   336         Log.logInfoPrd(buf.toString());
  1233             "  -skipjarcheck                 Skip application package scanning.\n"+
  1238             "  -skipjarcheck                 Skip application package scanning.\n"+
  1234             "  -skipotastatus                Skip OTA status handling.\n"+
  1239             "  -skipotastatus                Skip OTA status handling.\n"+
  1235             "  -commsresult=endpoint         In the end of operation, send\n"+
  1240             "  -commsresult=endpoint         In the end of operation, send\n"+
  1236             "                                InstallerResultMessage to specified comms\n"+
  1241             "                                InstallerResultMessage to specified comms\n"+
  1237             "                                endpoint.\n"+
  1242             "                                endpoint.\n"+
       
  1243             "  -base64=base64options         Comma separated list of base64 encoded\n"+
       
  1244             "                                options.\n"+
  1238             "\n"+
  1245             "\n"+
  1239             "Either -jad or -jar must be specified, other options are optional.\n";
  1246             "Either -jad or -jar must be specified, other options are optional.\n";
  1240 
  1247 
  1241         String uninstallCmd =
  1248         String uninstallCmd =
  1242             "Uninstalls Java application suite.\n"+
  1249             "Uninstalls Java application suite.\n"+
  1262             "                                anything. This option is for debugging\n"+
  1269             "                                anything. This option is for debugging\n"+
  1263             "                                purposes only.\n"+
  1270             "                                purposes only.\n"+
  1264             "  -captainmsgs=yes|no           If set to no, JavaInstaller will not send\n"+
  1271             "  -captainmsgs=yes|no           If set to no, JavaInstaller will not send\n"+
  1265             "                                any messages to JavaCaptain during\n"+
  1272             "                                any messages to JavaCaptain during\n"+
  1266             "                                uninstallation. Default is yes.\n"+
  1273             "                                uninstallation. Default is yes.\n"+
       
  1274             "  -resetpreinstall              Reset preinstall state.\n"+
  1267             "  -skipotastatus                Skip OTA status handling.\n"+
  1275             "  -skipotastatus                Skip OTA status handling.\n"+
  1268             "  -commsresult=endpoint         In the end of operation, send\n"+
  1276             "  -commsresult=endpoint         In the end of operation, send\n"+
  1269             "                                InstallerResultMessage to specified comms\n"+
  1277             "                                InstallerResultMessage to specified comms\n"+
  1270             "                                endpoint.\n"+
  1278             "                                endpoint.\n"+
       
  1279             "  -base64=base64options         Comma separated list of base64 encoded\n"+
       
  1280             "                                options.\n"+
  1271             "\n"+
  1281             "\n"+
  1272             "The -uid option must be specified, other options are optional.\n";
  1282             "The -uid option must be specified, other options are optional.\n";
  1273 
  1283 
  1274         String uninstallAllCmd =
  1284         String uninstallAllCmd =
  1275             "Uninstalls all installed Java application suites.\n"+
  1285             "Uninstalls all installed Java application suites.\n"+
  1464                 int result = ERR_GENERAL;
  1474                 int result = ERR_GENERAL;
  1465                 Log.log("InstallerListener received " + aMessage);
  1475                 Log.log("InstallerListener received " + aMessage);
  1466                 if (aMessage.hasPermission(CommsPermission.INSTALL_APPLICATION))
  1476                 if (aMessage.hasPermission(CommsPermission.INSTALL_APPLICATION))
  1467                 {
  1477                 {
  1468                     int msgId = aMessage.getMessageId();
  1478                     int msgId = aMessage.getMessageId();
  1469                     if (msgId == 603)
  1479                     if (msgId == INSTALLER_CANCEL_MESSAGE_ID)
  1470                     {
  1480                     {
  1471                         Installer.cancel();
  1481                         Installer.cancel();
  1472                         result = ERR_NONE;
  1482                         result = ERR_NONE;
  1473                     }
  1483                     }
  1474                 }
  1484                 }
  1477                     Log.logWarning("InstallerListener received message " +
  1487                     Log.logWarning("InstallerListener received message " +
  1478                                    "with no INSTALL_APPLICATION permission");
  1488                                    "with no INSTALL_APPLICATION permission");
  1479                 }
  1489                 }
  1480                 CommsMessage response = new CommsMessage();
  1490                 CommsMessage response = new CommsMessage();
  1481                 response.replyTo(aMessage);
  1491                 response.replyTo(aMessage);
  1482                 response.setMessageId(604);
  1492                 response.setMessageId(INSTALLER_CANCEL_RESPONSE_MESSAGE_ID);
  1483                 response.write(result);
  1493                 response.write(result);
  1484                 iInstallerServer.send(response);
  1494                 iInstallerServer.send(response);
  1485                 Log.log("InstallerListener sent " + response);
  1495                 Log.log("InstallerListener sent " + response);
  1486             }
  1496             }
  1487             catch (Throwable t)
  1497             catch (Throwable t)