widgettools/wrtwidgetpreinstaller/src/installwidgets.pl
branchRCL_3
changeset 15 0891752adab8
parent 13 78ea955b5d24
child 16 b685c59de105
equal deleted inserted replaced
13:78ea955b5d24 15:0891752adab8
    19 use File::Spec::Functions;
    19 use File::Spec::Functions;
    20 use Getopt::Long;
    20 use Getopt::Long;
    21 use Pod::Usage;
    21 use Pod::Usage;
    22 
    22 
    23 # Version of the script - just use the date
    23 # Version of the script - just use the date
    24 $main::VERSION = '25-May-2010';
    24 $main::VERSION = '22-June-2010';
    25 
    25 
    26 # New getopt::long provides this - but old version doesn't?
    26 # New getopt::long provides this - but old version doesn't?
    27 sub version
    27 sub version
    28   {
    28   {
    29   print sprintf("$0: $main::VERSION\n$^X: %vd\nos: $^O", $^V);
    29   print sprintf("$0: $main::VERSION\n$^X: %vd\nos: $^O", $^V);
   552       }
   552       }
   553       
   553       
   554       if($isSharedLibrary)
   554       if($isSharedLibrary)
   555       {
   555       {
   556         #In case of NOKIA:sharedlibrary, the extracted widget contents and data source are stored under private\<uid>\..\lib\<sharedfoldername>\
   556         #In case of NOKIA:sharedlibrary, the extracted widget contents and data source are stored under private\<uid>\..\lib\<sharedfoldername>\
   557         $widgetdata->{'BasePath'} = sprintf('%s\\private\\%08x\\%s\\%s\\%s\\', $widgetdata->{'DriveName'}, $widget_uid, "widgets_21D_4C7","lib",$sharedFolderName);
   557         $widgetdata->{'BasePath'} = sprintf('%s\\private\\%08X\\%s\\%s\\%s\\', $widgetdata->{'DriveName'}, $widget_uid, "widgets_21D_4C7","lib",$sharedFolderName);
   558         $widgetdata->{'IconPath'} = sprintf('%s\\private\\%08x\\%s\\%s\\%s\\',$widgetdata->{'DriveName'}, $widget_uid, "data" ,"lib" ,$sharedFolderName);
   558         $widgetdata->{'IconPath'} = sprintf('%s\\private\\%08X\\%s\\%s\\%s\\',$widgetdata->{'DriveName'}, $widget_uid, "data" ,"lib" ,$sharedFolderName);
   559       }
   559       }
   560       else
   560       else
   561       {
   561       {
   562         $widgetdata->{'BasePath'} = sprintf('%s\\private\\%08x\\%s\\%s\\', $widgetdata->{'DriveName'}, $widget_uid, "widgets_21D_4C7", hashpjw($widgetdata->{'BundleIdentifier'}));
   562         $widgetdata->{'BasePath'} = sprintf('%s\\private\\%08X\\%s\\%s\\', $widgetdata->{'DriveName'}, $widget_uid, "widgets_21D_4C7", hashpjw($widgetdata->{'BundleIdentifier'}));
   563         $widgetdata->{'IconPath'} = sprintf('%s\\private\\%08x\\%s\\%s\\',$widgetdata->{'DriveName'}, $widget_uid, "data" , hashpjw($widgetdata->{'BundleIdentifier'}));
   563         $widgetdata->{'IconPath'} = sprintf('%s\\private\\%08X\\%s\\%s\\',$widgetdata->{'DriveName'}, $widget_uid, "data" , hashpjw($widgetdata->{'BundleIdentifier'}));
   564       }
   564       }
   565       $widgetdata->{'MainHTML'} = "$widgetdata->{'BasePath'}$startsrc";
   565       $widgetdata->{'MainHTML'} = "$widgetdata->{'BasePath'}$startsrc";
   566       $widgetdata->{'AllowNetworkAccess'} = 1;
   566       $widgetdata->{'AllowNetworkAccess'} = 1;
   567       
   567       
   568       }
   568       }
   597     else
   597     else
   598       {
   598       {
   599       # Find the next free UID to use
   599       # Find the next free UID to use
   600       $widgetdata->{'Uid'} = $self->findfreeUid($widgetdata);
   600       $widgetdata->{'Uid'} = $self->findfreeUid($widgetdata);
   601       }
   601       }
   602     print sprintf("Using UID for midlet: 0x%08x\n", $widgetdata->{'Uid'}) if $self->{args}->{'verbose'};
   602     print sprintf("Using UID for midlet: 0x%08X\n", $widgetdata->{'Uid'}) if $self->{args}->{'verbose'};
   603 
   603 
   604     # Make sure the destination exists
   604     # Make sure the destination exists
   605     my $dest = $self->regFileName($drive);
   605     my $dest = $self->regFileName($drive);
   606     mkpath $dest;
   606     mkpath $dest;
   607 
   607 
   746 			      }
   746 			      }
   747             
   747             
   748             # NOKIA:sharedlibrary check
   748             # NOKIA:sharedlibrary check
   749             if($isSharedWidget)
   749             if($isSharedWidget)
   750             {
   750             {
   751                 $dataDir = fixFilename(catfile($self->destLocation($drive), 'Private', sprintf("%08X", $widget_uid),"data","lib",$sharedFolderName));
   751                 $dataDir = fixFilename(catfile($self->destLocation($drive), 'private', sprintf("%08X", $widget_uid),"data","lib",$sharedFolderName));
   752             }
   752             }
   753             else
   753             else
   754             {
   754             {
   755                 #in case of WGT copy .mbm to \epoc32\winscw\C\Private\200267c0\data\hash<BundleId>\
   755                 #in case of WGT copy .mbm to \epoc32\winscw\C\private\200267c0\data\hash<BundleId>\
   756                 $dataDir = fixFilename(catfile($self->destLocation($drive), 'Private', sprintf("%08X", $widget_uid),"data", $hashval));
   756                 $dataDir = fixFilename(catfile($self->destLocation($drive), 'private', sprintf("%08X", $widget_uid),"data", $hashval));
   757             }
   757             }
   758             mkpath $dataDir;
   758             mkpath $dataDir;
   759             $destFile = catfile($dataDir,$mbmName);
   759             $destFile = catfile($dataDir,$mbmName);
   760         }
   760         }
   761         else
   761         else
  1107           }
  1107           }
  1108         }
  1108         }
  1109         $uid = $self->{'freeuidwrtext'}++;   # Assign and then set next free UID
  1109         $uid = $self->{'freeuidwrtext'}++;   # Assign and then set next free UID
  1110       }
  1110       }
  1111     }
  1111     }
  1112   print sprintf(" Generated UID: hex->0x%08x dec->$uid\n \n",$uid);
  1112   print sprintf("Generated UID: hex->0x%08X dec->$uid\n \n",$uid);
  1113   return $uid;
  1113   return $uid;
  1114   }
  1114   }
  1115 
  1115 
  1116 # Fix slash problems in a filename
  1116 # Fix slash problems in a filename
  1117 sub fixFilename
  1117 sub fixFilename
  1162 	{
  1162 	{
  1163 		$widget_uid = CWRT_WIDGET_UI_UID;
  1163 		$widget_uid = CWRT_WIDGET_UI_UID;
  1164 	}
  1164 	}
  1165     if($isSharedLibrary)
  1165     if($isSharedLibrary)
  1166     {
  1166     {
  1167     	$result = catfile($self->destLocation($drive), 'Private', sprintf("%08X", $widget_uid),"widgets_21D_4C7", "lib",$sharedFolderName);
  1167     	$result = catfile($self->destLocation($drive), 'private', sprintf("%08X", $widget_uid),"widgets_21D_4C7", "lib",$sharedFolderName);
  1168     }
  1168     }
  1169     else
  1169     else
  1170     {
  1170     {
  1171         $result = catfile($self->destLocation($drive), 'Private', sprintf("%08X", $widget_uid),"widgets_21D_4C7", $hashval);
  1171         $result = catfile($self->destLocation($drive), 'private', sprintf("%08X", $widget_uid),"widgets_21D_4C7", $hashval);
  1172     }
  1172     }
  1173   }
  1173   }
  1174   else
  1174   else
  1175       {
  1175       {
  1176 	  	if ($isSecureWidget){
  1176 	  	if ($isSecureWidget){
  1844   	$widget_uid = CWRT_WIDGET_UI_UID;
  1844   	$widget_uid = CWRT_WIDGET_UI_UID;
  1845   }
  1845   }
  1846 
  1846 
  1847   if($isSharedLibrary)
  1847   if($isSharedLibrary)
  1848   {
  1848   {
  1849       $secSession = fixFilename(catfile($self->destLocation($drive), 'Private', sprintf("%08X", $widget_uid),"data","lib",$sharedFolderName,"secsession"));
  1849       $secSession = fixFilename(catfile($self->destLocation($drive), 'private', sprintf("%08X", $widget_uid),"data","lib",$sharedFolderName,"secsession"));
  1850   }
  1850   }
  1851   else
  1851   else
  1852   {
  1852   {
  1853       $secSession = fixFilename(catfile($self->destLocation($drive), 'Private', sprintf("%08X", $widget_uid),"data", $hashval,"secsession"));
  1853       $secSession = fixFilename(catfile($self->destLocation($drive), 'private', sprintf("%08X", $widget_uid),"data", $hashval,"secsession"));
  1854   }
  1854   }
  1855   print "\nGenerating: $secSession\n\n";
  1855   print "\nGenerating: $secSession\n\n";
  1856   
  1856   
  1857   # Write the file
  1857   # Write the file
  1858   mkpath dirname($secSession);
  1858   mkpath dirname($secSession);
  2094 
  2094 
  2095 =item 3
  2095 =item 3
  2096 
  2096 
  2097 Run the foll command to generate UDA
  2097 Run the foll command to generate UDA
  2098 
  2098 
  2099 B<Gadget:>
  2099 B<product1:>
  2100 X:\epoc32\tools>imaker -f /epoc32/rom/s60_makefiles/image_conf_sp_rnd_gadget.mk VARIANT_DIR=/variants variantuda
  2100 X:\epoc32\tools>imaker -f /epoc32/rom/s60_makefiles/image_conf_sp_rnd_product1.mk VARIANT_DIR=/variants variantuda
  2101 
  2101 
  2102 B<Tube:>
  2102 B<product2:>
  2103 Y:\epoc32\tools>imaker -f /epoc32/rom/config/ncp52/tube/image_conf_tube_ui.mk VARIANT_DIR=/variants variantuda 
  2103 Y:\epoc32\tools>imaker -f /epoc32/rom/config/ncp52/product2/image_conf_product2_ui.mk VARIANT_DIR=/variants variantuda 
  2104 
  2104 
  2105 =item 4
  2105 =item 4
  2106 
  2106 
  2107 Flash the fpsx file generated under X:\epoc32\rombuild\gadget\uda for Gadget and Y:\epoc32\rombuild\tube\uda for Tube to your device.
  2107 Flash the fpsx file generated under X:\epoc32\rombuild\product1\uda for Product 1 and Y:\epoc32\rombuild\product2\uda for Product 2 to your device.
  2108 
       
  2109 Note: More info on iMaker tool at: L<http://configurationtools.nmp.nokia.com/imaker/wiki/iMakerUserGuide>
       
  2110 
  2108 
  2111 =back
  2109 =back
  2112 
  2110 
  2113 =head3 LOCALISATION
  2111 =head3 LOCALISATION
  2114 
  2112