mapped error values to strings when windows installer vails. affects only windows platforms.
git-svn-id: svn://10.0.0.236/trunk@68573 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
72
mozilla/xpinstall/wizard/windows/setup/xperr.h
Normal file
72
mozilla/xpinstall/wizard/windows/setup/xperr.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _XPERR_H_
|
||||
#define _XPERR_H_
|
||||
|
||||
char *XpErrorList[] = {"-200", "BAD_PACKAGE_NAME",
|
||||
"-201", "UNEXPECTED_ERROR",
|
||||
"-202", "ACCESS_DENIED",
|
||||
"-203", "TOO_MANY_CERTIFICATES",
|
||||
"-204", "NO_INSTALL_SCRIPT",
|
||||
"-205", "NO_CERTIFICATE",
|
||||
"-206", "NO_MATCHING_CERTIFICATE",
|
||||
"-207", "CANT_READ_ARCHIVE",
|
||||
"-208", "INVALID_ARGUMENTS",
|
||||
"-209", "ILLEGAL_RELATIVE_PATH",
|
||||
"-210", "USER_CANCELLED",
|
||||
"-211", "INSTALL_NOT_STARTED",
|
||||
"-212", "SILENT_MODE_DENIED",
|
||||
"-213", "NO_SUCH_COMPONENT",
|
||||
"-214", "DOES_NOT_EXIST",
|
||||
"-215", "READ_ONLY",
|
||||
"-216", "IS_DIRECTORY",
|
||||
"-217", "NETWORK_FILE_IS_IN_USE",
|
||||
"-218", "APPLE_SINGLE_ERR",
|
||||
"-219", "INVALID_PATH_ERR",
|
||||
"-220", "PATCH_BAD_DIFF",
|
||||
"-221", "PATCH_BAD_CHECKSUM_TARGET",
|
||||
"-222", "PATCH_BAD_CHECKSUM_RESULT",
|
||||
"-223", "UNINSTALL_FAILED",
|
||||
"-224", "PACKAGE_FOLDER_NOT_SET",
|
||||
"-225", "EXTRACTION_FAILED",
|
||||
"-226", "FILENAME_ALREADY_USED",
|
||||
"-227", "ABORT_INSTALL",
|
||||
"-228", "DOWNLOAD_ERROR",
|
||||
"-229", "SCRIPT_ERROR",
|
||||
"-230", "ALREADY_EXISTS",
|
||||
"-231", "IS_FILE",
|
||||
"-232", "SOURCE_DOES_NOT_EXIST",
|
||||
"-233", "SOURCE_IS_DIRECTORY",
|
||||
"-234", "SOURCE_IS_FILE",
|
||||
"-235", "INSUFFICIENT_DISK_SPACE",
|
||||
"-236", "FILENAME_TOO_LONG",
|
||||
"-299", "OUT_OF_MEMORY",
|
||||
"-322", "INIT_STUB_ERROR",
|
||||
"-5550", "GESTALT_UNKNOWN_ERR",
|
||||
"-5551", "GESTALT_INVALID_ARGUMENT",
|
||||
""};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "extra.h"
|
||||
#include "xpistub.h"
|
||||
#include "xpi.h"
|
||||
#include "xperr.h"
|
||||
|
||||
#define BDIR_RIGHT 1
|
||||
#define BDIR_LEFT 2
|
||||
@@ -236,7 +237,31 @@ HRESULT SmartUpdateJars()
|
||||
{
|
||||
if(NS_LoadString(hSetupRscInst, IDS_ERROR_XPI_INSTALL, szEXpiInstall, MAX_BUF) == WIZ_OK)
|
||||
{
|
||||
wsprintf(szBuf, "%d: %s", hrResult, szEXpiInstall);
|
||||
int i = 0;
|
||||
char szErrorString[MAX_BUF];
|
||||
char szErrorNumber[MAX_BUF];
|
||||
|
||||
ZeroMemory(szErrorString, MAX_BUF);
|
||||
itoa(hrResult, szErrorNumber, 10);
|
||||
|
||||
/* map the error value to a string */
|
||||
while(TRUE)
|
||||
{
|
||||
if(*XpErrorList[i] == '\0')
|
||||
break;
|
||||
|
||||
if(lstrcmpi(szErrorNumber, XpErrorList[i]) == 0)
|
||||
{
|
||||
if(*XpErrorList[i + 1] != '\0')
|
||||
lstrcpy(szErrorString, XpErrorList[i + 1]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
wsprintf(szBuf, "%s: %d %s", szEXpiInstall, hrResult, szErrorString);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user