849 void CJavaSifPlugin::BuildInstallCommandLine( |
796 void CJavaSifPlugin::BuildInstallCommandLine( |
850 TPtr& aCommandLine, |
797 TPtr& aCommandLine, |
851 const COpaqueNamedParams& aArguments) |
798 const COpaqueNamedParams& aArguments) |
852 { |
799 { |
853 // KSifInParam_Drive -> -drive=install_target_drive (A, B, C, ..., Z) |
800 // KSifInParam_Drive -> -drive=install_target_drive (A, B, C, ..., Z) |
854 TInt intValue = GetPositiveIntParam(KSifInParam_Drive, aArguments); |
801 TInt intValue; |
855 // Value 0 is 'A:' drive and value 25 is 'Z:' drive |
802 RArray<TInt> intArray; |
856 if ((intValue > -1) && (intValue < 26)) // codescanner::magicnumbers |
803 TRAPD(err, intArray = aArguments.IntArrayByNameL(KSifInParam_Drive)); |
857 { |
804 if (err == KErrNone && intArray.Count() > 0) |
858 aCommandLine.Append(KDrive); |
805 { |
859 TChar drive('A'); |
806 // Java installer supports one installation drive only, so take |
860 drive += intValue; |
807 // the first parameter which is the most preferred drive. |
861 aCommandLine.Append(drive); |
808 intValue = intArray[0]; |
|
809 // Value 0 is 'A:' drive and value 25 is 'Z:' drive |
|
810 if ((intValue > -1) && (intValue < 26)) // codescanner::magicnumbers |
|
811 { |
|
812 aCommandLine.Append(KDrive); |
|
813 TChar drive('A'); |
|
814 drive += intValue; |
|
815 aCommandLine.Append(drive); |
|
816 } |
862 } |
817 } |
863 |
818 |
864 // KSifInParam_PerformOCSP Yes/No/AskUser -> -ocsp=yes|no |
819 // KSifInParam_PerformOCSP Yes/No/AskUser -> -ocsp=yes|no |
865 intValue = GetPositiveIntParam(KSifInParam_PerformOCSP, aArguments); |
820 intValue = GetPositiveIntParam(KSifInParam_PerformOCSP, aArguments); |
866 if (intValue == 0) // Yes |
821 if (intValue == Usif::EAllowed) // Yes |
867 { |
822 { |
868 aCommandLine.Append(KOcsp); |
823 aCommandLine.Append(KOcsp); |
869 aCommandLine.Append(KYes); |
824 aCommandLine.Append(KYes); |
870 } |
825 } |
871 else if (intValue == 1) // No |
826 else if (intValue == Usif::ENotAllowed) // No |
872 { |
827 { |
873 aCommandLine.Append(KOcsp); |
828 aCommandLine.Append(KOcsp); |
874 aCommandLine.Append(KNo); |
829 aCommandLine.Append(KNo); |
875 } |
830 } |
876 // AskUser is not supported |
831 // AskUser is not supported |
877 |
832 |
878 // KSifInParam_IgnoreOCSPWarnings Yes/No/AskUser -> -ignore_ocsp_warnings=yes|no |
833 // KSifInParam_IgnoreOCSPWarnings Yes/No/AskUser -> -ignore_ocsp_warnings=yes|no |
879 intValue = GetPositiveIntParam(KSifInParam_IgnoreOCSPWarnings, aArguments); |
834 intValue = GetPositiveIntParam(KSifInParam_IgnoreOCSPWarnings, aArguments); |
880 if (intValue == 0) // Yes |
835 if (intValue == Usif::EAllowed) // Yes |
881 { |
836 { |
882 aCommandLine.Append(KIgnoreOcspWarnings); |
837 aCommandLine.Append(KIgnoreOcspWarnings); |
883 aCommandLine.Append(KYes); |
838 aCommandLine.Append(KYes); |
884 } |
839 } |
885 else if (intValue == 1) // No |
840 else if (intValue == Usif::ENotAllowed) // No |
886 { |
841 { |
887 aCommandLine.Append(KIgnoreOcspWarnings); |
842 aCommandLine.Append(KIgnoreOcspWarnings); |
888 aCommandLine.Append(KNo); |
843 aCommandLine.Append(KNo); |
889 } |
844 } |
890 // AskUser is not supported |
845 // AskUser is not supported |
891 |
846 |
892 // KSifInParam_AllowUpgrade Yes/No/AskUser -> -upgrade=yes|no |
847 // KSifInParam_AllowUpgrade Yes/No/AskUser -> -upgrade=yes|no |
893 intValue = GetPositiveIntParam(KSifInParam_AllowUpgrade, aArguments); |
848 intValue = GetPositiveIntParam(KSifInParam_AllowUpgrade, aArguments); |
894 if (intValue == 0) // Yes |
849 if (intValue == Usif::EAllowed) // Yes |
895 { |
850 { |
896 aCommandLine.Append(KUpgrade); |
851 aCommandLine.Append(KUpgrade); |
897 aCommandLine.Append(KYes); |
852 aCommandLine.Append(KYes); |
898 } |
853 } |
899 else if (intValue == 1) // No |
854 else if (intValue == Usif::ENotAllowed) // No |
900 { |
855 { |
901 aCommandLine.Append(KUpgrade); |
856 aCommandLine.Append(KUpgrade); |
902 aCommandLine.Append(KNo); |
857 aCommandLine.Append(KNo); |
903 } |
858 } |
904 // AskUser is not supported |
859 // AskUser is not supported |
905 |
860 |
906 // KSifInParam_AllowUpgradeData Yes/No/AskUser -> -upgrade_data=yes|no |
861 // KSifInParam_AllowUpgradeData Yes/No/AskUser -> -upgrade_data=yes|no |
907 intValue = GetPositiveIntParam(KSifInParam_AllowUpgradeData, aArguments); |
862 intValue = GetPositiveIntParam(KSifInParam_AllowUpgradeData, aArguments); |
908 if (intValue == 0) // Yes |
863 if (intValue == Usif::EAllowed) // Yes |
909 { |
864 { |
910 aCommandLine.Append(KUpgradeData); |
865 aCommandLine.Append(KUpgradeData); |
911 aCommandLine.Append(KYes); |
866 aCommandLine.Append(KYes); |
912 } |
867 } |
913 else if (intValue == 1) // No |
868 else if (intValue == Usif::ENotAllowed) // No |
914 { |
869 { |
915 aCommandLine.Append(KUpgradeData); |
870 aCommandLine.Append(KUpgradeData); |
916 aCommandLine.Append(KNo); |
871 aCommandLine.Append(KNo); |
917 } |
872 } |
918 // AskUser is not supported |
873 // AskUser is not supported |
919 |
874 |
920 // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no |
875 // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no |
921 intValue = GetPositiveIntParam(KSifInParam_AllowUntrusted, aArguments); |
876 intValue = GetPositiveIntParam(KSifInParam_AllowUntrusted, aArguments); |
922 if (intValue == 0) // Yes |
877 if (intValue == Usif::EAllowed) // Yes |
923 { |
878 { |
924 aCommandLine.Append(KUntrusted); |
879 aCommandLine.Append(KUntrusted); |
925 aCommandLine.Append(KYes); |
880 aCommandLine.Append(KYes); |
926 } |
881 } |
927 else if (intValue == 1) // No |
882 else if (intValue == Usif::ENotAllowed) // No |
928 { |
883 { |
929 aCommandLine.Append(KUntrusted); |
884 aCommandLine.Append(KUntrusted); |
930 aCommandLine.Append(KNo); |
885 aCommandLine.Append(KNo); |
931 } |
886 } |
932 // AskUser is not supported |
887 // AskUser is not supported |
933 |
888 |
934 // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no |
889 // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no |
935 intValue = GetPositiveIntParam(KSifInParam_AllowOverwrite, aArguments); |
890 intValue = GetPositiveIntParam(KSifInParam_AllowOverwrite, aArguments); |
936 if (intValue == 0) // Yes |
891 if (intValue == Usif::EAllowed) // Yes |
937 { |
892 { |
938 aCommandLine.Append(KOverwrite); |
893 aCommandLine.Append(KOverwrite); |
939 aCommandLine.Append(KYes); |
894 aCommandLine.Append(KYes); |
940 } |
895 } |
941 else if (intValue == 1) // No |
896 else if (intValue == Usif::ENotAllowed) // No |
942 { |
897 { |
943 aCommandLine.Append(KOverwrite); |
898 aCommandLine.Append(KOverwrite); |
944 aCommandLine.Append(KNo); |
899 aCommandLine.Append(KNo); |
945 } |
900 } |
946 // AskUser is not supported |
901 // AskUser is not supported |
947 |
902 |
948 // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no |
903 // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no |
949 intValue = GetPositiveIntParam(KSifInParam_AllowDownload, aArguments); |
904 intValue = GetPositiveIntParam(KSifInParam_AllowDownload, aArguments); |
950 if (intValue == 0) // Yes |
905 if (intValue == Usif::EAllowed) // Yes |
951 { |
906 { |
952 aCommandLine.Append(KDownload); |
907 aCommandLine.Append(KDownload); |
953 aCommandLine.Append(KYes); |
908 aCommandLine.Append(KYes); |
954 } |
909 } |
955 else if (intValue == 1) // No |
910 else if (intValue == Usif::ENotAllowed) // No |
956 { |
911 { |
957 aCommandLine.Append(KDownload); |
912 aCommandLine.Append(KDownload); |
958 aCommandLine.Append(KNo); |
913 aCommandLine.Append(KNo); |
959 } |
914 } |
960 // AskUser is not supported |
915 // AskUser is not supported |