Lines 49-55
Link Here
|
49 |
#include "ExtractUtils.h" |
49 |
#include "ExtractUtils.h" |
50 |
#include "Main.h" |
50 |
#include "Main.h" |
51 |
|
51 |
|
52 |
const DWORD NUMBER_OF_HELP_ARGUMENTS = 11; |
52 |
const DWORD NUMBER_OF_HELP_ARGUMENTS = 12; |
53 |
const DWORD READ_WRITE_BUFSIZE = 65536; |
53 |
const DWORD READ_WRITE_BUFSIZE = 65536; |
54 |
const WCHAR * outputFileArg = L"--output"; |
54 |
const WCHAR * outputFileArg = L"--output"; |
55 |
const WCHAR * javaArg = L"--javahome"; |
55 |
const WCHAR * javaArg = L"--javahome"; |
Lines 59-64
Link Here
|
59 |
const WCHAR * classPathAppend = L"--classpath-append"; |
59 |
const WCHAR * classPathAppend = L"--classpath-append"; |
60 |
const WCHAR * extractArg = L"--extract"; |
60 |
const WCHAR * extractArg = L"--extract"; |
61 |
const WCHAR * helpArg = L"--help"; |
61 |
const WCHAR * helpArg = L"--help"; |
|
|
62 |
const WCHAR * moreArg = L"--more"; |
62 |
const WCHAR * helpOtherArg = L"/?"; |
63 |
const WCHAR * helpOtherArg = L"/?"; |
63 |
const WCHAR * silentArg = L"--silent"; |
64 |
const WCHAR * silentArg = L"--silent"; |
64 |
const WCHAR * nospaceCheckArg = L"--nospacecheck"; |
65 |
const WCHAR * nospaceCheckArg = L"--nospacecheck"; |
Lines 163-168
Link Here
|
163 |
|
164 |
|
164 |
if(!isOK(props)) { |
165 |
if(!isOK(props)) { |
165 |
writeMessageA(props, OUTPUT_LEVEL_NORMAL, 1, "Error! Can`t load i18n strings!!", 1); |
166 |
writeMessageA(props, OUTPUT_LEVEL_NORMAL, 1, "Error! Can`t load i18n strings!!", 1); |
|
|
167 |
showErrorW(props, INTEGRITY_ERROR_PROP, 1, props->exeName); |
168 |
} |
169 |
} |
170 |
|
171 |
void loadMoreOptions(LauncherProperties *props) { |
172 |
// load localized messages |
173 |
writeMessageA(props, OUTPUT_LEVEL_DEBUG, 0, "Loading more help options.", 1); |
174 |
loadMoreOptionsMap(props); |
175 |
|
176 |
if(!isOK(props)) { |
177 |
writeMessageA(props, OUTPUT_LEVEL_NORMAL, 1, "Error! Can`t load more options!!", 1); |
166 |
showErrorW(props, INTEGRITY_ERROR_PROP, 1, props->exeName); |
178 |
showErrorW(props, INTEGRITY_ERROR_PROP, 1, props->exeName); |
167 |
} |
179 |
} |
168 |
} |
180 |
} |
Lines 717-728
Link Here
|
717 |
} |
729 |
} |
718 |
|
730 |
|
719 |
DWORD isOnlyHelp(LauncherProperties * props) { |
731 |
DWORD isOnlyHelp(LauncherProperties * props) { |
720 |
if(argumentExists(props, helpArg, 1) || argumentExists(props, helpOtherArg, 1)) { |
732 |
DWORD helpArgExist = argumentExists(props, helpArg, 1); |
721 |
|
733 |
DWORD helpOtherArgExist = argumentExists(props, helpArg, 1); |
722 |
WCHARList * help = newWCHARList(NUMBER_OF_HELP_ARGUMENTS); |
734 |
DWORD moreArgExist = argumentExists(props, moreArg, 1); |
723 |
DWORD counter = 0; |
735 |
DWORD numberOfArgs = 0; |
724 |
WCHAR * helpString = NULL; |
736 |
DWORD counter = 0; |
725 |
|
737 |
WCHAR * helpString = NULL; |
|
|
738 |
WCHARList * help = NULL; |
739 |
|
740 |
if (!helpArgExist && !helpOtherArgExist && !moreArgExist) { |
741 |
return 0; |
742 |
} |
743 |
|
744 |
writeMessageA(props, OUTPUT_LEVEL_DEBUG, 0, "... loading help strings", 1); |
745 |
|
746 |
if (helpArgExist) { |
747 |
numberOfArgs += NUMBER_OF_HELP_ARGUMENTS - ((props->moreOptionsHelpNumber == 0) ? 1 : 0) + 1; |
748 |
} |
749 |
if (moreArgExist) { |
750 |
numberOfArgs += props->moreOptionsHelpNumber + 1; |
751 |
} |
752 |
|
753 |
help = newWCHARList(numberOfArgs); |
754 |
|
755 |
counter = 0; |
756 |
if (helpArgExist) { |
757 |
writeMessageA(props, OUTPUT_LEVEL_DEBUG, 0, "... loading main help strings", 1); |
758 |
help->items[counter++] = formatMessageW(getI18nProperty(props, MSG_USAGE), 0); |
726 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_JAVA_PROP), 1, javaArg); |
759 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_JAVA_PROP), 1, javaArg); |
727 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_TMP_PROP), 1, tempdirArg); |
760 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_TMP_PROP), 1, tempdirArg); |
728 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_EXTRACT_PROP), 1, extractArg); |
761 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_EXTRACT_PROP), 1, extractArg); |
Lines 734-750
Link Here
|
734 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_LOCALE_PROP), 1, localeArg); |
767 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_LOCALE_PROP), 1, localeArg); |
735 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_SILENT_PROP), 1, silentArg); |
768 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_SILENT_PROP), 1, silentArg); |
736 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_HELP_PROP), 1, helpArg); |
769 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_HELP_PROP), 1, helpArg); |
737 |
|
770 |
if (props->moreOptionsHelpNumber != 0) { |
738 |
|
771 |
help->items[counter++] = formatMessageW(getI18nProperty(props, ARG_MORE_PROP), 1, moreArg); |
739 |
for(counter=0;counter<NUMBER_OF_HELP_ARGUMENTS;counter++) { |
|
|
740 |
helpString = appendStringW(appendStringW(helpString, help->items[counter]), NEW_LINE); |
741 |
} |
772 |
} |
742 |
freeWCHARList(&help); |
|
|
743 |
showMessageW(props, helpString, 0); |
744 |
FREE(helpString); |
745 |
return 1; |
746 |
} |
773 |
} |
747 |
return 0; |
774 |
if (moreArgExist) { |
|
|
775 |
DWORD i = 0; |
776 |
help->items[counter++] = formatMessageW(getI18nProperty(props, MSG_USAGE_MORE),0); |
777 |
writeMessageA(props, OUTPUT_LEVEL_DEBUG, 0, "... loading more help strings", 1); |
778 |
for (i = 0; i < props->moreOptionsHelpNumber; i++) { |
779 |
help->items[counter++] = formatMessageW(getI18nProperty(props, props->moreOptionsHelpKeys[i]), 1, props->moreOptionsHelpArgs[i]); |
780 |
} |
781 |
} |
782 |
writeMessageA(props, OUTPUT_LEVEL_DEBUG, 0, "... creating full help message", 1); |
783 |
for (counter = 0; counter < numberOfArgs; counter++) { |
784 |
helpString = appendStringW(appendStringW(helpString, help->items[counter]), NEW_LINE); |
785 |
} |
786 |
freeWCHARList(&help); |
787 |
showMessageW(props, helpString, 0); |
788 |
FREE(helpString); |
789 |
return 1; |
748 |
} |
790 |
} |
749 |
|
791 |
|
750 |
DWORD isSilent(LauncherProperties * props) { |
792 |
DWORD isSilent(LauncherProperties * props) { |
Lines 785-790
Link Here
|
785 |
|
827 |
|
786 |
props->jvmArguments = NULL; |
828 |
props->jvmArguments = NULL; |
787 |
props->appArguments = NULL; |
829 |
props->appArguments = NULL; |
|
|
830 |
props->moreOptionsHelpKeys = NULL; |
831 |
props->moreOptionsHelpArgs = NULL; |
788 |
props->extractOnly = 0; |
832 |
props->extractOnly = 0; |
789 |
props->mainClass = NULL; |
833 |
props->mainClass = NULL; |
790 |
props->testJVMClass = NULL; |
834 |
props->testJVMClass = NULL; |
Lines 856-861
Link Here
|
856 |
writeMessageA(*props, OUTPUT_LEVEL_DEBUG, 0, "Closing launcher properties", 1); |
900 |
writeMessageA(*props, OUTPUT_LEVEL_DEBUG, 0, "Closing launcher properties", 1); |
857 |
freeWCHARList(& ( (*props)->appArguments)); |
901 |
freeWCHARList(& ( (*props)->appArguments)); |
858 |
freeWCHARList(& ( (*props)->jvmArguments)); |
902 |
freeWCHARList(& ( (*props)->jvmArguments)); |
|
|
903 |
|
904 |
for(i=0;i<(*props)->moreOptionsHelpNumber;i++) { |
905 |
FREE((*props)->moreOptionsHelpArgs[i]); |
906 |
FREE((*props)->moreOptionsHelpKeys[i]); |
907 |
} |
908 |
FREE((*props)->moreOptionsHelpArgs); |
909 |
FREE((*props)->moreOptionsHelpKeys); |
859 |
|
910 |
|
860 |
FREE((*props)->mainClass); |
911 |
FREE((*props)->mainClass); |
861 |
FREE((*props)->testJVMClass); |
912 |
FREE((*props)->testJVMClass); |
Lines 934-939
Link Here
|
934 |
loadLocalizationStrings(props); |
985 |
loadLocalizationStrings(props); |
935 |
if(!isOK(props) || isTerminated(props)) return; |
986 |
if(!isOK(props) || isTerminated(props)) return; |
936 |
|
987 |
|
|
|
988 |
loadMoreOptions(props); |
989 |
if(!isOK(props) || isTerminated(props)) return; |
990 |
|
937 |
if(isOnlyHelp(props)) return; |
991 |
if(isOnlyHelp(props)) return; |
938 |
|
992 |
|
939 |
setProgressTitleString(props, getI18nProperty(props, MSG_PROGRESS_TITLE)); |
993 |
setProgressTitleString(props, getI18nProperty(props, MSG_PROGRESS_TITLE)); |