Compare commits

..

2 Commits

Author SHA1 Message Date
sdv%sparc.spb.su
53866ece4f workaround for bug=30927
git-svn-id: svn://10.0.0.236/branches/M15-patch@72213 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-14 11:34:36 +00:00
(no author)
350be55313 This commit was manufactured by cvs2svn to create branch 'M15-patch'.
git-svn-id: svn://10.0.0.236/branches/M15-patch@52901 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 02:47:16 +00:00
22 changed files with 105 additions and 12515 deletions

View File

@@ -0,0 +1,105 @@
/*
The contents of this file are subject to the Mozilla 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/MPL/
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.org code.
The Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are
Copyright (C) 1999 Sun Microsystems, Inc. All
Rights Reserved.
Contributor(s):
*/
#ifndef __JavaDOMGlobals_h__
#define __JavaDOMGlobals_h__
#include "jni.h"
#include "prclist.h"
#include "nsError.h"
#ifdef ERROR
#undef ERROR
#endif
class nsISupports;
class nsIDOMNode;
struct PRLogModuleInfo;
struct PRLock;
class JavaDOMGlobals {
public:
static jclass attrClass;
static jclass cDataSectionClass;
static jclass commentClass;
static jclass documentClass;
static jclass documentFragmentClass;
static jclass documentTypeClass;
static jclass domImplementationClass;
static jclass elementClass;
static jclass entityClass;
static jclass entityReferenceClass;
static jclass namedNodeMapClass;
static jclass nodeClass;
static jclass nodeListClass;
static jclass notationClass;
static jclass processingInstructionClass;
static jclass textClass;
static jfieldID nodePtrFID;
static jfieldID nodeListPtrFID;
static jfieldID domImplementationPtrFID;
static jfieldID nodeTypeAttributeFID;
static jfieldID nodeTypeCDataSectionFID;
static jfieldID nodeTypeCommentFID;
static jfieldID nodeTypeDocumentFragmentFID;
static jfieldID nodeTypeDocumentFID;
static jfieldID nodeTypeDocumentTypeFID;
static jfieldID nodeTypeElementFID;
static jfieldID nodeTypeEntityFID;
static jfieldID nodeTypeEntityReferenceFID;
static jfieldID nodeTypeNotationFID;
static jfieldID nodeTypeProcessingInstructionFID;
static jfieldID nodeTypeTextFID;
static jclass domExceptionClass;
static jmethodID domExceptionInitMID;
static jclass runtimeExceptionClass;
static jmethodID runtimeExceptionInitMID;
static const char* const DOM_EXCEPTION_MESSAGE[];
typedef enum ExceptionType { EXCEPTION_RUNTIME,
EXCEPTION_DOM } ExceptionType;
static PRLogModuleInfo* log;
static PRCList garbage;
static PRLock* garbageLock;
static PRInt32 javaMaxInt;
static void Initialize(JNIEnv *env);
static void Destroy(JNIEnv *env);
static jobject CreateNodeSubtype(JNIEnv *env,
nsIDOMNode *node);
static void AddToGarbage(nsISupports* domObject);
static void TakeOutGarbage();
static void ThrowException(JNIEnv *env,
const char * message = NULL,
nsresult rv = NS_OK,
ExceptionType exceptionType = EXCEPTION_RUNTIME);
};
#endif /* __JavaDOMGlobals_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,67 +0,0 @@
/* -*- 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 _DIALOGS_H_
#define _DIALOGS_H_
LRESULT CALLBACK DlgProcMain(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcSelectAdditionalComponents(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcDownloadOptions(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcSiteSelector(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK NewListBoxWndProc( HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK DlgProcUpgrade(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
void ToggleCheck(HWND hwndListBox, DWORD dwIndex, DWORD dwACFlag);
void AskCancelDlg(HWND hDlg);
void lbAddItem(HWND hList, siC *siCComponent);
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
void DlgSequenceNext(void);
void DlgSequencePrev(void);
void PaintGradientShade(HWND hWnd, HDC hdc);
BOOL BrowseForDirectory(HWND hDlg, char *szCurrDir);
LRESULT CALLBACK BrowseHookProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
void ShowMessage(LPSTR szMessage, BOOL bShow);
void DrawCheck(LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag);
void InvalidateLBCheckbox(HWND hwndListBox);
void ProcessWindowsMessages(void);
BOOL CheckWizardStateCustom(DWORD dwDefault);
void SunJavaDependencyHack(DWORD dwIndex, BOOL bSelected, DWORD dwACFlag);
LPSTR GetStartInstallMessage(void);
void AppendStringWOAmpersand(LPSTR szInputString, DWORD dwInputStringSize, LPSTR szString);
void TruncateString(HWND hWnd, LPSTR szInPath, DWORD dwInPathBufSize, LPSTR szOutPath, DWORD dwOutPathBufSize);
void SaveDownloadOptions(HWND hDlg, HWND hwndCBSiteSelector);
WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc);
LRESULT CALLBACK ListBoxBrowseWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
#endif

View File

@@ -1,95 +0,0 @@
/* -*- 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 _EXTERN_H_
#define _EXTERN_H_
#include "setup.h"
/* external global variables */
extern HINSTANCE hInst;
extern HINSTANCE hSetupRscInst;
extern HINSTANCE hSDInst;
extern HINSTANCE hXPIStubInst;
extern HBITMAP hbmpBoxChecked;
extern HBITMAP hbmpBoxCheckedDisabled;
extern HBITMAP hbmpBoxUnChecked;
extern HANDLE hAccelTable;
extern HWND hDlgCurrent;
extern HWND hDlgMessage;
extern HWND hWndMain;
extern SDI_NETINSTALL pfnNetInstall;
extern LPSTR szEGlobalAlloc;
extern LPSTR szEStringLoad;
extern LPSTR szEDllLoad;
extern LPSTR szEStringNull;
extern LPSTR szTempSetupPath;
extern LPSTR szSetupDir;
extern LPSTR szTempDir;
extern LPSTR szOSTempDir;
extern LPSTR szFileIniConfig;
extern LPSTR szSiteSelectorDescription;
extern DWORD dwWizardState;
extern DWORD dwSetupType;
extern DWORD dwScreenX;
extern DWORD dwScreenY;
extern ULONG ulOSType;
extern DWORD dwTempSetupType;
extern DWORD gdwUpgradeValue;
extern BOOL bSDUserCanceled;
extern BOOL bIdiArchivesExists;
extern BOOL bCreateDestinationDir;
extern BOOL bReboot;
extern setupGen sgProduct;
extern diS diSetup;
extern diW diWelcome;
extern diL diLicense;
extern diST diSetupType;
extern diSC diSelectComponents;
extern diSC diSelectAdditionalComponents;
extern diWI diWindowsIntegration;
extern diPF diProgramFolder;
extern diDO diDownloadOptions;
extern diAS diAdvancedSettings;
extern diSI diStartInstall;
extern diR diReboot;
extern siSD siSDObject;
extern siCF siCFXpcomFile;
extern siC *siComponents;
extern ssi *ssiSiteSelector;
extern char *SetupFileList[];
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,186 +0,0 @@
/* -*- 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 _EXTRA_H_
#define _EXTRA_H_
typedef struct diskSpaceNode dsN;
struct diskSpaceNode
{
ULONGLONG ullSpaceRequired;
LPSTR szPath;
dsN *Next;
dsN *Prev;
};
typedef struct structVer
{
ULONGLONG ullMajor;
ULONGLONG ullMinor;
ULONGLONG ullRelease;
ULONGLONG ullBuild;
} verBlock;
BOOL InitDialogClass(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
BOOL InitApplication(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
BOOL InitInstance(HINSTANCE hInstance, DWORD dwCmdShow);
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH);
void FreeMemory(void **vPointer);
void *NS_GlobalAlloc(DWORD dwMaxBuf);
HRESULT Initialize(HINSTANCE hInstance);
HRESULT NS_LoadStringAlloc(HANDLE hInstance, DWORD dwID, LPSTR *szStringBuf, DWORD dwStringBuf);
HRESULT NS_LoadString(HANDLE hInstance, DWORD dwID, LPSTR szStringBuf, DWORD dwStringBuf);
HRESULT WinSpawn(LPSTR szClientName, LPSTR szParameters, LPSTR szCurrentDir, int iShowCmd, BOOL bWait);
HRESULT ParseConfigIni(LPSTR lpszCmdLine);
HRESULT DecryptString(LPSTR szOutputStr, LPSTR szInputStr);
HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize);
HRESULT InitSetupGeneral(void);
HRESULT InitDlgWelcome(diW *diDialog);
HRESULT InitDlgLicense(diL *diDialog);
HRESULT InitDlgSetupType(diST *diDialog);
HRESULT InitDlgSelectComponents(diSC *diDialog, DWORD dwSM);
HRESULT InitDlgWindowsIntegration(diWI *diDialog);
HRESULT InitDlgProgramFolder(diPF *diDialog);
HRESULT InitDlgStartInstall(diSI *diDialog);
HRESULT InitDlgSiteSelector(diAS *diDialog);
HRESULT InitSDObject(void);
void DeInitSDObject(void);
siC *CreateSiCNode(void);
void SiCNodeInsert(siC **siCHead, siC *siCTemp);
void SiCNodeDelete(siC *siCTemp);
siCD *CreateSiCDepNode(void);
void SiCDepNodeDelete(siCD *siCDepTemp);
void SiCDepNodeInsert(siCD **siCDepHead, siCD *siCDepTemp);
HRESULT SiCNodeGetAttributes(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible, DWORD dwACFlag);
void SiCNodeSetItemsSelected(DWORD dwItems, DWORD *dwItemsSelected);
char *SiCNodeGetDescriptionShort(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
char *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
siC *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs, DWORD dwACFlag);
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
ULONGLONG SiCNodeGetInstallSizeSystem(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
ULONGLONG SiCNodeGetInstallSizeArchive(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
void InitSiComponents(char *szFileIni);
HRESULT ParseComponentAttributes(char *szBuf);
void InitSiteSelector(char *szFileIni);
void DeInitSiCDependencies(siCD *siCDDependencies);
BOOL ResolveDependencies(DWORD dwIndex);
BOOL ResolveComponentDependency(siCD *siCDInDependency);
void ResolveDependees(LPSTR szToggledDescriptionShort);
BOOL ResolveComponentDependee(siCD *siCDInDependee);
void STGetComponents(LPSTR szSection, st *stSetupType, LPSTR szFileIni);
HRESULT InitSXpcomFile(void);
void DeInitSXpcomFile(void);
void DeInitialize(void);
void DeInitDlgWelcome(diW *diDialog);
void DeInitDlgLicense(diL *diDialog);
void DeInitDlgSetupType(diST *diDialog);
void DeInitDlgSelectComponents(diSC *diDialog);
void DeInitDlgWindowsIntegration(diWI *diDialog);
void DeInitDlgProgramFolder(diPF *diDialog);
void DeInitDlgStartInstall(diSI *diDialog);
void DeInitDlgSiteSelector(diAS *diDialog);
void DetermineOSVersion(void);
void DeInitSiComponents(void);
void DeInitSetupGeneral(void);
HRESULT InitializeSmartDownload(void);
HRESULT DeInitializeSmartDownload(void);
HRESULT ParseSetupIni(void);
HRESULT GetConfigIni(void);
void CleanTempFiles(void);
void OutputSetupTitle(HDC hDC);
HRESULT SdArchives(LPSTR szFileIdi, LPSTR szDownloadDir);
long RetrieveArchives(void);
long RetrieveRedirectFile(void);
/* HRESULT SmartUpdateJars(void); */
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwLength, DWORD dwType);
void RemoveBackSlash(LPSTR szInput);
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
void RemoveSlash(LPSTR szInput);
void AppendSlash(LPSTR szInput, DWORD dwInputSize);
BOOL DeleteIdiGetConfigIni(void);
BOOL DeleteIdiGetArchives(void);
BOOL DeleteIdiGetRedirect(void);
BOOL DeleteIdiFileIniConfig(void);
void DeleteArchives(void);
BOOL DeleteIniRedirect(void);
HRESULT LaunchApps(void);
HRESULT FileExists(LPSTR szFile);
int ExtractDirEntries(char* directory,void* vZip);
BOOL LocateJar(siC *siCObject, LPSTR szPath, DWORD dwPathSize, BOOL bIncludeTempDir);
HRESULT AddArchiveToIdiFile(siC *siCObject, char *szSComponent, char *szSFile, char *szFileIdiGetArchives);
int SiCNodeGetIndexDS(char *szInDescriptionShort);
void ViewSiComponents(void);
BOOL IsWin95Debute(void);
ULONGLONG GetDiskSpaceRequired(DWORD dwType);
ULONGLONG GetDiskSpaceAvailable(LPSTR szPath);
HRESULT VerifyDiskSpace(void);
HRESULT ErrorMsgDiskSpace(ULONGLONG ullDSAvailable, ULONGLONG ullDSRequired, LPSTR szPath, BOOL bCrutialMsg);
void SetCustomType(void);
void GetAlternateArchiveSearchPath(LPSTR lpszCmdLine);
BOOL NeedReboot(void);
BOOL LocatePreviousPath(LPSTR szMainSectionName, LPSTR szPath, DWORD dwPathSize);
BOOL LocatePathNscpReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
BOOL LocatePathWinReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
BOOL LocatePath(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
int VR_GetPath(char *component_path, unsigned long sizebuf, char *buf);
dsN *CreateDSNode();
void DsNodeInsert(dsN **dsNHead, dsN *dsNTemp);
void DsNodeDelete(dsN **dsNTemp);
void DeInitDSNode(dsN **dsnComponentDSRequirement);
void UpdatePathDiskSpaceRequired(LPSTR szPath, ULONGLONG ullInstallSize, dsN **dsnComponentDSRequirement);
HRESULT InitComponentDiskSpaceInfo(dsN **dsnComponentDSRequirement);
HRESULT CheckInstances();
long RandomSelect(void);
void TranslateVersionStr(LPSTR szVersion, verBlock *vbVersion);
BOOL GetFileVersion(LPSTR szFile, verBlock *vbVersion);
BOOL CheckLegacy(HWND hDlg);
int CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew);
COLORREF DecryptFontColor(LPSTR szColor);
ssi *CreateSsiSiteSelectorNode();
void SsiSiteSelectorNodeInsert(ssi **ssiHead, ssi *ssiTemp);
void SsiSiteSelectorNodeDelete(ssi *ssiTemp);
ssi* SsiGetNode(LPSTR szDescription);
void UpdateSiteSelector(void);
DWORD GetAdditionalComponentsCount(void);
DWORD GetTotalArchivesToDownload();
void RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize);
LPSTR GetFirstNonSpace(LPSTR lpszString);
int GetArgC(LPSTR lpszCommandLine);
LPSTR GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize);
void ParseCommandLine(LPSTR lpszCmdLine);
void SetSetupRunMode(LPSTR szMode);
void Delay(DWORD dwSeconds);
siCD *InitWinInitNodes(char *szInFile);
void UpdateWininit(LPSTR szUninstallFilename);
char *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize);
void SaveInstallerFiles(void);
void ResetComponentAttributes(char *szFileIni);
BOOL IsInList(DWORD dwCurrentItem, DWORD dwItems, DWORD *dwItemsSelected);
int LocateExistingPath(char *szPath, char *szExistingPath, DWORD dwExistingPathSize);
BOOL bSDInit;
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,69 +0,0 @@
/* -*- 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 _IFUNCNS_H_
#define _IFUNCNS_H_
HRESULT TimingCheck(DWORD dwTiming, LPSTR szSection, LPSTR szFile);
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo);
HRESULT ProcessXpcomFile(void);
HRESULT CleanupXpcomFile(void);
HRESULT ProcessUncompressFile(DWORD dwTiming);
HRESULT FileMove(LPSTR szFrom, LPSTR szTo);
HRESULT ProcessMoveFile(DWORD dwTiming);
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists);
HRESULT ProcessCopyFile(DWORD dwTiming);
HRESULT ProcessCreateDirectory(DWORD dwTiming);
HRESULT FileDelete(LPSTR szDestination);
HRESULT ProcessDeleteFile(DWORD dwTiming);
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs);
HRESULT ProcessRemoveDirectory(DWORD dwTiming);
HRESULT ProcessRunApp(DWORD dwTiming);
HRESULT ProcessWinReg(DWORD dwTiming);
HRESULT CreateALink(LPSTR lpszPathObj,
LPSTR lpszPathLink,
LPSTR lpszDesc,
LPSTR lpszWorkingPath,
LPSTR lpszArgs,
LPSTR lpszIconFullPath,
int iIcon);
HRESULT ProcessProgramFolder(DWORD dwTiming);
HRESULT ProcessProgramFolderShowCmd(void);
HRESULT CreateDirectoriesAll(char* szPath, BOOL bLogForUninstall);
void ProcessFileOps(DWORD dwTiming);
void GetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, LPSTR szReturnValue, DWORD dwSize);
void SetWinReg(HKEY hkRootKey, LPSTR szKey, BOOL bOverwriteKey, LPSTR szName, BOOL bOverwriteName, DWORD dwType, LPBYTE lpbData, DWORD dwSize);
HKEY ParseRootKey(LPSTR szRootKey);
BOOL ParseRegType(LPSTR szType, DWORD *dwType);
BOOL WinRegKeyExists(HKEY hkRootKey, LPSTR szKey);
BOOL WinRegNameExists(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
HRESULT FileCopySequential(LPSTR szSourcePath, LPSTR szDestPath, LPSTR szFilename);
HRESULT ProcessCopyFileSequential(DWORD dwTiming);
void UpdateInstallLog(LPSTR szKey, LPSTR szDir);
int RegisterDll32(char *File);
HRESULT FileSelfRegister(LPSTR szFilename, LPSTR szDestination);
HRESULT ProcessSelfRegisterFile(DWORD dwTiming);
void UpdateJSProxyInfo(void);
#endif

View File

@@ -1,61 +0,0 @@
#
# 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) 1999 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Sean Su <ssu@netscape.com>
DEPTH=..\..\..\..
MAKE_OBJ_TYPE = EXE
USE_NON_MT_LIBS = 1
MODULE = setup
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
RESFILE = $(MODULE).res
OBJS = \
.\$(OBJDIR)\dialogs.obj \
.\$(OBJDIR)\extra.obj \
.\$(OBJDIR)\ifuncns.obj \
.\$(OBJDIR)\setup.obj \
.\$(OBJDIR)\shortcut.obj \
.\$(OBJDIR)\xpi.obj \
$(NULL)
LLIBS= \
$(DIST)\lib\nsreg_s.lib \
$(DIST)\lib\jar_s.lib \
$(DIST)\lib\zlib_s.lib \
$(NULL)
WIN_LIBS= \
ole32.lib \
comdlg32.lib \
shell32.lib \
version.lib \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(PROGRAM)
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\install
clobber_all::
$(RM) $(DIST)\install\$(MODULE).exe

View File

@@ -1,47 +0,0 @@
/* -*- 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>
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by setup.rc
//
#include "winresrc.h"
#define IDS_ERROR_DLL_LOAD 1
#define IDS_ERROR_STRING_LOAD 2
#define IDS_ERROR_STRING_NULL 4
#define IDS_ERROR_GLOBALALLOC 5
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -1,169 +0,0 @@
/* -*- 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>
*/
#include "setup.h"
#include "extra.h"
#include "dialogs.h"
#include "ifuncns.h"
/* global variables */
HINSTANCE hInst;
HINSTANCE hSetupRscInst;
HINSTANCE hSDInst;
HINSTANCE hXPIStubInst;
HBITMAP hbmpBoxChecked;
HBITMAP hbmpBoxCheckedDisabled;
HBITMAP hbmpBoxUnChecked;
HANDLE hAccelTable;
HWND hDlgCurrent;
HWND hDlgMessage;
HWND hWndMain;
SDI_NETINSTALL pfnNetInstall;
LPSTR szEGlobalAlloc;
LPSTR szEStringLoad;
LPSTR szEDllLoad;
LPSTR szEStringNull;
LPSTR szTempSetupPath;
LPSTR szSetupDir;
LPSTR szTempDir;
LPSTR szOSTempDir;
LPSTR szFileIniConfig;
LPSTR szSiteSelectorDescription;
DWORD dwWizardState;
DWORD dwSetupType;
DWORD dwScreenX;
DWORD dwScreenY;
ULONG ulOSType;
DWORD dwTempSetupType;
DWORD gdwUpgradeValue;
BOOL bSDUserCanceled;
BOOL bIdiArchivesExists;
BOOL bCreateDestinationDir;
BOOL bReboot;
setupGen sgProduct;
diS diSetup;
diW diWelcome;
diL diLicense;
diST diSetupType;
diSC diSelectComponents;
diSC diSelectAdditionalComponents;
diWI diWindowsIntegration;
diPF diProgramFolder;
diDO diDownloadOptions;
diAS diAdvancedSettings;
diSI diStartInstall;
diR diReboot;
siSD siSDObject;
siCF siCFXpcomFile;
siC *siComponents;
ssi *ssiSiteSelector;
/* do not add setup.exe to the list because we figure out the filename
* by calling GetModuleFileName() */
char *SetupFileList[] = {"setuprsc.dll",
"config.ini",
"setup.ini",
"sdinst.dll",
""};
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
/***********************************************************************/
/* HANDLE hInstance; handle for this instance */
/* HANDLE hPrevInstance; handle for possible previous instances */
/* LPSTR lpszCmdLine; long pointer to exec command line */
/* int nCmdShow; Show code for main window display */
/***********************************************************************/
MSG msg;
char szBuf[MAX_BUF];
if(!hPrevInstance)
{
// hInstance = GetModuleHandle(NULL);
if(Initialize(hInstance))
PostQuitMessage(1);
else if(!InitApplication(hInstance, hSetupRscInst))
{
char szEFailed[MAX_BUF];
if(NS_LoadString(hInstance, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK)
{
wsprintf(szBuf, szEFailed, "InitApplication().");
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
else if(!InitInstance(hInstance, nCmdShow))
{
char szEFailed[MAX_BUF];
if(NS_LoadString(hInstance, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK)
{
wsprintf(szBuf, szEFailed, "InitInstance().");
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
else if(GetConfigIni())
{
PostQuitMessage(1);
}
else if(ParseConfigIni(lpszCmdLine))
{
PostQuitMessage(1);
}
else
{
DlgSequenceNext();
}
}
while(GetMessage(&msg, NULL, 0, 0))
{
if((!IsDialogMessage(hDlgCurrent, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
/* Do clean up before exiting from the application */
DeInitialize();
return(msg.wParam);
} /* End of WinMain */

View File

@@ -1,361 +0,0 @@
/* -*- 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 _SETUP_H_
#define _SETUP_H_
#ifdef __cplusplus
#define PR_BEGIN_EXTERN_C extern "C" {
#define PR_END_EXTERN_C }
#else
#define PR_BEGIN_EXTERN_C
#define PR_END_EXTERN_C
#endif
#define PR_EXTERN(type) type
typedef unsigned int PRUint32;
typedef int PRInt32;
#include <windows.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <direct.h>
#include <tchar.h>
#include <commctrl.h>
#include "setuprsc.h"
#include "resource.h"
#include "zipfile.h"
/* required only by commercial seamonkey build */
#ifndef MOZILLA_CLIENT
#include "sdinst.h"
#endif
#define CLASS_NAME_SETUP "Setup"
#define CLASS_NAME_SETUP_DLG "SetupDlg"
#define FILE_INI_SETUP "setup.ini"
#define FILE_INI_CONFIG "config.ini"
#define FILE_IDI_GETCONFIGINI "getconfigini.idi"
#define FILE_IDI_GETARCHIVES "getarchives.idi"
#define FILE_IDI_GETREDIRECT "getredirect.idi"
#define FILE_INI_REDIRECT "redirect.ini"
#define WIZ_TEMP_DIR "ns_temp"
#define FILE_INSTALL_LOG "install_wizard.log"
#define FILE_ALL_JS "all-proxy.js"
/* UG: Upgrade */
#define UG_NONE 0
#define UG_DELETE 1
#define UG_IGNORE 2
#define UG_GOBACK 3
/* PP: Parse Path */
#define PP_FILENAME_ONLY 1
#define PP_PATH_ONLY 2
#define PP_ROOT_ONLY 3
/* T: Timing */
#define T_PRE_DOWNLOAD 1
#define T_POST_DOWNLOAD 2
#define T_PRE_XPCOM 3
#define T_POST_XPCOM 4
#define T_PRE_SMARTUPDATE 5
#define T_POST_SMARTUPDATE 6
#define T_PRE_LAUNCHAPP 7
#define T_POST_LAUNCHAPP 8
#define T_DEPEND_REBOOT 9
#define MAX_BUF 4096
#define ERROR_CODE_HIDE 0
#define ERROR_CODE_SHOW 1
#define DLG_NONE 0
#define CX_CHECKBOX 13
#define CY_CHECKBOX 13
/* WIZ: WIZARD defines */
#define WIZ_OK 0
#define WIZ_MEMORY_ALLOC_FAILED 1
/* FO: File Operation */
#define FO_OK 0
#define FO_SUCCESS 0
#define FO_ERROR_FILE_NOT_FOUND 1
#define FO_ERROR_DESTINATION_CONFLICT 2
#define FO_ERROR_CHANGE_DIR 3
/* Mode of Setup to run in */
#define NORMAL 0
#define SILENT 1
#define AUTO 2
/* ST: Setup Type */
#define ST_RADIO0 0
#define ST_RADIO1 1
#define ST_RADIO2 2
#define ST_RADIO3 3
/* SM: Setup Type Mode */
#define SM_SINGLE 0
#define SM_MULTI 1
/* SIC: Setup Info Component*/
#define SIC_SELECTED 1
#define SIC_INVISIBLE 2
#define SIC_LAUNCHAPP 4
#define SIC_DOWNLOAD_REQUIRED 8
#define SIC_DOWNLOAD_ONLY 16
#define SIC_ADDITIONAL 32
#define SIC_DISABLED 64
/* AC: Additional Components */
#define AC_NONE 0
#define AC_COMPONENTS 1
#define AC_ADDITIONAL_COMPONENTS 2
#define AC_ALL 3
/* OS: Operating System */
#define OS_WIN9x 1
#define OS_WIN95_DEBUTE 2
#define OS_WIN95 4
#define OS_WIN98 8
#define OS_NT 16
#define OS_NT3 32
#define OS_NT4 64
#define OS_NT5 128
/* DSR: Disk Space Required */
#define DSR_DESTINATION 0
#define DSR_SYSTEM 1
#define DSR_TEMP 2
#define DSR_DOWNLOAD_SIZE 3
typedef HRESULT (_cdecl *SDI_NETINSTALL) (LPSDISTRUCT);
typedef struct dlgSetup
{
DWORD dwDlgID;
WNDPROC fDlgProc;
LPSTR szTitle;
} diS;
typedef struct dlgWelcome
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szMessage1;
LPSTR szMessage2;
} diW;
typedef struct dlgLicense
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szLicenseFilename;
LPSTR szMessage0;
LPSTR szMessage1;
} diL;
typedef struct stStruct
{
BOOL bVisible;
DWORD dwCItems;
DWORD dwCItemsSelected[MAX_BUF]; /* components */
LPSTR szDescriptionShort;
LPSTR szDescriptionLong;
} st;
typedef struct dlgSetupType
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szReadmeFilename;
LPSTR szReadmeApp;
st stSetupType0;
st stSetupType1;
st stSetupType2;
st stSetupType3;
} diST;
typedef struct dlgSelectComponents
{
BOOL bShowDialog;
DWORD bShowDialogSM;
LPSTR szTitle;
LPSTR szMessage0;
} diSC;
typedef struct wiCBstruct
{
BOOL bEnabled;
BOOL bCheckBoxState;
LPSTR szDescription;
LPSTR szArchive;
} wiCBs;
typedef struct dlgWindowsIntegration
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szMessage1;
wiCBs wiCB0;
wiCBs wiCB1;
wiCBs wiCB2;
wiCBs wiCB3;
} diWI;
typedef struct dlgProgramFolder
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
} diPF;
typedef struct dlgDownloadOptions
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szMessage1;
BOOL bSaveInstaller;
} diDO;
typedef struct dlgAdvancedSettings
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szProxyServer;
LPSTR szProxyPort;
} diAS;
typedef struct dlgStartInstall
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessageInstall;
LPSTR szMessageDownload;
} diSI;
typedef struct dlgReboot
{
DWORD dwShowDialog;
LPSTR szTitle;
} diR;
typedef struct setupStruct
{
DWORD dwMode;
DWORD dwCustomType;
DWORD dwNumberOfComponents;
LPSTR szPath;
LPSTR szSubPath;
LPSTR szProgramName;
LPSTR szProductName;
LPSTR szProgramFolderName;
LPSTR szProgramFolderPath;
LPSTR szAlternateArchiveSearchPath;
LPSTR szParentProcessFilename;
LPSTR szSetupTitle0;
COLORREF crSetupTitle0FontColor;
int iSetupTitle0FontSize;
BOOL bSetupTitle0FontShadow;
LPSTR szSetupTitle1;
COLORREF crSetupTitle1FontColor;
int iSetupTitle1FontSize;
BOOL bSetupTitle1FontShadow;
LPSTR szSetupTitle2;
COLORREF crSetupTitle2FontColor;
int iSetupTitle2FontSize;
BOOL bSetupTitle2FontShadow;
} setupGen;
typedef struct sinfoSmartDownload
{
LPSTR szXpcomFile;
LPSTR szXpcomDir;
LPSTR szNoAds;
LPSTR szSilent;
LPSTR szExecution;
LPSTR szConfirmInstall;
LPSTR szExtractMsg;
LPSTR szExe;
LPSTR szExeParam;
LPSTR szXpcomFilePath;
} siSD;
typedef struct sinfoXpcomFile
{
LPSTR szSource;
LPSTR szDestination;
LPSTR szMessage;
BOOL bCleanup;
ULONGLONG ullInstallSize;
} siCF;
typedef struct sinfoComponentDep siCD;
struct sinfoComponentDep
{
LPSTR szDescriptionShort;
siCD *Next;
siCD *Prev;
};
typedef struct sinfoComponent siC;
struct sinfoComponent
{
ULONGLONG ullInstallSize;
ULONGLONG ullInstallSizeSystem;
ULONGLONG ullInstallSizeArchive;
long lRandomInstallPercentage;
long lRandomInstallValue;
DWORD dwAttributes;
LPSTR szArchiveName;
LPSTR szArchivePath;
LPSTR szDestinationPath;
LPSTR szDescriptionShort;
LPSTR szDescriptionLong;
LPSTR szParameter;
siCD *siCDDependencies;
siCD *siCDDependees;
siC *Next;
siC *Prev;
};
typedef struct ssInfo ssi;
struct ssInfo
{
LPSTR szDescription;
LPSTR szDomain;
LPSTR szIdentifier;
ssi *Next;
ssi *Prev;
};
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,12 +0,0 @@
[Netscape Install]
no_ads=true
silent=true
execution=false
confirm_install=false
[Proxy]
[File0]
desc=Configuration file for setup.exe
0=ftp://sweetlou/products/client/ssu/windows/config.ini

View File

@@ -1,156 +0,0 @@
/* -*- 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>
*/
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Netscape Communications\0"
VALUE "FileDescription", "setup\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "setup\0"
VALUE "LegalCopyright", "Copyright © 1999\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "setup.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Netscape Communications setup\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
1 ICON DISCARDABLE "setup.ico"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ERROR_DLL_LOAD "Could not load %s"
IDS_ERROR_STRING_LOAD "Could not load string resource ID %d"
IDS_ERROR_STRING_NULL "Null pointer encountered."
IDS_ERROR_GLOBALALLOC "Memory allocation error."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,88 +0,0 @@
/* -*- 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>
*/
/* This is a hack for vc5.0. It needs to be set *before* any shell
* include files. The INITGUID definition turns off the inclusion
* of shlguid.h in shlobj.h so it has to be done explicitly.
*/
#if (_MSC_VER == 1100)
#define INITGUID
#include "objbase.h"
DEFINE_OLEGUID(IID_IPersistFile, 0x0000010BL, 0, 0);
#endif
#include <shlobj.h>
#include <shlguid.h>
#include "shortcut.h"
HRESULT CreateALink(LPSTR lpszPathObj, LPSTR lpszPathLink, LPSTR lpszDesc, LPSTR lpszWorkingPath, LPSTR lpszArgs, LPSTR lpszIconFullPath, int iIcon)
{
HRESULT hres;
IShellLink *psl;
char lpszFullPath[MAX_BUF];
lstrcpy(lpszFullPath, lpszPathLink);
lstrcat(lpszFullPath, "\\");
lstrcat(lpszFullPath, lpszDesc);
lstrcat(lpszFullPath, ".lnk");
CreateDirectory(lpszPathLink, NULL);
CoInitialize(NULL);
// Get a pointer to the IShellLink interface.
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *)&psl);
if(SUCCEEDED(hres))
{
IPersistFile* ppf;
// Set the path to the shortcut target, and add the
// description.
psl->SetPath(lpszPathObj);
psl->SetDescription(lpszDesc);
if(lpszWorkingPath)
psl->SetWorkingDirectory(lpszWorkingPath);
if(lpszArgs)
psl->SetArguments(lpszArgs);
psl->SetIconLocation(lpszIconFullPath, iIcon);
// Query IShellLink for the IPersistFile interface for saving the
// shortcut in persistent storage.
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID FAR *)&ppf);
if(SUCCEEDED(hres))
{
WORD wsz[MAX_BUF];
// Ensure that the string is ANSI.
MultiByteToWideChar(CP_ACP, 0, lpszFullPath, -1, (wchar_t *)wsz, MAX_BUF);
// Save the link by calling IPersistFile::Save.
hres = ppf->Save((wchar_t *)wsz, TRUE);
ppf->Release();
}
psl->Release();
}
CoUninitialize();
return hres;
}

