158033 patch by ajschult@eos.ncsu.edu r=sgehani sr=dveditz misc commandline args for unix install wizard (help and ignore-run-apps)

This commit is contained in:
cbiesinger%web.de 2003-04-24 21:24:46 +00:00
parent 1de774aa53
commit d96b7a2856
7 changed files with 35 additions and 5 deletions

View File

@ -65,7 +65,8 @@
E_OLD_INST = -625, /* old instllation exists */
E_NO_PERMS = -626, /* don't have rwx perms on selected dir */
E_NO_DISK_SPACE = -627, /* not eough disk space to install */
E_CRC_FAILED = -628 /* CRC failed */
E_CRC_FAILED = -628, /* CRC failed */
E_USAGE_SHOWN = -629 /* showed the usage message */
};
#endif /* _XI_ERRORS_H_ */

View File

@ -51,6 +51,7 @@ FROM=From:
TO=To:
STATUS=Status:
DL_STATUS_STR=%d KB of %d KB (at %d KB/sec)
USAGE_MSG=Usage: %s [options]%s [options] can be any of the following combination:%s -h: This help.%s -ma: Run setup in Auto mode: show progress UI,%s but assume defaults without user intervention.%s -ms: Run setup in Silent mode: show no UI and have%s no user intervention.%s -ira: Ignore the [RunAppX] sections%s
UNKNOWN=Unknown
;------------------------------------------------------------------------------

View File

@ -611,7 +611,8 @@ nsInstallDlg::PerformInstall()
// run all specified applications after installation
if (sRunAppList)
{
RunApps();
if (gCtx->opt->mShouldRunApps)
RunApps();
FreeRunAppList();
}

View File

@ -189,6 +189,7 @@ nsXIContext::LoadResources()
"DL_STATUS_STR",
"CRC_FAILED",
"CRC_CHECK",
"USAGE_MSG",
"UNKNOWN",
__EOT__

View File

@ -29,6 +29,7 @@ nsXIOptions::nsXIOptions() :
mDestination(NULL),
mSetupType(0),
mMode(MODE_DEFAULT),
mShouldRunApps(TRUE),
mProxyHost(NULL),
mProxyPort(NULL),
mProxyUser(NULL),
@ -39,4 +40,10 @@ nsXIOptions::nsXIOptions() :
nsXIOptions::~nsXIOptions()
{
XI_IF_FREE(mTitle);
XI_IF_FREE(mDestination);
XI_IF_FREE(mProxyHost);
XI_IF_FREE(mProxyPort);
XI_IF_FREE(mProxyUser);
XI_IF_FREE(mProxyPswd);
}

View File

@ -37,6 +37,7 @@ public:
char *mDestination;
int mSetupType;
int mMode;
int mShouldRunApps;
enum
{

View File

@ -46,10 +46,21 @@ nsXInstaller::ParseArgs(int aArgc, char **aArgv)
for (int argNum = 1; argNum < aArgc; ++argNum)
{
/* Print usage
*/
if (strcmp(aArgv[argNum], "-h") == 0 ||
strcmp(aArgv[argNum], "--help") == 0)
{
if (gCtx->Res("USAGE_MSG"))
fprintf (stderr, gCtx->Res("USAGE_MSG"), aArgv[0], "\n",
"\n", "\n", "\n", "\n", "\n", "\n", "\n");
return E_USAGE_SHOWN;
}
/* mode: auto (show progress UI but assume defaults
* without user intervention)
*/
if (strcmp(aArgv[argNum], "-ma") == 0)
else if (strcmp(aArgv[argNum], "-ma") == 0)
{
gCtx->opt->mMode = nsXIOptions::MODE_AUTO;
}
@ -61,6 +72,13 @@ nsXInstaller::ParseArgs(int aArgc, char **aArgv)
{
gCtx->opt->mMode = nsXIOptions::MODE_SILENT;
}
/* ignore [RunAppX] sections
*/
else if (strcmp(aArgv[argNum], "-ira") == 0)
{
gCtx->opt->mShouldRunApps = FALSE;
}
}
return OK;
@ -370,8 +388,8 @@ main(int argc, char **argv)
{
if ( (err = installer->ParseConfig()) == OK)
{
installer->ParseArgs(argc, argv);
err = installer->RunWizard(argc, argv);
if (installer->ParseArgs(argc, argv) == OK)
err = installer->RunWizard(argc, argv);
}
}
else