View File

@@ -1,43 +0,0 @@
/* -*- 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 _SHORTCUT_H_
#define _SHORTCUT_H_
#ifndef MAX_BUF
#define MAX_BUF 4096
#endif
#ifdef __cplusplus
extern "C"
{
#endif
HRESULT CreateALink(LPSTR lpszPathObj, LPSTR lpszPathLink, LPSTR lpszDesc, LPSTR lpszWorkingPath, LPSTR lpszArgs, LPSTR lpszIconFullPath, int iIcon);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,76 +0,0 @@
/* -*- 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",
"-237", "UNABLE_TO_LOCATE_LIB_FUNCTION",
"-238", "UNABLE_TO_LOAD_LIBRARY",
"-239", "CHROME_REGISTRY_ERROR",
"-240", "MALFORMED_INSTALL",
"-299", "OUT_OF_MEMORY",
"-322", "INIT_STUB_ERROR",
"-5550", "GESTALT_UNKNOWN_ERR",
"-5551", "GESTALT_INVALID_ARGUMENT",
""};
#endif

View File

@@ -1,738 +0,0 @@
/* -*- 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>
*/
#include "extern.h"
#include "dialogs.h"
#include "extra.h"
#include "xpistub.h"
#include "xpi.h"
#include "xperr.h"
#define BDIR_RIGHT 1
#define BDIR_LEFT 2
static XpiInit pfnXpiInit;
static XpiInstall pfnXpiInstall;
static XpiExit pfnXpiExit;
static long lFileCounter;
static long lBarberCounter;
static BOOL bBarberBar;
static DWORD dwBarberDirection;
static DWORD dwCurrentArchive;
static DWORD dwTotalArchives;
char szStrProcessingFile[MAX_BUF];
char szStrCopyingFile[MAX_BUF];
char szStrInstalling[MAX_BUF];
static void UpdateGaugeFileProgressBar(unsigned value);
static void UpdateGaugeArchiveProgressBar(unsigned value);
static void UpdateGaugeFileBarber(void);
struct ExtractFilesDlgInfo
{
HWND hWndDlg;
int nMaxFileBars; // maximum number of bars that can be displayed
int nMaxArchiveBars; // maximum number of bars that can be displayed
int nFileBars; // current number of bars to display
int nArchiveBars; // current number of bars to display
} dlgInfo;
HRESULT InitializeXPIStub()
{
char szBuf[MAX_BUF];
char szXPIStubFile[MAX_BUF];
char szEGetProcAddress[MAX_BUF];
hXPIStubInst = NULL;
if(NS_LoadString(hSetupRscInst, IDS_ERROR_GETPROCADDRESS, szEGetProcAddress, MAX_BUF) != WIZ_OK)
return(1);
/* change current directory to where xpistub.dll */
lstrcpy(szBuf, siCFXpcomFile.szDestination);
AppendBackSlash(szBuf, sizeof(szBuf));
lstrcat(szBuf, "bin");
chdir(szBuf);
/* build full path to xpistub.dll */
lstrcpy(szXPIStubFile, szBuf);
AppendBackSlash(szXPIStubFile, sizeof(szXPIStubFile));
lstrcat(szXPIStubFile, "xpistub.dll");
if(FileExists(szXPIStubFile) == FALSE)
return(2);
/* load xpistub.dll */
if((hXPIStubInst = LoadLibraryEx(szXPIStubFile, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) == NULL)
{
wsprintf(szBuf, szEDllLoad, szXPIStubFile);
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
if(((FARPROC)pfnXpiInit = GetProcAddress(hXPIStubInst, "XPI_Init")) == NULL)
{
wsprintf(szBuf, szEGetProcAddress, "XPI_Init");
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
if(((FARPROC)pfnXpiInstall = GetProcAddress(hXPIStubInst, "XPI_Install")) == NULL)
{
wsprintf(szBuf, szEGetProcAddress, "XPI_Install");
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
if(((FARPROC)pfnXpiExit = GetProcAddress(hXPIStubInst, "XPI_Exit")) == NULL)
{
wsprintf(szBuf, szEGetProcAddress, "XPI_Exit");
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
return(0);
}
HRESULT DeInitializeXPIStub()
{
pfnXpiInit = NULL;
pfnXpiInstall = NULL;
pfnXpiExit = NULL;
if(hXPIStubInst)
FreeLibrary(hXPIStubInst);
chdir(szSetupDir);
return(0);
}
void GetTotalArchivesToInstall(void)
{
DWORD dwIndex0;
siC *siCObject = NULL;
dwIndex0 = 0;
dwTotalArchives = 0;
siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL);
while(siCObject)
{
if((siCObject->dwAttributes & SIC_SELECTED) && !(siCObject->dwAttributes & SIC_LAUNCHAPP))
++dwTotalArchives;
++dwIndex0;
siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL);
}
}
HRESULT SmartUpdateJars()
{
DWORD dwIndex0;
siC *siCObject = NULL;
HRESULT hrResult;
char szBuf[MAX_BUF];
char szEXpiInstall[MAX_BUF];
char szArchive[MAX_BUF];
char szMsgSmartUpdateStart[MAX_BUF];
char szDlgExtractingTitle[MAX_BUF];
if(NS_LoadString(hSetupRscInst, IDS_MSG_SMARTUPDATE_START, szMsgSmartUpdateStart, MAX_BUF) != WIZ_OK)
return(1);
if(NS_LoadString(hSetupRscInst, IDS_DLG_EXTRACTING_TITLE, szDlgExtractingTitle, MAX_BUF) != WIZ_OK)
return(1);
if(NS_LoadString(hSetupRscInst, IDS_STR_PROCESSINGFILE, szStrProcessingFile, MAX_BUF) != WIZ_OK)
exit(1);
if(NS_LoadString(hSetupRscInst, IDS_STR_INSTALLING, szStrInstalling, MAX_BUF) != WIZ_OK)
exit(1);
if(NS_LoadString(hSetupRscInst, IDS_STR_COPYINGFILE, szStrCopyingFile, MAX_BUF) != WIZ_OK)
exit(1);
ShowMessage(szMsgSmartUpdateStart, TRUE);
if(InitializeXPIStub() == WIZ_OK)
{
lstrcpy(szBuf, sgProduct.szPath);
if(*sgProduct.szSubPath != '\0')
{
AppendBackSlash(szBuf, sizeof(szBuf));
lstrcat(szBuf, sgProduct.szSubPath);
}
hrResult = pfnXpiInit(szBuf, FILE_INSTALL_LOG, cbXPIProgress);
ShowMessage(szMsgSmartUpdateStart, FALSE);
InitProgressDlg();
GetTotalArchivesToInstall();
SetWindowText(dlgInfo.hWndDlg, szDlgExtractingTitle);
dwIndex0 = 0;
dwCurrentArchive = 0;
dwTotalArchives = (dwTotalArchives * 2) + 1;
bBarberBar = FALSE;
siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL);
while(siCObject)
{
/* launch smartupdate engine for earch jar to be installed */
if((siCObject->dwAttributes & SIC_SELECTED) &&
!(siCObject->dwAttributes & SIC_LAUNCHAPP) &&
!(siCObject->dwAttributes & SIC_DOWNLOAD_ONLY))
{
lFileCounter = 0;
lBarberCounter = 0;
dwBarberDirection = BDIR_RIGHT;
dlgInfo.nFileBars = 0;
UpdateGaugeFileProgressBar(0);
lstrcpy(szArchive, sgProduct.szAlternateArchiveSearchPath);
AppendBackSlash(szArchive, sizeof(szArchive));
lstrcat(szArchive, siCObject->szArchiveName);
if((*sgProduct.szAlternateArchiveSearchPath == '\0') || (!FileExists(szArchive)))
{
lstrcpy(szArchive, szSetupDir);
AppendBackSlash(szArchive, sizeof(szArchive));
lstrcat(szArchive, siCObject->szArchiveName);
if(!FileExists(szArchive))
{
lstrcpy(szArchive, szTempDir);
AppendBackSlash(szArchive, sizeof(szArchive));
lstrcat(szArchive, siCObject->szArchiveName);
if(!FileExists(szArchive))
{
char szEFileNotFound[MAX_BUF];
if(NS_LoadString(hSetupRscInst, IDS_ERROR_FILE_NOT_FOUND, szEFileNotFound, MAX_BUF) == WIZ_OK)
{
wsprintf(szBuf, szEFileNotFound, szArchive);
PrintError(szBuf, ERROR_CODE_HIDE);
}
return(1);
}
}
}
if(dwCurrentArchive == 0)
{
++dwCurrentArchive;
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
}
wsprintf(szBuf, szStrInstalling, siCObject->szDescriptionShort);
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS0, szBuf);
hrResult = pfnXpiInstall(szArchive, "", 0xFFFF);
if(hrResult == 999)
bReboot = TRUE;
else if(hrResult != WIZ_OK)
{
if(NS_LoadString(hSetupRscInst, IDS_ERROR_XPI_INSTALL, szEXpiInstall, MAX_BUF) == WIZ_OK)
{
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);
}
/* break out of the while loop */
break;
}
++dwCurrentArchive;
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
ProcessWindowsMessages();
}
++dwIndex0;
siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL);
}
pfnXpiExit();
DeInitProgressDlg();
}
else
{
ShowMessage(szMsgSmartUpdateStart, FALSE);
}
DeInitializeXPIStub();
return(hrResult);
}
void cbXPIStart(const char *URL, const char *UIName)
{
}
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max)
{
char szFilename[MAX_BUF];
char szStrProcessingFileBuf[MAX_BUF];
char szStrCopyingFileBuf[MAX_BUF];
if(sgProduct.dwMode != SILENT)
{
ParsePath((char *)msg, szFilename, sizeof(szFilename), PP_FILENAME_ONLY);
if(max == 0)
{
wsprintf(szStrProcessingFileBuf, szStrProcessingFile, szFilename);
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS3, szStrProcessingFileBuf);
bBarberBar = TRUE;
UpdateGaugeFileBarber();
}
else
{
if(bBarberBar == TRUE)
{
dlgInfo.nFileBars = 0;
++dwCurrentArchive;
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
bBarberBar = FALSE;
}
wsprintf(szStrCopyingFileBuf, szStrCopyingFile, szFilename);
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS3, szStrCopyingFileBuf);
UpdateGaugeFileProgressBar((unsigned)(((double)(val+1)/(double)max)*(double)100));
}
}
ProcessWindowsMessages();
}
void cbXPIFinal(const char *URL, PRInt32 finalStatus)
{
}
/////////////////////////////////////////////////////////////////////////////
// Progress bar
// Centers the specified window over the desktop. Assumes the window is
// smaller both horizontally and vertically than the desktop
static void
CenterWindow(HWND hWndDlg)
{
RECT rect;
int iLeft, iTop;
GetWindowRect(hWndDlg, &rect);
iLeft = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
iTop = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
SetWindowPos(hWndDlg, NULL, iLeft, iTop, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
// Window proc for dialog
LRESULT CALLBACK
ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
CenterWindow(hWndDlg);
return FALSE;
case WM_COMMAND:
return TRUE;
}
return FALSE; // didn't handle the message
}
// This routine will update the File Gauge progress bar to the specified percentage
// (value between 0 and 100)
static void
UpdateGaugeFileBarber()
{
int nBars;
HWND hWndGauge;
RECT rect;
if(sgProduct.dwMode != SILENT)
{
hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
if(dwBarberDirection == BDIR_RIGHT)
{
if(lBarberCounter < 151)
++lBarberCounter;
else
dwBarberDirection = BDIR_LEFT;
}
else if(dwBarberDirection == BDIR_LEFT)
{
if(lBarberCounter > 0)
--lBarberCounter;
else
dwBarberDirection = BDIR_RIGHT;
}
// Figure out how many bars should be displayed
nBars = (dlgInfo.nMaxFileBars * lBarberCounter / 100);
// Update the gauge state before painting
dlgInfo.nFileBars = nBars;
// Only invalidate the part that needs updating
GetClientRect(hWndGauge, &rect);
InvalidateRect(hWndGauge, &rect, FALSE);
// Update the whole extracting dialog. We do this because we don't
// have a message loop to process WM_PAINT messages in case the
// extracting dialog was exposed
UpdateWindow(dlgInfo.hWndDlg);
}
}
// This routine will update the File Gauge progress bar to the specified percentage
// (value between 0 and 100)
static void
UpdateGaugeFileProgressBar(unsigned value)
{
int nBars;
if(sgProduct.dwMode != SILENT)
{
// Figure out how many bars should be displayed
nBars = dlgInfo.nMaxFileBars * value / 100;
// Only paint if we need to display more bars
if((nBars > dlgInfo.nFileBars) || (dlgInfo.nFileBars == 0))
{
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
RECT rect;
// Update the gauge state before painting
dlgInfo.nFileBars = nBars;
// Only invalidate the part that needs updating
GetClientRect(hWndGauge, &rect);
InvalidateRect(hWndGauge, &rect, FALSE);
// Update the whole extracting dialog. We do this because we don't
// have a message loop to process WM_PAINT messages in case the
// extracting dialog was exposed
UpdateWindow(dlgInfo.hWndDlg);
}
}
}
// This routine will update the Archive Gauge progress bar to the specified percentage
// (value between 0 and 100)
static void
UpdateGaugeArchiveProgressBar(unsigned value)
{
int nBars;
if(sgProduct.dwMode != SILENT)
{
// Figure out how many bars should be displayed
nBars = dlgInfo.nMaxArchiveBars * value / 100;
// Only paint if we need to display more bars
if (nBars > dlgInfo.nArchiveBars)
{
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_ARCHIVE);
RECT rect;
// Update the gauge state before painting
dlgInfo.nArchiveBars = nBars;
// Only invalidate the part that needs updating
GetClientRect(hWndGauge, &rect);
InvalidateRect(hWndGauge, &rect, FALSE);
// Update the whole extracting dialog. We do this because we don't
// have a message loop to process WM_PAINT messages in case the
// extracting dialog was exposed
UpdateWindow(dlgInfo.hWndDlg);
}
}
}
// Draws a recessed border around the gauge
static void
DrawGaugeBorder(HWND hWnd)
{
HDC hDC = GetWindowDC(hWnd);
RECT rect;
int cx, cy;
HPEN hShadowPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
HGDIOBJ hOldPen;
GetWindowRect(hWnd, &rect);
cx = rect.right - rect.left;
cy = rect.bottom - rect.top;
// Draw a dark gray line segment
hOldPen = SelectObject(hDC, (HGDIOBJ)hShadowPen);
MoveToEx(hDC, 0, cy - 1, NULL);
LineTo(hDC, 0, 0);
LineTo(hDC, cx - 1, 0);
// Draw a white line segment
SelectObject(hDC, GetStockObject(WHITE_PEN));
MoveToEx(hDC, 0, cy - 1, NULL);
LineTo(hDC, cx - 1, cy - 1);
LineTo(hDC, cx - 1, 0);
SelectObject(hDC, hOldPen);
DeleteObject(hShadowPen);
ReleaseDC(hWnd, hDC);
}
// Draws the blue progress bar
static void
DrawProgressBar(HWND hWnd, int nBars)
{
int i;
PAINTSTRUCT ps;
HDC hDC;
RECT rect;
HBRUSH hBrush;
hDC = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rect);
if(nBars <= 0)
{
/* clear the bars */
hBrush = CreateSolidBrush(GetSysColor(COLOR_MENU));
FillRect(hDC, &rect, hBrush);
}
else
{
// Draw the bars
hBrush = CreateSolidBrush(RGB(0, 0, 128));
rect.left = rect.top = BAR_MARGIN;
rect.bottom -= BAR_MARGIN;
rect.right = rect.left + BAR_WIDTH;
for(i = 0; i < nBars; i++)
{
RECT dest;
if(IntersectRect(&dest, &ps.rcPaint, &rect))
FillRect(hDC, &rect, hBrush);
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
}
}
DeleteObject(hBrush);
EndPaint(hWnd, &ps);
}
// Draws the blue progress bar
static void
DrawBarberBar(HWND hWnd, int nBars)
{
int i;
PAINTSTRUCT ps;
HDC hDC;
RECT rect;
HBRUSH hBrush;
HBRUSH hBrushClear;
hDC = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rect);
if(nBars <= 0)
{
/* clear the bars */
hBrushClear = CreateSolidBrush(GetSysColor(COLOR_MENU));
FillRect(hDC, &rect, hBrushClear);
}
else
{
// Draw the bars
hBrushClear = CreateSolidBrush(GetSysColor(COLOR_MENU));
hBrush = CreateSolidBrush(RGB(0, 0, 128));
rect.left = rect.top = BAR_MARGIN;
rect.bottom -= BAR_MARGIN;
rect.right = rect.left + BAR_WIDTH;
for(i = 0; i < (nBars + 1); i++)
{
RECT dest;
if(IntersectRect(&dest, &ps.rcPaint, &rect))
{
if((i >= (nBars - 15)) && (i < nBars))
FillRect(hDC, &rect, hBrush);
else
FillRect(hDC, &rect, hBrushClear);
}
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
}
}
DeleteObject(hBrushClear);
DeleteObject(hBrush);
EndPaint(hWnd, &ps);
}
// Adjusts the width of the gauge based on the maximum number of bars
static void
SizeToFitGauge(HWND hWnd, int nMaxBars)
{
RECT rect;
int cx;
// Get the window size in pixels
GetWindowRect(hWnd, &rect);
// Size the width to fit
cx = 2 * GetSystemMetrics(SM_CXBORDER) + 2 * BAR_MARGIN +
nMaxBars * BAR_WIDTH + (nMaxBars - 1) * BAR_SPACING;
SetWindowPos(hWnd, NULL, -1, -1, cx, rect.bottom - rect.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
// Window proc for file gauge
LRESULT CALLBACK
GaugeFileWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
DWORD dwStyle;
RECT rect;
switch(msg)
{
case WM_NCCREATE:
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
return(TRUE);
case WM_CREATE:
// Figure out the maximum number of bars that can be displayed
GetClientRect(hWnd, &rect);
dlgInfo.nFileBars = 0;
dlgInfo.nMaxFileBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
// Size the gauge to exactly fit the maximum number of bars
SizeToFitGauge(hWnd, dlgInfo.nMaxFileBars);
return(FALSE);
case WM_NCPAINT:
DrawGaugeBorder(hWnd);
return(FALSE);
case WM_PAINT:
if(bBarberBar == TRUE)
DrawBarberBar(hWnd, dlgInfo.nFileBars);
else
DrawProgressBar(hWnd, dlgInfo.nFileBars);
return(FALSE);
}
return(DefWindowProc(hWnd, msg, wParam, lParam));
}
// Window proc for file gauge
LRESULT CALLBACK
GaugeArchiveWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
DWORD dwStyle;
RECT rect;
switch(msg)
{
case WM_NCCREATE:
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
return(TRUE);
case WM_CREATE:
// Figure out the maximum number of bars that can be displayed
GetClientRect(hWnd, &rect);
dlgInfo.nArchiveBars = 0;
dlgInfo.nMaxArchiveBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
// Size the gauge to exactly fit the maximum number of bars
SizeToFitGauge(hWnd, dlgInfo.nMaxArchiveBars);
return(FALSE);
case WM_NCPAINT:
DrawGaugeBorder(hWnd);
return(FALSE);
case WM_PAINT:
DrawProgressBar(hWnd, dlgInfo.nArchiveBars);
return(FALSE);
}
return(DefWindowProc(hWnd, msg, wParam, lParam));
}
void InitProgressDlg()
{
WNDCLASS wc;
if(sgProduct.dwMode != SILENT)
{
memset(&wc, 0, sizeof(wc));
wc.style = CS_GLOBALCLASS;
wc.hInstance = hInst;
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wc.lpfnWndProc = (WNDPROC)GaugeFileWndProc;
wc.lpszClassName = "GaugeFile";
RegisterClass(&wc);
wc.lpfnWndProc = (WNDPROC)GaugeArchiveWndProc;
wc.lpszClassName = "GaugeArchive";
RegisterClass(&wc);
// Display the dialog box
dlgInfo.hWndDlg = CreateDialog(hSetupRscInst, MAKEINTRESOURCE(DLG_EXTRACTING), hWndMain, (WNDPROC)ProgressDlgProc);
UpdateWindow(dlgInfo.hWndDlg);
}
}
void DeInitProgressDlg()
{
if(sgProduct.dwMode != SILENT)
{
DestroyWindow(dlgInfo.hWndDlg);
UnregisterClass("GaugeFile", hInst);
UnregisterClass("GaugeArchive", hInst);
}
}

View File

@@ -1,46 +0,0 @@
/* -*- 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 _XPI_H_
#define _XPI_H_
#define BAR_MARGIN 1
#define BAR_SPACING 2
#define BAR_WIDTH 6
typedef HRESULT (_cdecl *XpiInit)(const char *, const char *aLogName, pfnXPIProgress);
typedef HRESULT (_cdecl *XpiInstall)(const char *, const char *, long);
typedef void (_cdecl *XpiExit)(void);
HRESULT InitializeXPIStub(void);
HRESULT DeInitializeXPIStub(void);
HRESULT SmartUpdateJars(void);
void cbXPIStart(const char *, const char *UIName);
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max);
void cbXPIFinal(const char *, PRInt32 finalStatus);
void InitProgressDlg(void);
void DeInitProgressDlg(void);
void GetTotalArchivesToInstall(void);
#endif

View File

@@ -1,119 +0,0 @@
/* -*- Mode: C; tab-width: 4; 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):
* Daniel Veditz <dveditz@netscape.com>
*/
//#include "nsError.h"
//#include "prtypes.h"
#ifdef XP_MAC
#include <Files.h>
#endif
#define nsresult long
PR_BEGIN_EXTERN_C
/** pfnXPIStart -- script start callback
*
* When an install script gets to StartInstall() this function
* will be called to tell the observer the pretty-name of the
* install package. You are not guaranteed this will be called
* for all scripts--there might be a fatal error before it gets
* to StartInstall(), either in the script itself or in the
* engine trying to set up for it.
*/
typedef void (*pfnXPIStart) (const char* URL, const char* UIName);
/** pfnXPIProgress -- individual install item callback
*
* This callback will be called twice for each installed item,
* First when it is scheduled (val and max will both be 0) and
* then during the finalize step.
*/
typedef void (*pfnXPIProgress)(const char* msg, PRInt32 val, PRInt32 max);
/** pfnXPIFinal -- script end callback
*
* This function will be called when the script calls either
* AbortInstall() or FinalizeInstall() and will return the
* last error code.
*/
typedef void (*pfnXPIFinal) (const char* URL, PRInt32 finalStatus);
/** XPI_Init
*
* call XPI_Init() to initialize XPCOM and the XPInstall
* engine, and to pass in your callback functions.
*
* @param aXPIStubDir [MAC only] directory of the xpistub shlb off of which
* the component manager derives the components directory.
* @param aProgramDir directory to use as "program" directory. If NULL default
* will be used -- the location of the calling executable.
* Must be native filename format.
* @param startCB Called when script started
* @param progressCB Called for each installed file
* @param finalCB Called with status code at end
*
* @returns XPCOM status code indicating success or failure
*/
PR_EXTERN(nsresult) XPI_Init(
#ifdef XP_MAC
const FSSpec& aXPIStubDir,
const FSSpec& aProgramDir,
#else
const char* aProgramDir,
#endif
const char* aLogName,
pfnXPIProgress progressCB);
/** XPI_Install
*
* Install an XPI package from a local file
*
* @param file Native filename of XPI archive
* @param args Install.arguments, if any
* @param flags the old SmartUpdate trigger flags. This may go away
*
* @returns status Status from the installed archive
*/
PR_EXTERN(PRInt32) XPI_Install(
#ifdef XP_MAC
const FSSpec& file,
#else
const char* file,
#endif
const char* args,
long flags );
/** XPI_Exit
*
* call when done to shut down the XPInstall and XPCOM engines
* and free allocated memory
*/
PR_EXTERN(void) XPI_Exit();
PR_END_EXTERN_C

View File

@@ -1,86 +0,0 @@
/* -*- Mode: C; tab-width: 4; 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):
* Daniel Veditz <dveditz@netscape.com>
*/
#ifndef _zipfile_h
#define _zipfile_h
/*
* This module implements a simple archive extractor for the PKZIP format.
*
* All functions return a status/error code, and have an opaque hZip argument
* that represents an open archive.
*
* Currently only compression mode 8 (or none) is supported.
*/
#define ZIP_OK 0
#define ZIP_ERR_GENERAL -1
#define ZIP_ERR_MEMORY -2
#define ZIP_ERR_DISK -3
#define ZIP_ERR_CORRUPT -4
#define ZIP_ERR_PARAM -5
#define ZIP_ERR_FNF -6
#define ZIP_ERR_UNSUPPORTED -7
#define ZIP_ERR_SMALLBUF -8
PR_BEGIN_EXTERN_C
/* Open and close the archive
*
* If successful OpenArchive returns a handle in the hZip parameter
* that must be passed to all subsequent operations on the archive
*/
extern _declspec(dllexport)int ZIP_OpenArchive( const char * zipname, void** hZip );
extern _declspec(dllexport)int ZIP_CloseArchive( void** hZip );
/* Extract the named file in the archive to disk.
* This function will happily overwrite an existing Outfile if it can.
* It's up to the caller to detect or move it out of the way if it's important.
*/
extern _declspec(dllexport)int ZIP_ExtractFile( void* hZip, const char * filename, const char * outname );
/* Functions to list the files contained in the archive
*
* FindInit() initializes the search with the pattern and returns a find token,
* or NULL on an error. Then FindNext() is called with the token to get the
* matching filenames if any. When done you must call FindFree() with the
* token to release memory.
*
* a NULL pattern will find all the files in the archive, otherwise the
* pattern must be a shell regexp type pattern.
*
* if a matching filename is too small for the passed buffer FindNext()
* will return ZIP_ERR_SMALLBUF. When no more matches can be found in
* the archive it will return ZIP_ERR_FNF
*/
extern _declspec(dllexport)void* ZIP_FindInit( void* hZip, const char * pattern );
extern _declspec(dllexport)int ZIP_FindNext( void* hFind, char * outbuf, int bufsize );
extern _declspec(dllexport)int ZIP_FindFree( void* hFind );
PR_END_EXTERN_C
#endif /* _zipfile_h */