Next Gen App Wizard Front End... forking Seamonkey Installer FE.

This commit is contained in:
ben%bengoodger.com 2003-10-09 02:02:08 +00:00
Родитель b5031beec6
Коммит 5b28670bc3
68 изменённых файлов: 27456 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,32 @@
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = windows
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,32 @@
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = wizard
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,32 @@
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = uninstall setuprsc setup
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,85 @@
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
PROGRAM = setup$(BIN_SUFFIX)
RESFILE = setup.res
REQUIRES = \
setuprsc \
xpnet \
$(NULL)
EXTRA_DSO_LIBS = \
mozregsa_s \
jar50_s \
mozz_s \
xpnet_s \
$(NULL)
USE_NON_MT_LIBS = 1
CSRCS = \
dialogs.c \
extra.c \
ifuncns.c \
setup.c \
xpi.c \
logging.c \
supersede.c \
version.c \
process.c \
CPPSRCS = \
shortcut.cpp \
xpnetHook.cpp \
nsEscape.cpp \
$(NULL)
LIBS = $(EXTRA_DSO_LIBS)
LOCAL_INCLUDES = -I$(srcdir) -I$(srcdir)/../uninstall
NO_DIST_INSTALL = 1
MOZ_WINCONSOLE = 0
include $(topsrcdir)/config/rules.mk
_OS_LIBS = ole32 comdlg32 shell32 version
ifdef GNU_CC
_OS_LIBS += gdi32 ws2_32 uuid
endif
OS_LIBS += $(call EXPAND_LIBNAME,$(_OS_LIBS))
libs:: $(PROGRAM)
$(INSTALL) $(PROGRAM) $(DIST)/install
install:: $(PROGRAM)
$(INSTALL) $(PROGRAM) $(DESTDIR)$(mozappdir)/install
clean clobber realclean clobber_all::
$(RM) $(DIST)/install/$(PROGRAM)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,71 @@
/* -*- 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 DlgProcAdditionalOptions(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcQuickLaunch(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);
BOOL AskCancelDlg(HWND hDlg);
void lbAddItem(HWND hList, siC *siCComponent);
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
void DlgSequence(int iDirection);
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 DrawLBText(LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag);
void DrawCheck(LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag);
void InvalidateLBCheckbox(HWND hwndListBox);
void ProcessWindowsMessages(void);
LPSTR GetStartInstallMessage(void);
void AppendStringWOAmpersand(LPSTR szInputString, DWORD dwInputStringSize, LPSTR szString);
void TruncateString(HWND hWnd, LPSTR szInPath, LPSTR szOutPath, DWORD dwOutPathBufSize);
void SaveAdditionalOptions(HWND hDlg, HWND hwndCBSiteSelector);
WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc);
LRESULT CALLBACK ListBoxBrowseWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void DisableSystemMenuItems(HWND hWnd, BOOL bDisableClose);
void CommitInstall(void);
void RepositionWindow(HWND aHwndDlg, DWORD aBannerImage);
void SaveWindowPosition(HWND aDlg);
#endif /* _DIALOGS_H_ */

Просмотреть файл

@ -0,0 +1,109 @@
/* -*- 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 LPSTR szEGlobalAlloc;
extern LPSTR szEStringLoad;
extern LPSTR szEDllLoad;
extern LPSTR szEStringNull;
extern LPSTR szEOutOfMemory;
extern LPSTR szTempSetupPath;
extern LPSTR szSetupDir;
extern LPSTR szTempDir;
extern LPSTR szOSTempDir;
extern LPSTR szFileIniConfig;
extern LPSTR szFileIniInstall;
extern LPSTR szSiteSelectorDescription;
extern DWORD dwWizardState;
extern DWORD dwSetupType;
extern DWORD dwTempSetupType;
extern DWORD gdwUpgradeValue;
extern DWORD gdwSiteSelectorStatus;
extern BOOL bSDUserCanceled;
extern BOOL bIdiArchivesExists;
extern BOOL bCreateDestinationDir;
extern BOOL bReboot;
extern BOOL gbILUseTemp;
extern BOOL gbPreviousUnfinishedDownload;
extern BOOL gbIgnoreRunAppX;
extern BOOL gbIgnoreProgramFolderX;
extern BOOL gbRestrictedAccess;
extern BOOL gbDownloadTriggered;
extern BOOL gbAllowMultipleInstalls;
extern BOOL gbForceInstall;
extern BOOL gbForceInstallGre;
extern BOOL gShowBannerImage;
extern setupGen sgProduct;
extern diS diSetup;
extern diW diWelcome;
extern diQL diQuickLaunch;
extern diL diLicense;
extern diST diSetupType;
extern diSC diSelectComponents;
extern diSC diSelectAdditionalComponents;
extern diWI diWindowsIntegration;
extern diPF diProgramFolder;
extern diDO diAdditionalOptions;
extern diAS diAdvancedSettings;
extern diSI diStartInstall;
extern diD diDownload;
extern diR diReboot;
extern siSD siSDObject;
extern siCF siCFXpcomFile;
extern siC *siComponents;
extern ssi *ssiSiteSelector;
extern char *SetupFileList[];
extern installGui sgInstallGui;
extern sems gErrorMessageStream;
extern sysinfo gSystemInfo;
extern dsN *gdsnComponentDSRequirement;
#endif /* _EXTERN_H */

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,236 @@
/* -*- 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_
#include "supersede.h"
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_GlobalReAlloc(HGLOBAL *hgMemory,
DWORD dwMemoryBufSize,
DWORD dwNewSize);
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 ParseInstallIni();
HRESULT DecryptString(LPSTR szOutputStr, LPSTR szInputStr);
HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize);
void CollateBackslashes(LPSTR szInputOutputStr);
HRESULT InitSetupGeneral(void);
HRESULT InitDlgWelcome(diW *diDialog);
HRESULT InitDlgLicense(diL *diDialog);
HRESULT InitDlgQuickLaunch(diQL *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, HWND hwndListBox);
void SiCNodeSetItemsSelected(DWORD dwSetupType);
char *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
char *SiCNodeGetDescriptionShort(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
char *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
char *SiCNodeGetReferenceName(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);
siC *SiCNodeFind(siC *siComponents, char *szInReferenceName);
void InitSiComponents(char *szFileIni);
HRESULT ParseComponentAttributes(char *szBuf, DWORD dwAttributes, BOOL bOverride);
void InitSiteSelector(char *szFileIni);
void DeInitSiCDependencies(siCD *siCDDependencies);
BOOL ResolveDependencies(DWORD dwIndex, HWND hwndListBox);
BOOL ResolveComponentDependency(siCD *siCDInDependency, HWND hwndListBox);
void ResolveDependees(LPSTR szToggledDescriptionShort, HWND hwndListBox);
BOOL ResolveComponentDependee(siCD *siCDInDependee);
void STSetVisibility(st *stSetupType);
HRESULT InitSXpcomFile(void);
void DeInitSXpcomFile(void);
void DeInitialize(void);
void DeInitDlgWelcome(diW *diDialog);
void DeInitDlgLicense(diL *diDialog);
void DeInitDlgQuickLaunch(diQL *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 DetermineOSVersionEx(void);
void DeInitSiComponents(siC **siComponents);
void DeInitSetupGeneral(void);
HRESULT ParseSetupIni(void);
HRESULT GetConfigIni(void);
HRESULT GetInstallIni(void);
void CleanTempFiles(void);
void OutputSetupTitle(HDC hDC);
long RetrieveArchives(void);
long RetrieveRedirectFile(void);
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, BOOL bUseSlash, 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);
BOOL DeleteIdiFileIniInstall(void);
void DeleteArchives(DWORD dwDeleteCheck);
BOOL DeleteIniRedirect(void);
HRESULT LaunchApps(void);
HRESULT FileExists(LPSTR szFile);
int ExtractDirEntries(char* directory,void* vZip);
int LocateJar(siC *siCObject, LPSTR szPath, int dwPathSize, BOOL bIncludeTempDir);
HRESULT AddArchiveToIdiFile(siC *siCObject,
char *szSFile,
char *szFileIdiGetArchives);
int SiCNodeGetIndexDS(char *szInDescriptionShort);
int SiCNodeGetIndexRN(char *szInReferenceName);
void ViewSiComponentsDependency(char *szBuffer, char *szIndentation, siC *siCNode);
void ViewSiComponentsDependee(char *szBuffer, char *szIndentation, siC *siCNode);
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);
BOOL CheckLegacy(HWND hDlg);
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);
int MozCopyStr(LPSTR szSrc, LPSTR szDest, DWORD dwDestBufSize);
LPSTR GetFirstNonSpace(LPSTR lpszString);
LPSTR MozStrChar(LPSTR lpszString, char c);
int GetArgC(LPSTR lpszCommandLine);
LPSTR GetArgV(LPSTR lpszCommandLine,
int iIndex,
LPSTR lpszDest,
int iDestSize);
DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine);
DWORD ParseForStartupOptions(LPSTR aCmdLine);
void SetSetupRunMode(LPSTR szMode);
void Delay(DWORD dwSeconds);
void UnsetSetupState(void);
void SetSetupState(char *szState);
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 ContainsReparseTag(char *szPath,
char *szReparsePath,
DWORD dwReparsePathSize);
BOOL DeleteInstallLogFile(char *szFile);
int CRCCheckDownloadedArchives(char *szCorruptedArchiveList,
DWORD dwCorruptedArchivelistSize,
char *szFileIdiGetArchives);
int CRCCheckArchivesStartup(char *szCorruptedArchiveList,
DWORD dwCorruptedArchiveListSize,
BOOL bIncludeTempPath);
BOOL ResolveForceUpgrade(siC *siCObject);
void RestoreInvisibleFlag(siC *siCNode);
void RestoreAdditionalFlag(siC *siCNode);
void RestoreEnabledFlag(siC *siCNode);
void SwapFTPAndHTTP(char *szInUrl, DWORD dwInUrlSize);
void ClearWinRegUninstallFileDeletion(void);
int AppendToGlobalMessageStream(char *szInfo);
char *GetOSTypeString(char *szOSType, DWORD dwOSTypeBufSize);
int UpdateIdiFile(char *szPartialUrl,
DWORD dwPartialUrlBufSize,
siC *siCObject,
char *szSection,
char *szKey,
char *szFileIdiGetArchives);
void SetDownloadFile(void);
void UnsetSetupCurrentDownloadFile(void);
void SetSetupCurrentDownloadFile(char *szCurrentFilename);
char *GetSetupCurrentDownloadFile(char *szCurrentDownloadFile,
DWORD dwCurrentDownloadFileBufSize);
BOOL DeleteWGetLog(void);
DWORD ParseOSType(char *szOSType);
BOOL ShowAdditionalOptionsDialog(void);
DWORD GetPreviousUnfinishedState(void);
void RefreshIcons();
void NeedToInstallFiles(LPSTR szProdDir);
void LaunchOneComponent(siC *siCObject, greInfo *aGre);
HRESULT ProcessXpinstallEngine(void);
void GetXpinstallPath(char *aPath, int aPathBufSize);
BOOL GreInstallerNeedsReboot(void);
void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
void UpdateGREAppInstallerProgress(int percent);
BOOL IsPathWithinWindir();
void CleanupOnUpgrade();
BOOL IsInstallerProductGRE(void);
HRESULT CleanupOrphanedGREs(void);
#endif /* _EXTRA_H_ */

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,110 @@
/* -*- 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 MeetCondition(LPSTR dwSection);
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo);
HRESULT ProcessXpcomFile(void);
void CleanupXpcomFile(void);
HRESULT ProcessUncompressFile(DWORD dwTiming, char *szSectionPrefix);
HRESULT FileMove(LPSTR szFrom, LPSTR szTo);
HRESULT ProcessMoveFile(DWORD dwTiming, char *szSectionPrefix);
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists, BOOL bDnu);
HRESULT ProcessCopyFile(DWORD dwTiming, char *szSectionPrefix);
HRESULT ProcessCreateDirectory(DWORD dwTiming, char *szSectionPrefix);
HRESULT ProcessCreateCustomFiles(DWORD dwTiming);
HRESULT FileDelete(LPSTR szDestination);
HRESULT ProcessDeleteFile(DWORD dwTiming, char *szSectionPrefix);
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs);
HRESULT ProcessRemoveDirectory(DWORD dwTiming, char *szSectionPrefix);
HRESULT ProcessRunApp(DWORD dwTiming, char *szSectionPrefix);
HRESULT ProcessWinReg(DWORD dwTiming, char *szSectionPrefix);
HRESULT CreateALink(LPSTR lpszPathObj,
LPSTR lpszPathLink,
LPSTR lpszDesc,
LPSTR lpszWorkingPath,
LPSTR lpszArgs,
LPSTR lpszIconFullPath,
int iIcon);
HRESULT ProcessProgramFolder(DWORD dwTiming, char *szSectionPrefix);
HRESULT ProcessProgramFolderShowCmd(void);
HRESULT CreateDirectoriesAll(char* szPath, BOOL bLogForUninstall);
void ProcessFileOps(DWORD dwTiming, char *szSectionPrefix);
void DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
void DeleteWinRegKey(HKEY hkRootKey, LPSTR szKey, BOOL bAbsoluteDelete);
DWORD 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,
BOOL bLogForUninstall,
BOOL bDnu);
HKEY ParseRootKey(LPSTR szRootKey);
char *ParseRootKeyString(HKEY hkKey,
LPSTR szRootKey,
DWORD dwRootKeyBufSize);
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, char *szSectionPrefix);
void UpdateInstallLog(LPSTR szKey, LPSTR szString, BOOL bDnu);
void UpdateInstallStatusLog(LPSTR szString);
int RegisterDll32(char *File);
HRESULT FileSelfRegister(LPSTR szFilename, LPSTR szDestination);
HRESULT ProcessSelfRegisterFile(DWORD dwTiming, char *szSectionPrefix);
void UpdateJSProxyInfo(void);
int VerifyArchive(LPSTR szArchive);
HRESULT ProcessSetVersionRegistry(DWORD dwTiming, char *szSectionPrefix);
char *BuildNumberedString(DWORD dwIndex, char *szInputStringPrefix, char *szInputString, char *szOutBuf, DWORD dwOutBufSize);
void GetUserAgentShort(char *szUserAgent, char *szOutUAShort, DWORD dwOutUAShortSize);
void CleanupPreviousVersionRegKeys(void);
DWORD ParseRestrictedAccessKey(LPSTR szKey);
LPSTR GetKeyInfo(LPSTR aKey, LPSTR aOut, DWORD aOutBufSize, DWORD aInfoType);
void AppendWinReg(HKEY hkRootKey,
LPSTR szKey,
LPSTR szName,
DWORD dwType,
LPBYTE lpbData,
BYTE delimiter,
DWORD dwSize,
BOOL bLogForUninstall,
BOOL bDnu);
HRESULT CleanupArgsRegistry();
void ProcessFileOpsForSelectedComponents(DWORD dwTiming);
void ProcessFileOpsForAll(DWORD dwTiming);
HRESULT DirHasWriteAccess(char *szPath);
#define KEY_INFO_ROOT 0x00000001
#define KEY_INFO_SUBKEY 0x00000002
#endif /* _IFUNCNS_H_ */

Просмотреть файл

@ -0,0 +1,655 @@
/*
* 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 Navigator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape Communications Corp. are
* Copyright (C) 2001 Netscape Communications Corp. All Rights
* Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
*/
#include "extern.h"
#include "logging.h"
#include "extra.h"
#include "ifuncns.h"
#include "xpi.h"
#define E_USER_CANCEL -813
#define SECTION_EXIT_STATUS "Exit Status"
#define KEY_STATUS "Status"
int AppendToGlobalMessageStream(char *szInfo)
{
DWORD dwInfoLen = lstrlen(szInfo);
DWORD dwMessageLen;
if(gErrorMessageStream.bEnabled && gErrorMessageStream.szMessage)
{
dwMessageLen = lstrlen(gErrorMessageStream.szMessage);
if((dwInfoLen + dwMessageLen) >= gErrorMessageStream.dwMessageBufSize)
{
if(NS_GlobalReAlloc(&gErrorMessageStream.szMessage,
gErrorMessageStream.dwMessageBufSize,
dwInfoLen + dwMessageLen + MAX_BUF_TINY) == NULL)
return(WIZ_OUT_OF_MEMORY);
gErrorMessageStream.dwMessageBufSize = dwInfoLen +
dwMessageLen +
MAX_BUF_TINY;
}
lstrcat(gErrorMessageStream.szMessage, szInfo);
}
return(WIZ_OK);
}
void LogISTime(int iType)
{
char szBuf[MAX_BUF];
char szTime[MAX_BUF_TINY];
char szDate[MAX_BUF_TINY];
SYSTEMTIME stLocalTime;
GetLocalTime(&stLocalTime);
GetTimeFormat(LOCALE_NEUTRAL,
LOCALE_NOUSEROVERRIDE,
&stLocalTime,
NULL,
szTime,
sizeof(szTime));
GetDateFormat(LOCALE_NEUTRAL,
LOCALE_NOUSEROVERRIDE,
&stLocalTime,
NULL,
szDate,
sizeof(szDate));
if(iType == W_START)
wsprintf(szBuf, "Start Log: %s - %s\n", szDate, szTime);
else
wsprintf(szBuf, "End Log: %s - %s\n", szDate, szTime);
UpdateInstallStatusLog(szBuf);
}
void LogISProductInfo(void)
{
char szBuf[MAX_BUF];
wsprintf(szBuf, "\n Product Info:\n");
UpdateInstallStatusLog(szBuf);
switch(sgProduct.mode)
{
case SILENT:
wsprintf(szBuf, " Install mode: Silent\n");
break;
case AUTO:
wsprintf(szBuf, " Install mode: Auto\n");
break;
default:
wsprintf(szBuf, " Install mode: Normal\n");
break;
}
UpdateInstallStatusLog(szBuf);
wsprintf(szBuf, " Company name: %s\n Product name (external): %s\n Product name (internal): %s\n Uninstall Filename: %s\n UserAgent: %s\n Alternate search path: %s\n",
sgProduct.szCompanyName,
sgProduct.szProductName,
sgProduct.szProductNameInternal,
sgProduct.szUninstallFilename,
sgProduct.szUserAgent,
sgProduct.szAlternateArchiveSearchPath);
UpdateInstallStatusLog(szBuf);
}
void LogISDestinationPath(void)
{
char szBuf[MAX_BUF];
wsprintf(szBuf,
"\n Destination Path:\n Main: %s\n SubPath: %s\n",
sgProduct.szPath,
sgProduct.szSubPath);
UpdateInstallStatusLog(szBuf);
}
void LogISShared(void)
{
char szBuf[MAX_BUF];
if(sgProduct.bSharedInst == TRUE)
wsprintf(szBuf,"\n Shared Installation: TRUE\n");
UpdateInstallStatusLog(szBuf);
}
void LogISSetupType(void)
{
char szBuf[MAX_BUF_TINY];
switch(dwSetupType)
{
case ST_RADIO3:
wsprintf(szBuf, "\n Setup Type: %s\n",
diSetupType.stSetupType3.szDescriptionShort);
break;
case ST_RADIO2:
wsprintf(szBuf, "\n Setup Type: %s\n",
diSetupType.stSetupType2.szDescriptionShort);
break;
case ST_RADIO1:
wsprintf(szBuf, "\n Setup Type: %s\n",
diSetupType.stSetupType1.szDescriptionShort);
break;
default:
wsprintf(szBuf, "\n Setup Type: %s\n",
diSetupType.stSetupType0.szDescriptionShort);
break;
}
UpdateInstallStatusLog(szBuf);
}
void LogISComponentsSelected(void)
{
char szBuf[MAX_BUF_TINY];
siC *siCNode;
BOOL bFoundComponentSelected;
wsprintf(szBuf, "\n Components selected:\n");
UpdateInstallStatusLog(szBuf);
bFoundComponentSelected = FALSE;
siCNode = siComponents;
do
{
if(siCNode == NULL)
break;
if(siCNode->dwAttributes & SIC_SELECTED)
{
if(!siCNode->bForceUpgrade)
wsprintf(szBuf,
" %s\n",
siCNode->szDescriptionShort);
else
wsprintf(szBuf,
" %s (Required)\n",
siCNode->szDescriptionShort);
UpdateInstallStatusLog(szBuf);
bFoundComponentSelected = TRUE;
}
siCNode = siCNode->Next;
} while((siCNode != NULL) && (siCNode != siComponents));
if(!bFoundComponentSelected)
{
wsprintf(szBuf, " none\n");
UpdateInstallStatusLog(szBuf);
}
}
void LogISComponentsToDownload(void)
{
char szBuf[MAX_BUF_TINY];
char szArchivePath[MAX_BUF_MEDIUM];
siC *siCNode;
BOOL bFoundComponentSelected;
BOOL bFoundComponentsToDownload;
wsprintf(szBuf, "\n Components to download:\n");
UpdateInstallStatusLog(szBuf);
bFoundComponentSelected = FALSE;
bFoundComponentsToDownload = FALSE;
siCNode = siComponents;
do
{
if(siCNode == NULL)
break;
if(siCNode->dwAttributes & SIC_SELECTED)
{
if(LocateJar(siCNode,
szArchivePath,
sizeof(szArchivePath),
gbPreviousUnfinishedDownload) == AP_NOT_FOUND)
{
wsprintf(szBuf,
" %s will be downloaded\n",
siCNode->szDescriptionShort);
bFoundComponentsToDownload = TRUE;
}
else
wsprintf(szBuf,
" %s found: %s\n",
siCNode->szDescriptionShort,
szArchivePath);
UpdateInstallStatusLog(szBuf);
bFoundComponentSelected = TRUE;
}
siCNode = siCNode->Next;
} while((siCNode != NULL) && (siCNode != siComponents));
if(!bFoundComponentSelected)
{
wsprintf(szBuf, " none\n");
UpdateInstallStatusLog(szBuf);
}
if(!bFoundComponentsToDownload)
{
wsprintf(szBuf, " **\n ** All components have been found locally. No components will be downloaded.\n **\n");
UpdateInstallStatusLog(szBuf);
}
}
void LogISDownloadProtocol(DWORD dwProtocolType)
{
char szBuf[MAX_BUF];
char szProtocolType[MAX_BUF];
switch(dwProtocolType)
{
case UP_HTTP:
lstrcpy(szProtocolType, "HTTP");
break;
default:
lstrcpy(szProtocolType, "FTP");
break;
}
wsprintf(szBuf, "\n Download protocol: %s\n", szProtocolType);
UpdateInstallStatusLog(szBuf);
}
void LogISDownloadStatus(char *szStatus, char *szFailedFile)
{
char szBuf[MAX_BUF];
siC *siCObject = NULL;
DWORD dwIndex;
if(szFailedFile)
wsprintf(szBuf,
"\n Download status: %s\n file: %s\n\n",
szStatus,
szFailedFile);
else
wsprintf(szBuf,
"\n Download status: %s\n",
szStatus);
UpdateInstallStatusLog(szBuf);
dwIndex = 0;
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
while(siCObject)
{
if(siCObject->dwAttributes & SIC_SELECTED)
{
wsprintf(szBuf, " %s: NetRetries:%d, CRCRetries:%d, NetTimeOuts:%d\n",
siCObject->szDescriptionShort,
siCObject->iNetRetries,
siCObject->iCRCRetries,
siCObject->iNetTimeOuts);
UpdateInstallStatusLog(szBuf);
}
++dwIndex;
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
}
}
void LogISComponentsFailedCRC(char *szList, int iWhen)
{
char szBuf[MAX_BUF];
if(iWhen == W_STARTUP)
{
if(szList && (*szList != '\0'))
wsprintf(szBuf,
"\n Components corrupted (startup):\n%s",
szList);
else
wsprintf(szBuf,
"\n Components corrupted (startup):\n none\n");
}
else
{
if(szList && (*szList != '\0'))
wsprintf(szBuf,
"\n Components corrupted (download):\n%s",
szList);
else
wsprintf(szBuf,
"\n Components corrupted (download):\n none\n");
}
UpdateInstallStatusLog(szBuf);
}
void LogISXPInstall(int iWhen)
{
char szBuf[MAX_BUF];
if(iWhen == W_START)
wsprintf(szBuf, "\n XPInstall Start\n");
else
wsprintf(szBuf, " XPInstall End\n");
UpdateInstallStatusLog(szBuf);
}
void LogISXPInstallComponent(char *szComponentName)
{
char szBuf[MAX_BUF];
wsprintf(szBuf, " %s", szComponentName);
UpdateInstallStatusLog(szBuf);
}
void LogISXPInstallComponentResult(DWORD dwErrorNumber)
{
char szBuf[MAX_BUF];
char szErrorString[MAX_BUF];
GetErrorString(dwErrorNumber, szErrorString, sizeof(szErrorString));
wsprintf(szBuf, ": %d %s\n", dwErrorNumber, szErrorString);
UpdateInstallStatusLog(szBuf);
}
void LogISLaunchApps(int iWhen)
{
char szBuf[MAX_BUF];
if(iWhen == W_START)
wsprintf(szBuf, "\n Launch Apps Start\n");
else
wsprintf(szBuf, " Launch Apps End\n");
UpdateInstallStatusLog(szBuf);
}
void LogISLaunchAppsComponent(char *szComponentName)
{
char szBuf[MAX_BUF];
wsprintf(szBuf, " launching %s\n", szComponentName);
UpdateInstallStatusLog(szBuf);
}
void LogISLaunchAppsComponentUncompress(char *szComponentName, DWORD dwErr)
{
char szBuf[MAX_BUF];
wsprintf(szBuf, " uncompressing %s: %d\n", szComponentName, dwErr);
UpdateInstallStatusLog(szBuf);
}
void LogISProcessXpcomFile(int iStatus, int iResult)
{
char szBuf[MAX_BUF];
if(iStatus == LIS_SUCCESS)
wsprintf(szBuf, "\n Uncompressing Xpcom Succeeded: %d\n", iResult);
else
wsprintf(szBuf, "\n Uncompressing Xpcom Failed: %d\n", iResult);
UpdateInstallStatusLog(szBuf);
}
void LogISDiskSpace(dsN *dsnComponentDSRequirement)
{
ULONGLONG ullDSAvailable;
dsN *dsnTemp = NULL;
char szBuf[MAX_BUF];
char szDSRequired[MAX_BUF_TINY];
char szDSAvailable[MAX_BUF_TINY];
if(dsnComponentDSRequirement != NULL)
{
wsprintf(szBuf, "\n Disk Space Info:\n");
UpdateInstallStatusLog(szBuf);
dsnTemp = dsnComponentDSRequirement;
do
{
if(!dsnTemp)
break;
ullDSAvailable = GetDiskSpaceAvailable(dsnTemp->szVDSPath);
_ui64toa(ullDSAvailable, szDSAvailable, 10);
_ui64toa(dsnTemp->ullSpaceRequired, szDSRequired, 10);
wsprintf(szBuf,
" Path: %s\n Required: %sKB\n Available: %sKB\n",
dsnTemp->szVDSPath,
szDSRequired,
szDSAvailable);
UpdateInstallStatusLog(szBuf);
dsnTemp = dsnTemp->Next;
} while((dsnTemp != NULL) && (dsnTemp != dsnComponentDSRequirement));
}
}
void LogISTurboMode(BOOL bTurboMode)
{
char szBuf[MAX_BUF];
if(bTurboMode)
wsprintf(szBuf, "\n Turbo Mode: true\n");
else
wsprintf(szBuf, "\n Turbo Mode: false\n");
UpdateInstallStatusLog(szBuf);
}
void LogMSProductInfo(void)
{
char szBuf[MAX_BUF];
char szOSType[MAX_BUF_TINY];
GetOSTypeString(szOSType, sizeof(szOSType));
if(*gSystemInfo.szExtraString != '\0')
wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d,%s)",
sgProduct.szProductName,
sgProduct.szUserAgent,
szOSType,
gSystemInfo.dwMajorVersion,
gSystemInfo.dwMinorVersion,
gSystemInfo.dwBuildNumber,
gSystemInfo.szExtraString);
else
wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d)",
sgProduct.szProductName,
sgProduct.szUserAgent,
szOSType,
gSystemInfo.dwMajorVersion,
gSystemInfo.dwMinorVersion,
gSystemInfo.dwBuildNumber);
AppendToGlobalMessageStream(szBuf);
}
void LogMSDownloadProtocol(DWORD dwProtocolType)
{
char szMessageStream[MAX_BUF_TINY];
char szProtocolType[MAX_BUF];
switch(dwProtocolType)
{
case UP_HTTP:
lstrcpy(szProtocolType, "HTTP");
break;
default:
lstrcpy(szProtocolType, "FTP");
break;
}
wsprintf(szMessageStream, "&DownloadProtocol=%s", szProtocolType);
AppendToGlobalMessageStream(szMessageStream);
}
void LogMSDownloadStatus(int iDownloadStatus)
{
char szMessageStream[MAX_BUF_TINY];
wsprintf(szMessageStream, "&DownloadStatus=%d", iDownloadStatus);
AppendToGlobalMessageStream(szMessageStream);
gErrorMessageStream.bSendMessage = TRUE;
}
void LogMSDownloadFileStatus(void)
{
siC *siCObject = NULL;
DWORD dwIndex;
char szMessageStream[MAX_BUF];
ZeroMemory(szMessageStream, sizeof(szMessageStream));
dwIndex = 0;
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
while(siCObject)
{
if(siCObject->iNetRetries ||
siCObject->iCRCRetries ||
siCObject->iNetTimeOuts)
{
char szFileInfo[MAX_BUF_SMALL];
wsprintf(szFileInfo,
"&%s=%d,%d,%d",
siCObject->szArchiveName,
siCObject->iNetRetries,
siCObject->iCRCRetries,
siCObject->iNetTimeOuts);
lstrcat(szMessageStream, szFileInfo);
}
++dwIndex;
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
}
if(*szMessageStream != '\0')
AppendToGlobalMessageStream(szMessageStream);
}
void LogMSXPInstallStatus(char *szFile, int iErr)
{
char szMessageStream[MAX_BUF];
static BOOL bAlreadyLogged = FALSE;
if(bAlreadyLogged)
return;
if(szFile)
wsprintf(szMessageStream, "&XPInstallStatus=%d&XPInstallFile=%s", iErr, szFile);
else
wsprintf(szMessageStream, "&XPInstallStatus=%d", iErr);
AppendToGlobalMessageStream(szMessageStream);
bAlreadyLogged = TRUE;
if((iErr != E_REBOOT) &&
(((iErr == E_USER_CANCEL) &&
!gErrorMessageStream.bShowConfirmation) ||
((iErr != E_USER_CANCEL) &&
(iErr != WIZ_OK))))
gErrorMessageStream.bSendMessage = TRUE;
}
void LogMSTurboMode(BOOL bTurboMode)
{
char szMessageStream[MAX_BUF];
wsprintf(szMessageStream, "&TM=%d", bTurboMode);
AppendToGlobalMessageStream(szMessageStream);
}
/* Function: GetExitStatusLogFile()
* in: aProductName, aLogFileBufSize
* in/out: aLogFile
* purpose: To build the full filename of the exit log file
* located in the TEMP dir given aProductName.
*/
void GetExitStatusLogFile(LPSTR aProductName, LPSTR aLogFile, DWORD aLogFileBufSize)
{
char buf[MAX_BUF];
char logFilename[MAX_BUF];
if(!aProductName || !aLogFile)
return;
*aLogFile = '\0';
lstrcpy(buf, szOSTempDir);
MozCopyStr(szOSTempDir, buf, sizeof(buf));
AppendBackSlash(buf, sizeof(buf));
_snprintf(logFilename, sizeof(logFilename), SETUP_EXIT_STATUS_LOG, aProductName);
logFilename[sizeof(logFilename) - 1] = '\0';
_snprintf(aLogFile, aLogFileBufSize, "%s%s", buf, logFilename);
aLogFile[aLogFileBufSize - 1] = '\0';
}
/* Function: DeleteExitStatusFile()
* in: none.
* out: none
* purpose: To delete the setup's exit status file located in
* the TEMP dir.
*/
void DeleteExitStatusFile()
{
char logFile[MAX_BUF];
GetExitStatusLogFile(sgProduct.szProductNameInternal, logFile, sizeof(logFile));
if(FileExists(logFile))
DeleteFile(logFile);
}
/* Function: LogExitStatus()
* in: status to log.
* out: none
* purpose: To log the exit status of this setup. We're normally
* trying to log the need for a reboot.
*/
void LogExitStatus(LPSTR status)
{
char logFile[MAX_BUF];
GetExitStatusLogFile(sgProduct.szProductNameInternal, logFile, sizeof(logFile));
WritePrivateProfileString(SECTION_EXIT_STATUS, KEY_STATUS, status, logFile);
}
/* Function: GetGreSetupExitStatus()
* in: none
* out: aStatus - status read in from the exit status log file
* purpose: To read the exis status from the GRE setup that was run
* from within this setup.
*/
void GetGreSetupExitStatus(LPSTR aStatus, DWORD aStatusBufSize)
{
char logFile[MAX_BUF];
*aStatus = '\0';
GetExitStatusLogFile("GRE", logFile, sizeof(logFile));
if(FileExists(logFile))
GetPrivateProfileString(SECTION_EXIT_STATUS, KEY_STATUS, "", aStatus, aStatusBufSize, logFile);
}

Просмотреть файл

@ -0,0 +1,58 @@
/*
* 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 Navigator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape Communications Corp. are
* Copyright (C) 2001 Netscape Communications Corp. All Rights
* Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
*/
#ifndef _LOGGING_H_
#define _LOGGING_H_
int AppendToGlobalMessageStream(char *szInfo);
void LogISTime(int iType);
void LogISProductInfo(void);
void LogISDestinationPath(void);
void LogISSetupType(void);
void LogISComponentsSelected(void);
void LogISComponentsToDownload(void);
void LogISComponentsFailedCRC(char *szList, int iWhen);
void LogISDownloadStatus(char *szStatus, char *szFailedFile);
void LogISDownloadProtocol(DWORD dwProtocolType);
void LogISXPInstall(int iWhen);
void LogISXPInstallComponent(char *szComponentName);
void LogISXPInstallComponentResult(DWORD dwErrorNumber);
void LogISLaunchApps(int iWhen);
void LogISLaunchAppsComponent(char *szComponentName);
void LogISLaunchAppsComponentUncompress(char *szComponentName,
DWORD dwErr);
void LogISProcessXpcomFile(int iStatus, int iResult);
void LogISShared(void);
void LogISDiskSpace(dsN *dsnComponentDSRequirement);
void LogISTurboMode(BOOL bTurboMode);
void LogMSProductInfo(void);
void LogMSDownloadFileStatus(void);
void LogMSDownloadStatus(int iDownloadStatus);
void LogMSDownloadProtocol(DWORD dwProtocolType);
void LogMSXPInstallStatus(char *szFile, int iErr);
void LogMSTurboMode(BOOL bTurboMode);
void DeleteExitStatusFile(void);
void LogExitStatus(LPSTR status);
void GetGreSetupExitStatus(LPSTR aStatus, DWORD aStatusBufSize);
#endif /* _LOGGING_H_ */

Просмотреть файл

@ -0,0 +1,201 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
* Revision checked in on 01/03/30 by ssu@netscape.com, derived from:
* mozilla/xpcom/io/nsEscape.h
* mozilla/xpcom/io/nsEscape.cpp
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "extern.h"
#include "extra.h"
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include "nsEscape.h"
typedef int PRInt32;
const int netCharType[256] =
/* Bit 0 xalpha -- the alphas
** Bit 1 xpalpha -- as xalpha but
** converts spaces to plus and plus to %20
** Bit 3 ... path -- as xalphas but doesn't escape '/'
*/
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1x */
0,0,0,0,0,0,0,0,0,0,7,4,0,7,7,4, /* 2x !"#$%&'()*+,-./ */
7,7,7,7,7,7,7,7,7,7,0,0,0,7,0,0, /* 3x 0123456789:;<=>? */
0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 4x @ABCDEFGHIJKLMNO */
/* bits for '@' changed from 7 to 0 so '@' can be escaped */
/* in usernames and passwords in publishing. */
7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,7, /* 5X PQRSTUVWXYZ[\]^_ */
0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 6x `abcdefghijklmno */
7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0, /* 7X pqrstuvwxyz{\}~ DEL */
0, };
/* decode % escaped hex codes into character values
*/
#define UNHEX(C) \
((C >= '0' && C <= '9') ? C - '0' : \
((C >= 'A' && C <= 'F') ? C - 'A' + 10 : \
((C >= 'a' && C <= 'f') ? C - 'a' + 10 : 0)))
#define IS_OK(C) (netCharType[((unsigned int) (C))] & (mask))
#define HEX_ESCAPE '%'
//----------------------------------------------------------------------------------------
NS_COM char* nsEscape(const char * str, nsEscapeMask mask)
//----------------------------------------------------------------------------------------
{
if(!str)
return NULL;
return nsEscapeCount(str, lstrlen(str), mask, NULL);
}
//----------------------------------------------------------------------------------------
NS_COM char* nsEscapeCount(
const char * str,
PRInt32 len,
nsEscapeMask mask,
PRInt32* out_len)
//----------------------------------------------------------------------------------------
{
if (!str)
return 0;
int i, extra = 0;
char* hexChars = "0123456789ABCDEF";
register const unsigned char* src = (const unsigned char *) str;
for (i = 0; i < len; i++)
{
if (!IS_OK(*src++))
extra += 2; /* the escape, plus an extra byte for each nibble */
}
char* result = (char *)NS_GlobalAlloc(len + extra + 1);
if (!result)
return 0;
register unsigned char* dst = (unsigned char *) result;
src = (const unsigned char *) str;
if (mask == url_XPAlphas)
{
for (i = 0; i < len; i++)
{
unsigned char c = *src++;
if (IS_OK(c))
*dst++ = c;
else if (c == ' ')
*dst++ = '+'; /* convert spaces to pluses */
else
{
*dst++ = HEX_ESCAPE;
*dst++ = hexChars[c >> 4]; /* high nibble */
*dst++ = hexChars[c & 0x0f]; /* low nibble */
}
}
}
else
{
for (i = 0; i < len; i++)
{
unsigned char c = *src++;
if (IS_OK(c))
*dst++ = c;
else
{
*dst++ = HEX_ESCAPE;
*dst++ = hexChars[c >> 4]; /* high nibble */
*dst++ = hexChars[c & 0x0f]; /* low nibble */
}
}
}
*dst = '\0'; /* tack on eos */
if(out_len)
*out_len = dst - (unsigned char *) result;
return result;
}
//----------------------------------------------------------------------------------------
NS_COM char* nsUnescape(char * str)
//----------------------------------------------------------------------------------------
{
nsUnescapeCount(str);
return str;
}
//----------------------------------------------------------------------------------------
NS_COM PRInt32 nsUnescapeCount(char * str)
//----------------------------------------------------------------------------------------
{
register char *src = str;
register char *dst = str;
while (*src)
if (*src != HEX_ESCAPE)
*dst++ = *src++;
else
{
src++; /* walk over escape */
if (*src)
{
*dst = UNHEX(*src) << 4;
src++;
}
if (*src)
{
*dst = (*dst + UNHEX(*src));
src++;
}
dst++;
}
*dst = 0;
return (int)(dst - str);
} /* NET_UnEscapeCnt */

Просмотреть файл

@ -0,0 +1,82 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
* Revision checked in on 01/03/22 by ssu@netscape.com, derived from:
* mozilla/xpcom/io/nsEscape.h
* mozilla/xpcom/io/nsEscape.cpp
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _ESCAPE_H_
#define _ESCAPE_H_
#define NS_COM
#define PRUnichar char
/* valid mask values for NET_Escape() and NET_EscapedSize(). */
typedef enum {
url_XAlphas = (1<<0)
, url_XPAlphas = (1<<1)
, url_Path = (1<<2)
} nsEscapeMask;
#ifdef __cplusplus
extern "C" {
#endif
NS_COM char * nsEscape(const char * str, nsEscapeMask mask);
/* Caller must use nsCRT::free() on the result */
NS_COM char * nsUnescape(char * str);
/* decode % escaped hex codes into character values,
* modifies the parameter, returns the same buffer
*/
NS_COM char * nsEscapeCount(const char * str, PRInt32 len, nsEscapeMask mask, PRInt32* out_len);
/* Like nsEscape, but if out_len is non-null, return result string length
* in *out_len, and uses len instead of NUL termination.
* Caller must use nsCRT::free() on the result.
*/
NS_COM PRInt32 nsUnescapeCount (char * str);
/* decode % escaped hex codes into character values,
* modifies the parameter buffer, returns the length of the result
* (result may contain \0's).
*/
#ifdef __cplusplus
}
#endif
#endif // _ESCAPE_H_

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,48 @@
/* -*- 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
#define IDS_ERROR_OUTOFMEMORY 6
// 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

Просмотреть файл

@ -0,0 +1,215 @@
/* -*- 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;
LPSTR szEGlobalAlloc;
LPSTR szEStringLoad;
LPSTR szEDllLoad;
LPSTR szEStringNull;
LPSTR szTempSetupPath;
LPSTR szEOutOfMemory;
LPSTR szSetupDir;
LPSTR szTempDir;
LPSTR szOSTempDir;
LPSTR szFileIniConfig;
LPSTR szFileIniInstall;
LPSTR szSiteSelectorDescription;
DWORD dwWizardState;
DWORD dwSetupType;
DWORD dwTempSetupType;
DWORD gdwUpgradeValue;
DWORD gdwSiteSelectorStatus;
BOOL bSDUserCanceled;
BOOL bIdiArchivesExists;
BOOL bCreateDestinationDir;
BOOL bReboot;
BOOL gbILUseTemp;
BOOL gbPreviousUnfinishedDownload;
BOOL gbPreviousUnfinishedInstallXpi;
BOOL gbIgnoreRunAppX;
BOOL gbIgnoreProgramFolderX;
BOOL gbRestrictedAccess;
BOOL gbDownloadTriggered;
BOOL gbAllowMultipleInstalls = FALSE;
BOOL gbForceInstall = FALSE;
BOOL gbForceInstallGre = FALSE;
BOOL gShowBannerImage = TRUE;
setupGen sgProduct;
diS diSetup;
diW diWelcome;
diL diLicense;
diQL diQuickLaunch;
diST diSetupType;
diSC diSelectComponents;
diSC diSelectAdditionalComponents;
diWI diWindowsIntegration;
diPF diProgramFolder;
diDO diAdditionalOptions;
diAS diAdvancedSettings;
diSI diStartInstall;
diD diDownload;
diR diReboot;
siSD siSDObject;
siCF siCFXpcomFile;
siC *siComponents;
ssi *ssiSiteSelector;
installGui sgInstallGui;
sems gErrorMessageStream;
sysinfo gSystemInfo;
dsN *gdsnComponentDSRequirement = NULL;
/* 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",
"install.ini",
"license.txt",
""};
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];
int iRv = WIZ_OK;
HWND hwndFW;
if(!hPrevInstance)
{
if(InitSetupGeneral())
PostQuitMessage(1);
else if(ParseForStartupOptions(lpszCmdLine))
PostQuitMessage(1);
else if(((hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL ||
((hwndFW = FindWindow(CLASS_NAME_SETUP, NULL)) != NULL)) &&
!gbAllowMultipleInstalls)
{
/* Allow only one instance of setup to run.
* Detect a previous instance of setup, bring it to the
* foreground, and quit current instance */
ShowWindow(hwndFW, SW_RESTORE);
SetForegroundWindow(hwndFW);
iRv = WIZ_SETUP_ALREADY_RUNNING;
PostQuitMessage(1);
}
else if(Initialize(hInstance))
PostQuitMessage(1);
else if(!InitApplication(hInstance, hSetupRscInst))
{
char szEFailed[MAX_BUF];
if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
{
wsprintf(szBuf, szEFailed, "InitApplication().");
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
else if(!InitInstance(hInstance, nCmdShow))
{
char szEFailed[MAX_BUF];
if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
{
wsprintf(szBuf, szEFailed, "InitInstance().");
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
else if(GetInstallIni())
{
PostQuitMessage(1);
}
else if(ParseInstallIni())
{
PostQuitMessage(1);
}
else if(GetConfigIni())
{
PostQuitMessage(1);
}
else if(ParseConfigIni(lpszCmdLine))
{
PostQuitMessage(1);
}
else
{
DlgSequence(NEXT_DLG);
}
}
while(GetMessage(&msg, NULL, 0, 0))
{
if((!IsDialogMessage(hDlgCurrent, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
if(iRv != WIZ_SETUP_ALREADY_RUNNING)
/* Do clean up before exiting from the application */
DeInitialize();
/* garbage collection */
DeInitSetupGeneral();
return(msg.wParam);
} /* End of WinMain */

Просмотреть файл

@ -0,0 +1,655 @@
/* -*- 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 /* __cplusplus */
#define PR_BEGIN_EXTERN_C
#define PR_END_EXTERN_C
#endif /* __cplusplus */
#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"
#define DEFAULT_SETUP_WINDOW_NAME "Setup"
/* Class name for the invisible window to be created */
#define CLASS_NAME_SETUP "MozillaSetup"
#define CLASS_NAME_SETUP_DLG "MozillaSetupDlg"
#define FILE_INI_SETUP "setup.ini"
#define FILE_INI_CONFIG "config.ini"
#define FILE_INI_INSTALL "install.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 FILE_WGET_LOG "wget.log"
#define WIZ_TEMP_DIR "ns_temp"
#define FILE_INSTALL_LOG "install_wizard.log"
#define FILE_INSTALL_STATUS_LOG "install_status.log"
#define FILE_ALL_JS "all-proxy.js"
#define VR_DEFAULT_PRODUCT_NAME "Mozilla"
#define FORCE_ADD_TO_UNINSTALL_LOG TRUE
#define DO_NOT_FORCE_ADD_TO_UNINSTALL_LOG FALSE
/* defines that indicate whether something should
* be logged to the install_wizardX.log or not
* for uninstallation purposes.
*/
#define ADD_TO_UNINSTALL_LOG TRUE
#define DO_NOT_ADD_TO_UNINSTALL_LOG FALSE
/* defines that indeicate whether an install command
* should have '*dnu*' prepended. '*dnu*' is parsed
* by the uninstaller and signals that the specific
* install command should _not_ be undone.
*/
#define DNU_UNINSTALL FALSE
#define DNU_DO_NOT_UNINSTALL TRUE
#define WINREG_OVERWRITE_KEY TRUE
#define WINREG_DO_NOT_OVERWRITE_KEY FALSE
#define WINREG_OVERWRITE_NAME TRUE
#define WINREG_DO_NOT_OVERWRITE_NAME FALSE
#define INCLUDE_INVISIBLE_OBJS TRUE
#define SKIP_INVISIBLE_OBJS FALSE
#define NO_BANNER_IMAGE 0x00000000
#define BANNER_IMAGE_DOWNLOAD 0x00000001
#define BANNER_IMAGE_INSTALLING 0x00000002
#define APPPATH_GRE_PATH_SET 0x00000000
#define APPPATH_GRE_PATH_NOT_SET 0x00000001
#define APPPATH_GRE_PATH_ALREADY_SET 0x00000002
#define NEXT_DLG 1
#define PREV_DLG 2
#define OTHER_DLG_1 3
#define MAX_CRC_FAILED_DOWNLOAD_RETRIES 5
#define MAX_FILE_DOWNLOAD_RETRIES 10
#define STATUS_DISABLED 0
#define STATUS_ENABLED 1
#define GRE_SETUP_DIR_NAME "Setup GRE"
/* filename which contains this product setup's exit status */
#define SETUP_EXIT_STATUS_LOG "%s Setup Exit Status.log"
/* LOCAL GRE defines */
#define GRE_TYPE_NOT_SET -1
#define GRE_SHARED 0
#define GRE_LOCAL 1
/* WS: WinSpawn wait values */
#define WS_DO_NOT_WAIT FALSE
#define WS_WAIT TRUE
#define MAX_KILL_PROCESS_RETRIES 10
/* CI: Check Instance */
#define CI_FORCE_QUIT_PROCESS TRUE
#define CI_CLOSE_PROCESS FALSE
#define BAR_MARGIN 1
#define BAR_SPACING 0
#define BAR_WIDTH 6
#define BAR_LIBXPNET_MARGIN 1
#define BAR_LIBXPNET_SPACING 0
#define BAR_LIBXPNET_WIDTH 1
/* W: When for install status logging */
#define W_START 0
#define W_END 1
/* W: When for crc check failed logging */
#define W_STARTUP 0
#define W_DOWNLOAD 1
/* UP: Use Protocol */
#define UP_FTP 0
#define UP_HTTP 1
/* RA: Restricted Access */
#define RA_IGNORE 0
#define RA_ONLY_RESTRICTED 1
#define RA_ONLY_NONRESTRICTED 2
/* LIS: Log Install Status */
#define LIS_SUCCESS 0
#define LIS_FAILURE 1
/* UG: Upgrade */
#define UG_NONE 0
#define UG_DELETE 1
#define UG_IGNORE 2
#define UG_GOBACK 3
/* AP: Archive Path */
#define AP_NOT_FOUND 0
#define AP_TEMP_PATH 1
#define AP_SETUP_PATH 2
#define AP_ALTERNATE_PATH 3
/* PP: Parse Path */
#define PP_FILENAME_ONLY 1
#define PP_PATH_ONLY 2
#define PP_ROOT_ONLY 3
#define PP_EXTENSION_ONLY 4
/* DA: Delete Archive */
#define DA_ONLY_IF_IN_ARCHIVES_LST 1
#define DA_ONLY_IF_NOT_IN_ARCHIVES_LST 2
#define DA_IGNORE_ARCHIVES_LST 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 T_PRE_ARCHIVE 10
#define T_POST_ARCHIVE 11
#define MAX_BUF 2048
#define MAX_BUF_TINY 256
#define MAX_BUF_SMALL 512
#define MAX_BUF_MEDIUM 1024
#define MAX_BUF_LARGE MAX_BUF
#define MAX_BUF_XLARGE 4096
#define MAX_ITOA 46
#define MAX_INI_SK 128
#define ERROR_CODE_HIDE 0
#define ERROR_CODE_SHOW 1
#define DLG_NONE 0
#define DLG_COMMIT_INSTALL 1
#define CX_CHECKBOX 13
#define CY_CHECKBOX 13
/* WIZ: WIZARD defines */
#define WIZ_OK 0
#define WIZ_ERROR_UNDEFINED 1024
#define WIZ_MEMORY_ALLOC_FAILED 1025
#define WIZ_OUT_OF_MEMORY WIZ_MEMORY_ALLOC_FAILED
#define WIZ_ARCHIVES_MISSING 1026
#define WIZ_CRC_PASS WIZ_OK
#define WIZ_CRC_FAIL 1028
#define WIZ_SETUP_ALREADY_RUNNING 1029
#define WIZ_TOO_MANY_NETWORK_ERRORS 1030
#define WIZ_ERROR_PARSING_INTERNAL_STR 1031
#define WIZ_ERROR_REGKEY 1032
#define WIZ_ERROR_INIT 1033
#define WIZ_ERROR_LOADING_RESOURCE_LIB 1034
#define WIZ_ERROR_CREATE_DIRECTORY 1035
/* E: Errors */
#define E_REBOOT 999
/* 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
#define FO_ERROR_WRITE 4
#define FO_ERROR_INCR_EXCEEDS_LIMIT 5
/* Mode of Setup to run in */
#define NOT_SET -1
#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 0x00000001
#define SIC_INVISIBLE 0x00000002
#define SIC_LAUNCHAPP 0x00000004
#define SIC_DOWNLOAD_REQUIRED 0x00000008
#define SIC_DOWNLOAD_ONLY 0x00000010
#define SIC_ADDITIONAL 0x00000020
#define SIC_DISABLED 0x00000040
#define SIC_FORCE_UPGRADE 0x00000080
#define SIC_IGNORE_DOWNLOAD_ERROR 0x00000100
#define SIC_IGNORE_XPINSTALL_ERROR 0x00000200
#define SIC_UNCOMPRESS 0x00000400
#define SIC_SUPERSEDE 0x00000800
/* 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 0x00000001
#define OS_WIN95_DEBUTE 0x00000002
#define OS_WIN95 0x00000004
#define OS_WIN98 0x00000008
#define OS_NT 0x00000010
#define OS_NT3 0x00000020
#define OS_NT4 0x00000040
#define OS_NT5 0x00000080
#define OS_NT50 0x00000100
#define OS_NT51 0x00000200
/* DSR: Disk Space Required */
#define DSR_DESTINATION 0
#define DSR_SYSTEM 1
#define DSR_TEMP 2
#define DSR_DOWNLOAD_SIZE 3
/* SS: Site Selector */
#define SS_HIDE 0
#define SS_SHOW 1
/* PUS: Previous Unfinished State */
#define PUS_NONE 0
#define PUS_DOWNLOAD 1
#define PUS_UNPACK_XPCOM 2
#define PUS_INSTALL_XPI 3
#define SETUP_STATE_DOWNLOAD "downloading"
#define SETUP_STATE_UNPACK_XPCOM "unpacking xpcom"
#define SETUP_STATE_INSTALL_XPI "installing xpi"
#define SETUP_STATE_REMOVING_PREV_INST "removing previous installation"
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 dlgQuickLaunch
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szMessage1;
LPSTR szMessage2;
BOOL bTurboMode;
BOOL bTurboModeEnabled;
} diQL;
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 dlgAdditionalOptions
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szMessage1;
BOOL bSaveInstaller;
BOOL bRecaptureHomepage;
BOOL bShowHomepageOption;
DWORD dwUseProtocol;
BOOL bUseProtocolSettings;
BOOL bShowProtocols;
} diDO;
typedef struct dlgAdvancedSettings
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szProxyServer;
LPSTR szProxyPort;
LPSTR szProxyUser;
LPSTR szProxyPasswd;
} diAS;
typedef struct dlgStartInstall
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessageInstall;
LPSTR szMessageDownload;
} diSI;
typedef struct dlgDownload
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessageDownload0;
LPSTR szMessageRetry0;
} diD;
typedef struct dlgReboot
{
DWORD dwShowDialog;
LPSTR szTitle;
} diR;
typedef struct setupStruct
{
int mode;
int greType;
DWORD dwCustomType;
DWORD dwNumberOfComponents;
LPSTR szPath;
LPSTR szSubPath;
LPSTR szProgramName;
LPSTR szCompanyName;
LPSTR szProductName;
LPSTR szProductNameInternal;
LPSTR szProductNamePrevious;
LPSTR szUninstallFilename;
LPSTR szUserAgent;
LPSTR szProgramFolderName;
LPSTR szProgramFolderPath;
LPSTR szAlternateArchiveSearchPath;
LPSTR szParentProcessFilename;
BOOL bLockPath;
BOOL bSharedInst;
BOOL bInstallFiles;
BOOL checkCleanupOnUpgrade;
BOOL doCleanupOnUpgrade;
LPSTR szAppID;
LPSTR szAppPath;
LPSTR szRegPath;
BOOL greCleanupOrphans;
char greCleanupOrphansMessage[MAX_BUF];
char greID[MAX_BUF];
char grePrivateKey[MAX_BUF];
} 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;
BOOL bStatus;
ULONGLONG ullInstallSize;
} siCF;
typedef struct sinfoComponentDep siCD;
struct sinfoComponentDep
{
LPSTR szDescriptionShort;
LPSTR szReferenceName;
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 szArchiveNameUncompressed;
LPSTR szArchivePath;
LPSTR szDestinationPath;
LPSTR szDescriptionShort;
LPSTR szDescriptionLong;
LPSTR szParameter;
LPSTR szReferenceName;
BOOL bForceUpgrade;
BOOL bSupersede;
int iNetRetries;
int iCRCRetries;
int iNetTimeOuts;
siCD *siCDDependencies;
siCD *siCDDependees;
siC *Next;
siC *Prev;
};
typedef struct ssInfo ssi;
struct ssInfo
{
LPSTR szDescription;
LPSTR szDomain;
LPSTR szIdentifier;
ssi *Next;
ssi *Prev;
};
typedef struct dlgInstall
{
HFONT systemFont;
HFONT definedFont;
char szFontName[MAX_BUF];
char szFontSize[MAX_BUF];
char szCharSet[MAX_BUF];
char szOk_[MAX_BUF];
char szOk[MAX_BUF];
char szCancel_[MAX_BUF];
char szCancel[MAX_BUF];
char szNext_[MAX_BUF];
char szBack_[MAX_BUF];
char szIgnore_[MAX_BUF];
char szProxySettings_[MAX_BUF];
char szProxySettings[MAX_BUF];
char szServer[MAX_BUF];
char szPort[MAX_BUF];
char szUserId[MAX_BUF];
char szPassword[MAX_BUF];
char szSelectDirectory[MAX_BUF];
char szDirectories_[MAX_BUF];
char szDrives_[MAX_BUF];
char szStatus[MAX_BUF];
char szFile[MAX_BUF];
char szUrl[MAX_BUF];
char szTo[MAX_BUF];
char szAccept_[MAX_BUF];
char szDecline_[MAX_BUF];
char szProgramFolder_[MAX_BUF];
char szExistingFolder_[MAX_BUF];
char szSetupMessage[MAX_BUF];
char szRestart[MAX_BUF];
char szYesRestart[MAX_BUF];
char szNoRestart[MAX_BUF];
char szAdditionalComponents_[MAX_BUF];
char szDescription[MAX_BUF];
char szTotalDownloadSize[MAX_BUF];
char szSpaceAvailable[MAX_BUF];
char szComponents_[MAX_BUF];
char szDestinationDirectory[MAX_BUF];
char szBrowse_[MAX_BUF];
char szCurrentSettings[MAX_BUF];
char szInstall_[MAX_BUF];
char szDelete_[MAX_BUF];
char szContinue_[MAX_BUF];
char szSkip_[MAX_BUF];
char szExtracting[MAX_BUF];
char szReadme_[MAX_BUF];
char szPause_[MAX_BUF];
char szResume_[MAX_BUF];
char szChecked[MAX_BUF];
char szUnchecked[MAX_BUF];
} installGui;
/* structure message stream */
typedef struct sEMsgStream sems;
struct sEMsgStream
{
char szURL[MAX_BUF];
char szConfirmationMessage[MAX_BUF];
char *szMessage;
DWORD dwMessageBufSize;
BOOL bEnabled;
BOOL bSendMessage;
BOOL bShowConfirmation;
};
/* structure system info*/
typedef struct sSysInfo sysinfo;
struct sSysInfo
{
DWORD dwOSType;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
char szExtraString[MAX_BUF];
DWORD dwMemoryTotalPhysical;
DWORD dwMemoryAvailablePhysical;
DWORD dwScreenX;
DWORD dwScreenY;
DWORD lastWindowPosCenterX;
DWORD lastWindowPosCenterY;
BOOL bScreenReader;
BOOL bRefreshIcons;
};
typedef struct diskSpaceNode dsN;
struct diskSpaceNode
{
ULONGLONG ullSpaceRequired;
LPSTR szPath;
LPSTR szVDSPath;
dsN *Next;
dsN *Prev;
};
#endif /* _SETUP_H */

Двоичные данные
toolkit/mozapps/installer/windows/wizard/setup/setup.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Просмотреть файл

Просмотреть файл

@ -0,0 +1,157 @@
/* -*- 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,2
PRODUCTVERSION 1,0,0,2
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", "mozilla.org\0"
VALUE "FileDescription", "setup\0"
VALUE "FileVersion", "1, 0, 0, 2\0"
VALUE "InternalName", "setup\0"
VALUE "LegalCopyright", "Copyright © 2001\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "setup.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Mozilla Setup\0"
VALUE "ProductVersion", "1, 0, 0, 2\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."
IDS_ERROR_OUTOFMEMORY "Out of memory"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Просмотреть файл

@ -0,0 +1,93 @@
/* -*- 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);
// Do not set the description at this time. We need to fix this
// parameter so it can be passed in independent of the shortcut name
// itself. Comment this code out for now until a real fix can be done.
// 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;
}

Просмотреть файл

@ -0,0 +1,43 @@
/* -*- 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

Просмотреть файл

@ -0,0 +1,467 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Communicator.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 2003
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "setup.h"
#include "extern.h"
#include "extra.h"
#include "ifuncns.h"
#include "supersede.h"
void SaveGreInfo(grever *aGreInstalledListTmp, greInfo* aGre);
void ResolveSupersedeGre(siC *siCObject, greInfo *aGre);
HRESULT GetGreSupersedeVersionList(siC *siCObject, grever **aGreSupersedeList);
HRESULT GetGreInstalledVersionList(siC *siCObject, grever **aGreInstalledList);
grever *CreateGVerNode()
{
grever *gverNode;
if((gverNode = NS_GlobalAlloc(sizeof(struct structGreVer))) == NULL)
return(NULL);
gverNode->greHomePath[0] = '\0';
gverNode->greInstaller[0] = '\0';
gverNode->greUserAgent[0] = '\0';
gverNode->version.ullMajor = 0;
gverNode->version.ullMinor = 0;
gverNode->version.ullRelease = 0;
gverNode->version.ullBuild = 0;
gverNode->next = NULL;
return(gverNode);
}
void DeleteGverList(grever *gverHead)
{
grever *tmp;
while(gverHead != NULL)
{
tmp = gverHead;
gverHead = gverHead->next;
FreeMemory(&tmp);
}
}
/* function to build a linked list of GRE supersede versions */
HRESULT GetGreSupersedeVersionList(siC *siCObject, grever **aGreSupersedeList)
{
grever *gverTmp = NULL;
grever *gverTail = NULL;
char key[MAX_BUF_TINY];
char versionString[MAX_BUF_TINY];
DWORD index;
if(*aGreSupersedeList)
/* list already built, just return */
return(WIZ_OK);
index = 0;
wsprintf(key, "SupersedeVersion%d", index);
GetPrivateProfileString(siCObject->szReferenceName, key, "", versionString,
sizeof(versionString), szFileIniConfig);
while(*versionString != '\0')
{
gverTmp = CreateGVerNode();
if(!gverTmp)
// error has already been displayed.
exit(WIZ_OUT_OF_MEMORY);
TranslateVersionStr(versionString, &gverTmp->version);
if(*aGreSupersedeList == NULL)
{
/* brand new list */
*aGreSupersedeList = gverTmp;
gverTail = *aGreSupersedeList;
}
else if(gverTail)
{
/* append the new node to the end of the list */
gverTail->next = gverTmp;
gverTail = gverTail->next;
}
wsprintf(key, "SupersedeVersion%d", ++index);
GetPrivateProfileString(siCObject->szReferenceName, key, "", versionString,
sizeof(versionString), szFileIniConfig);
}
return(WIZ_OK);
}
/* function to build a list of GRE's installed on the local system */
HRESULT GetGreInstalledVersionList(siC *siCObject, grever **aGreInstalledList)
{
DWORD index;
DWORD enumIndex;
DWORD greVersionKeyLen;
grever *gverTmp = NULL;
grever *gverTail = NULL;
char szSupersedeWinRegPath[MAX_BUF];
char key[MAX_BUF_TINY];
char greVersionKey[MAX_BUF_TINY];
char subKey[MAX_BUF];
char subKeyInstaller[MAX_BUF];
char szBuf[MAX_BUF];
char greXpcomPath[MAX_BUF];
char greXpcomFile[MAX_BUF];
int greXpcomPathLen;
char xpcomFilename[] = "xpcom.dll";
char greKeyPath[MAX_BUF];
verBlock vbInstalledVersion;
HKEY hkeyRoot = NULL;
HKEY hkGreKeyParentPath = NULL;
HKEY hkGreKeyPath = NULL;
LONG rv;
if(*aGreInstalledList)
/* list already built, just return */
return(WIZ_OK);
index = 0;
wsprintf(key, "SupersedeWinReg%d", index);
GetPrivateProfileString(siCObject->szReferenceName, key, "", szSupersedeWinRegPath,
sizeof(szSupersedeWinRegPath), szFileIniConfig);
while(*szSupersedeWinRegPath != '\0')
{
BOOL skip = FALSE;
if(!GetKeyInfo(szSupersedeWinRegPath, szBuf, sizeof(szBuf), KEY_INFO_ROOT))
// Malformed windows registry key, continue to reading the next key.
skip = TRUE;
hkeyRoot = ParseRootKey(szBuf);
if(!GetKeyInfo(szSupersedeWinRegPath, subKey, sizeof(subKey), KEY_INFO_SUBKEY))
// Malformed windows registry key, continue to reading the next key.
skip = TRUE;
if(RegOpenKeyEx(hkeyRoot, subKey, 0, KEY_READ, &hkGreKeyParentPath) != ERROR_SUCCESS)
// Problems opening the registry key. Ignore and continue reading the next key.
skip = TRUE;
greVersionKeyLen = sizeof(greVersionKey);
enumIndex = 0;
while(!skip &&
(RegEnumKeyEx(hkGreKeyParentPath, enumIndex++, greVersionKey, &greVersionKeyLen,
NULL, NULL, NULL, NULL) != ERROR_NO_MORE_ITEMS))
{
sprintf(greKeyPath, "%s\\%s", subKey, greVersionKey);
if(RegOpenKeyEx(hkeyRoot, greKeyPath, 0, KEY_READ, &hkGreKeyPath) != ERROR_SUCCESS)
// Encoutered problems trying to open key. Just continue.
// We don't care about any errors. If we can't open the key,
// we just go on to other keys. These errors are nonfatal.
continue;
greXpcomPathLen = sizeof(greXpcomPath);
rv = RegQueryValueEx(hkGreKeyPath, "GreHome", 0, NULL, (BYTE *)greXpcomPath, &greXpcomPathLen);
RegCloseKey(hkGreKeyPath);
if(rv != ERROR_SUCCESS)
// Encoutered problems trying to read a var name. Just continue.
// We don't care about any errors. If we can't open the key,
// we just go on to other keys. These errors are nonfatal.
continue;
if(MozCopyStr(greXpcomPath, greXpcomFile, sizeof(greXpcomFile)))
{
RegCloseKey(hkGreKeyParentPath);
PrintError(szEOutOfMemory, ERROR_CODE_HIDE);
exit(WIZ_OUT_OF_MEMORY);
}
if(sizeof(greXpcomFile) <= lstrlen(greXpcomFile) + sizeof(xpcomFilename) + 1)
{
RegCloseKey(hkGreKeyParentPath);
PrintError(szEOutOfMemory, ERROR_CODE_HIDE);
exit(WIZ_OUT_OF_MEMORY);
}
AppendBackSlash(greXpcomFile, sizeof(greXpcomFile));
lstrcat(greXpcomFile, xpcomFilename);
if(GetFileVersion(greXpcomFile, &vbInstalledVersion))
{
// Don't create a node list unless xpcom.dll file actually exists.
gverTmp = CreateGVerNode();
if(!gverTmp)
{
RegCloseKey(hkGreKeyParentPath);
// error has already been displayed.
exit(WIZ_OUT_OF_MEMORY);
}
if(MozCopyStr(greXpcomPath, gverTmp->greHomePath, sizeof(gverTmp->greHomePath)))
{
RegCloseKey(hkGreKeyParentPath);
PrintError(szEOutOfMemory, ERROR_CODE_HIDE);
exit(WIZ_OUT_OF_MEMORY);
}
gverTmp->version.ullMajor = vbInstalledVersion.ullMajor;
gverTmp->version.ullMinor = vbInstalledVersion.ullMinor;
gverTmp->version.ullRelease = vbInstalledVersion.ullRelease;
gverTmp->version.ullBuild = vbInstalledVersion.ullBuild;
if(*aGreInstalledList == NULL)
{
/* brand new list */
*aGreInstalledList = gverTmp;
gverTail = *aGreInstalledList;
}
else if(gverTail)
{
/* append the new node to the end of the list */
gverTail->next = gverTmp;
gverTail = gverTail->next;
}
/* get the GRE's installer app path */
sprintf(subKeyInstaller, "%s\\%s\\Installer", subKey, greVersionKey);
GetWinReg(hkeyRoot, subKeyInstaller, "PathToExe", gverTmp->greInstaller, sizeof(gverTmp->greInstaller));
MozCopyStr(greVersionKey, gverTmp->greUserAgent, sizeof(gverTmp->greUserAgent));
}
greVersionKeyLen = sizeof(greVersionKey);
}
if(hkGreKeyParentPath)
{
RegCloseKey(hkGreKeyParentPath);
hkGreKeyParentPath = NULL;
}
++index;
wsprintf(key, "SupersedeWinReg%d", index);
GetPrivateProfileString(siCObject->szReferenceName, key, "", szSupersedeWinRegPath, sizeof(szSupersedeWinRegPath), szFileIniConfig);
}
return(WIZ_OK);
}
void SaveGreInfo(grever *aGreInstalledListTmp, greInfo* aGre)
{
MozCopyStr(aGreInstalledListTmp->greInstaller, aGre->installerAppPath, sizeof(aGre->installerAppPath));
MozCopyStr(aGreInstalledListTmp->greUserAgent, aGre->userAgent, sizeof(aGre->userAgent));
MozCopyStr(aGreInstalledListTmp->greHomePath, aGre->homePath, sizeof(aGre->homePath));
}
void ResolveSupersedeGre(siC *siCObject, greInfo *aGre)
{
grever *greSupersedeListTmp = NULL;
grever *greInstalledListTmp = NULL;
char versionStr[MAX_BUF_TINY];
siC *siCTmp = NULL;
BOOL foundVersionWithinRange = FALSE;
BOOL minVerRead = FALSE;
BOOL maxVerRead = FALSE;
BOOL stillInRange = FALSE;
if(GetGreSupersedeVersionList(siCObject, &aGre->greSupersedeList))
return;
if(GetGreInstalledVersionList(siCObject, &aGre->greInstalledList))
return;
if(!aGre->greSupersedeList || !aGre->greInstalledList)
// nothing to compare, return
return;
GetPrivateProfileString(siCObject->szReferenceName, "SupersedeMinVersion", "",
versionStr, sizeof(versionStr), szFileIniConfig);
if(*versionStr != '\0')
{
TranslateVersionStr(versionStr, &aGre->minVersion);
minVerRead = TRUE;
}
GetPrivateProfileString(siCObject->szReferenceName, "SupersedeMaxVersion", "",
versionStr, sizeof(versionStr), szFileIniConfig);
if(*versionStr != '\0')
{
TranslateVersionStr(versionStr, &aGre->maxVersion);
maxVerRead = TRUE;
}
// do the version comparison here.
greInstalledListTmp = aGre->greInstalledList;
while(greInstalledListTmp)
{
greSupersedeListTmp = aGre->greSupersedeList;
while(greSupersedeListTmp)
{
if(CompareVersion(greInstalledListTmp->version, greSupersedeListTmp->version) == 0)
{
SaveGreInfo(greInstalledListTmp, aGre);
siCObject->bSupersede = TRUE;
aGre->siCGreComponent = siCObject;
break;
}
else if(!foundVersionWithinRange && (minVerRead || maxVerRead))
{
stillInRange = TRUE;
if(minVerRead)
stillInRange = CompareVersion(greInstalledListTmp->version, aGre->minVersion) >= 0;
if(stillInRange && maxVerRead)
stillInRange = CompareVersion(greInstalledListTmp->version, aGre->maxVersion) <= 0;
if(stillInRange)
{
// Find the first version within the range.
SaveGreInfo(greInstalledListTmp, aGre);
foundVersionWithinRange = TRUE;
}
}
greSupersedeListTmp = greSupersedeListTmp->next;
}
if(siCObject->bSupersede)
break;
greInstalledListTmp = greInstalledListTmp->next;
}
if(!siCObject->bSupersede && foundVersionWithinRange)
siCObject->bSupersede = TRUE;
if(siCObject->bSupersede)
{
siCObject->dwAttributes &= ~SIC_SELECTED;
siCObject->dwAttributes |= SIC_DISABLED;
siCObject->dwAttributes |= SIC_INVISIBLE;
}
else
/* Make sure to unset the DISABLED bit. If the Setup Type is other than
* Custom, then we don't care if it's DISABLED or not because this flag
* is only used in the Custom dialogs.
*
* If the Setup Type is Custom and this component is DISABLED by default
* via the config.ini, it's default value will be restored in the
* SiCNodeSetItemsSelected() function that called ResolveSupersede(). */
siCObject->dwAttributes &= ~SIC_DISABLED;
}
BOOL ResolveSupersede(siC *siCObject, greInfo *aGre)
{
DWORD dwIndex;
char szFilePath[MAX_BUF];
char szSupersedeFile[MAX_BUF];
char szSupersedeVersion[MAX_BUF];
char szType[MAX_BUF_TINY];
char szKey[MAX_BUF_TINY];
verBlock vbVersionNew;
verBlock vbFileVersion;
siCObject->bSupersede = FALSE;
if(siCObject->dwAttributes & SIC_SUPERSEDE)
{
dwIndex = 0;
GetPrivateProfileString(siCObject->szReferenceName, "SupersedeType", "", szType, sizeof(szType), szFileIniConfig);
if(*szType !='\0')
{
if(lstrcmpi(szType, "File Exists") == 0)
{
wsprintf(szKey, "SupersedeFile%d", dwIndex);
GetPrivateProfileString(siCObject->szReferenceName, szKey, "", szSupersedeFile, sizeof(szSupersedeFile), szFileIniConfig);
while(*szSupersedeFile != '\0')
{
DecryptString(szFilePath, szSupersedeFile);
if(FileExists(szFilePath))
{
wsprintf(szKey, "SupersedeMinVersion%d",dwIndex);
GetPrivateProfileString(siCObject->szReferenceName, szKey, "", szSupersedeVersion, sizeof(szSupersedeVersion), szFileIniConfig);
if(*szSupersedeVersion != '\0')
{
if(GetFileVersion(szFilePath,&vbFileVersion))
{
/* If we can get the version, and it is greater than or equal to the SupersedeVersion
* set supersede. If we cannot get the version, do not supersede the file. */
TranslateVersionStr(szSupersedeVersion, &vbVersionNew);
if(CompareVersion(vbFileVersion,vbVersionNew) >= 0)
{
siCObject->bSupersede = TRUE;
break; /* Found at least one file, so break out of while loop */
}
}
}
else
{ /* The file exists, and there's no version to check. set Supersede */
siCObject->bSupersede = TRUE;
break; /* Found at least one file, so break out of while loop */
}
}
wsprintf(szKey, "SupersedeFile%d", ++dwIndex);
GetPrivateProfileString(siCObject->szReferenceName, szKey, "", szSupersedeFile, sizeof(szSupersedeFile), szFileIniConfig);
}
}
else if(lstrcmpi(szType, "GRE") == 0)
{
/* save the GRE component */
aGre->siCGreComponent = siCObject;
/* If -fgre is passed in, and the current product to install is !GRE,
* and the current component is 'Component GRE' then select and
* disable it to force it to be installed regardless of supersede
* rules.
*
* If the product is GRE, then it won't have a 'Component GRE', but
* rather a 'Component XPCOM', in which case it will always get
* installed */
if((gbForceInstallGre) && (lstrcmpi(sgProduct.szProductNameInternal, "GRE") != 0))
{
siCObject->dwAttributes |= SIC_SELECTED;
siCObject->dwAttributes |= SIC_DISABLED;
}
else
ResolveSupersedeGre(siCObject, aGre);
}
}
if(siCObject->bSupersede)
{
siCObject->dwAttributes &= ~SIC_SELECTED;
siCObject->dwAttributes |= SIC_DISABLED;
siCObject->dwAttributes |= SIC_INVISIBLE;
}
else
/* Make sure to unset the DISABLED bit. If the Setup Type is other than
* Custom, then we don't care if it's DISABLED or not because this flag
* is only used in the Custom dialogs.
*
* If the Setup Type is Custom and this component is DISABLED by default
* via the config.ini, it's default value will be restored in the
* SiCNodeSetItemsSelected() function that called ResolveSupersede(). */
siCObject->dwAttributes &= ~SIC_DISABLED;
}
return(siCObject->bSupersede);
}

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,31 @@
/*
* 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 Navigator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape Communications Corp. are
* Copyright (C) 1998, 1999, 2000, 2001 Netscape Communications Corp. All
* Rights Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
*/
#ifndef _WIZVERREG_H_
#define _WIZVERREG_H_
int VR_CreateRegistry(char *installation, char *programPath, char *versionStr);
int VR_Install(char *component_path, char *filepath, char *version, int bDirectory);
int VR_Close(void);
#endif /* _WIZVERREG_H_ */

Просмотреть файл

@ -0,0 +1,80 @@
/* -*- 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[] = {"0" , "OK",
"-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",
"-241", "KEY_ACCESS_DENIED",
"-242", "KEY_DOES_NOT_EXIST",
"-243", "VALUE_DOES_NOT_EXIST",
"-299", "OUT_OF_MEMORY",
"-322", "INIT_STUB_ERROR",
"-5550", "GESTALT_UNKNOWN_ERR",
"-5551", "GESTALT_INVALID_ARGUMENT",
""};
#endif /* _XPERR_H_ */

Просмотреть файл

@ -0,0 +1,832 @@
/* -*- 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"
#include "logging.h"
#include "ifuncns.h"
#define BDIR_RIGHT 1
#define BDIR_LEFT 2
typedef HRESULT (_cdecl *XpiInit)(const char *, const char *aLogName, pfnXPIProgress);
typedef HRESULT (_cdecl *XpiInstall)(const char *, const char *, long);
typedef void (_cdecl *XpiExit)(void);
typedef BOOL (WINAPI *SetDllPathProc)(const char*);
static XpiInit pfnXpiInit;
static XpiInstall pfnXpiInstall;
static XpiExit pfnXpiExit;
static SetDllPathProc pfnSetDllPath = NULL;
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 char gSavedCwd[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 *xpinstallPath)
{
char szBuf[MAX_BUF];
char szXPIStubFile[MAX_BUF];
char szEGetProcAddress[MAX_BUF];
HANDLE hKernel;
hXPIStubInst = NULL;
GetCurrentDirectory(sizeof(gSavedCwd), gSavedCwd);
if(!GetPrivateProfileString("Messages", "ERROR_GETPROCADDRESS", "", szEGetProcAddress, sizeof(szEGetProcAddress), szFileIniInstall))
return(1);
/* change current directory to where xpistub.dll */
SetCurrentDirectory(xpinstallPath);
/* Windows XP SP1 changed DLL search path strategy, setting current dir */
/* is no longer sufficient. Use SetDLLDirectory() if available */
if ((hKernel = LoadLibrary("kernel32.dll")) != NULL)
{
pfnSetDllPath = (SetDllPathProc)GetProcAddress(hKernel, "SetDllDirectoryA");
if (pfnSetDllPath)
pfnSetDllPath(xpinstallPath);
}
/* build full path to xpistub.dll */
lstrcpy(szXPIStubFile, xpinstallPath);
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);
if (pfnSetDllPath)
pfnSetDllPath(NULL);
SetCurrentDirectory(gSavedCwd);
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);
}
}
char *GetErrorString(DWORD dwError, char *szErrorString, DWORD dwErrorStringSize)
{
int i = 0;
char szErrorNumber[MAX_BUF];
ZeroMemory(szErrorString, dwErrorStringSize);
itoa(dwError, 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;
}
return(szErrorString);
}
/* function that clears the file progress bar of the xpinstall progress
* dialog.
*/
void InvalidateBarberBarArea()
{
HWND hWndGauge;
RECT rect;
/* get the file progress bar gauge */
hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
/* get the dimensions of the gauge */
GetClientRect(hWndGauge, &rect);
/* invalidate the rect area of the gauge */
InvalidateRect(hWndGauge, &rect, FALSE);
/* update the dialog */
UpdateWindow(dlgInfo.hWndDlg);
}
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];
char xpinstallPath[MAX_BUF];
char xpiArgs[MAX_BUF];
if(!GetPrivateProfileString("Messages", "MSG_SMARTUPDATE_START", "", szMsgSmartUpdateStart, sizeof(szMsgSmartUpdateStart), szFileIniInstall))
return(1);
if(!GetPrivateProfileString("Messages", "DLG_EXTRACTING_TITLE", "", szDlgExtractingTitle, sizeof(szDlgExtractingTitle), szFileIniInstall))
return(1);
if(!GetPrivateProfileString("Messages", "STR_PROCESSINGFILE", "", szStrProcessingFile, sizeof(szStrProcessingFile), szFileIniInstall))
exit(1);
if(!GetPrivateProfileString("Messages", "STR_INSTALLING", "", szStrInstalling, sizeof(szStrInstalling), szFileIniInstall))
exit(1);
if(!GetPrivateProfileString("Messages", "STR_COPYINGFILE", "", szStrCopyingFile, sizeof(szStrCopyingFile), szFileIniInstall))
exit(1);
ShowMessage(szMsgSmartUpdateStart, TRUE);
GetXpinstallPath(xpinstallPath, sizeof(xpinstallPath));
if(InitializeXPIStub(xpinstallPath) == WIZ_OK)
{
LogISXPInstall(W_START);
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)
{
if(siCObject->dwAttributes & SIC_SELECTED)
/* Since the archive is selected, we need to process the file ops here */
ProcessFileOps(T_PRE_ARCHIVE, siCObject->szReferenceName);
/* 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(GetPrivateProfileString("Messages", "ERROR_FILE_NOT_FOUND", "", szEFileNotFound, sizeof(szEFileNotFound), szFileIniInstall))
{
wsprintf(szBuf, szEFileNotFound, szArchive);
PrintError(szBuf, ERROR_CODE_HIDE);
}
return(1);
}
}
}
if(dwCurrentArchive == 0)
{
++dwCurrentArchive;
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
UpdateGREAppInstallerProgress((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
}
wsprintf(szBuf, szStrInstalling, siCObject->szDescriptionShort);
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS0, szBuf);
LogISXPInstallComponent(siCObject->szDescriptionShort);
/* XXX fix: we need to better support passing arguments to .xpi files.
* This is a temporary hack to get greType passed to browser.xpi so that
* it won't delete GRE files if GRE is installed in the mozilla dir.
*
* What should be done is have the arguments be described in each
* component's section in config.ini and have it passed thru here. */
*xpiArgs = '\0';
if(lstrcmpi(siCObject->szArchiveName, "gre.xpi") == 0)
MozCopyStr(sgProduct.szRegPath, xpiArgs, sizeof(xpiArgs));
else if((lstrcmpi(siCObject->szArchiveName, "browser.xpi") == 0) &&
(sgProduct.greType == GRE_LOCAL))
/* passing -greShared to browser.xpi will tell it to cleanup GRE files
* from it's directory if they exist. */
MozCopyStr("-greLocal", xpiArgs, sizeof(xpiArgs));
hrResult = pfnXpiInstall(szArchive, xpiArgs, 0xFFFF);
if(hrResult == E_REBOOT)
bReboot = TRUE;
else if((hrResult != WIZ_OK) &&
!(siCObject->dwAttributes & SIC_IGNORE_XPINSTALL_ERROR))
{
LogMSXPInstallStatus(siCObject->szArchiveName, hrResult);
LogISXPInstallComponentResult(hrResult);
if(GetPrivateProfileString("Messages", "ERROR_XPI_INSTALL", "", szEXpiInstall, sizeof(szEXpiInstall), szFileIniInstall))
{
char szErrorString[MAX_BUF];
GetErrorString(hrResult, szErrorString, sizeof(szErrorString));
wsprintf(szBuf, "%s - %s: %d %s", szEXpiInstall, siCObject->szDescriptionShort, hrResult, szErrorString);
PrintError(szBuf, ERROR_CODE_HIDE);
}
/* break out of the siCObject while loop */
break;
}
++dwCurrentArchive;
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
UpdateGREAppInstallerProgress((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
ProcessWindowsMessages();
LogISXPInstallComponentResult(hrResult);
if((hrResult != WIZ_OK) &&
(siCObject->dwAttributes & SIC_IGNORE_XPINSTALL_ERROR))
/* reset the result to WIZ_OK if there was an error and the
* component's attributes contains SIC_IGNORE_XPINSTALL_ERROR.
* This should be done after LogISXPInstallComponentResult()
* because we still should log the error value. */
hrResult = WIZ_OK;
}
if(siCObject->dwAttributes & SIC_SELECTED)
/* Since the archive is selected, we need to do the file ops here */
ProcessFileOps(T_POST_ARCHIVE, siCObject->szReferenceName);
++dwIndex0;
siCObject = SiCNodeGetObject(dwIndex0, TRUE, AC_ALL);
} /* while(siCObject) */
//report 100% progress status for successful installs
UpdateGREAppInstallerProgress(100);
LogMSXPInstallStatus(NULL, hrResult);
pfnXpiExit();
DeInitProgressDlg();
}
else
{
ShowMessage(szMsgSmartUpdateStart, FALSE);
}
DeInitializeXPIStub();
LogISXPInstall(W_END);
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.mode != SILENT)
{
ParsePath((char *)msg, szFilename, sizeof(szFilename), FALSE, 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));
UpdateGREAppInstallerProgress((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
InvalidateBarberBarArea();
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
// Window proc for dialog
LRESULT CALLBACK
ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
DisableSystemMenuItems(hWndDlg, TRUE);
RepositionWindow(hWndDlg, BANNER_IMAGE_INSTALLING);
SendDlgItemMessage (hWndDlg, IDC_STATUS0, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
SendDlgItemMessage (hWndDlg, IDC_GAUGE_ARCHIVE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
SendDlgItemMessage (hWndDlg, IDC_STATUS3, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
SendDlgItemMessage (hWndDlg, IDC_GAUGE_FILE, WM_SETFONT, (WPARAM)sgInstallGui.definedFont, 0L);
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.mode != SILENT)
{
hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
if(dwBarberDirection == BDIR_RIGHT)
{
// 121 is the (number of bars) + (number bars in barber bar).
// this number determines how far to the right to draw the barber bat
// so as to make it look like it disappears off the progress meter area.
if(lBarberCounter < 121)
++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.mode != 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.mode != 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 = NULL;
HBRUSH hBrushClear = NULL;
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);
}
}
if(hBrushClear)
DeleteObject(hBrushClear);
if(hBrush)
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.mode != 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.mode != SILENT)
{
SaveWindowPosition(dlgInfo.hWndDlg);
DestroyWindow(dlgInfo.hWndDlg);
UnregisterClass("GaugeFile", hInst);
UnregisterClass("GaugeArchive", hInst);
}
}

Просмотреть файл

@ -0,0 +1,40 @@
/* -*- 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_
HRESULT InitializeXPIStub(char *xpinstallPath);
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);
char *GetErrorString(DWORD dwError, char *szErrorString, DWORD dwErrorStringSize);
#endif /* _XPI_H_ */

Просмотреть файл

@ -0,0 +1,119 @@
/* -*- 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

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,44 @@
/*
* 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 Navigator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape Communications Corp. are
* Copyright (C) 1998, 1999, 2000, 2001 Netscape Communications Corp. All
* Rights Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
*/
#ifndef _XPNETHOOK_H_
#define _XPNETHOOK_H_
int WGet(char *szUrl,
char *szFile,
char *szProxyServer,
char *szProxyPort,
char *szProxyUser,
char *szProxyPasswd);
int DownloadFiles(char *szInputIniFile,
char *szDownloadDir,
char *szProxyServer,
char *szProxyPort,
char *szProxyUser,
char *szProxyPasswd,
BOOL bShowRetryMsg,
BOOL bIgnoreNetworkError,
char *szFailedFile,
DWORD dwFailedFileSize);
#endif /* _XPNETHOOK_H_ */

Просмотреть файл

@ -0,0 +1,92 @@
/* -*- 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 );
/* Test the integrity of every item in this open archive
* by verifying each item's checksum against the stored
* CRC32 value.
*/
extern __declspec(dllexport)int ZIP_TestArchive( 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 */

Просмотреть файл

@ -0,0 +1,62 @@
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = setuprsc
LIBRARY_NAME = setuprsc
RESFILE = setuprsc.res
USE_NON_MT_LIBS = 1
NO_DIST_INSTALL = 1
EXPORTS = setuprsc.h
CPPSRCS = setuprsc.cpp
GARBAGE += $(DIST)/install/$(SHARED_LIBRARY)
GARBAGE_DIRS += $(DIST)/include/$(MODULE)
FORCE_SHARED_LIB=1
LOCAL_INCLUDES = -I$(srcdir)
include $(topsrcdir)/config/rules.mk
# Hack to get around the default rules insisting that .lib should exist
$(IMPORT_LIBRARY):
touch $@
export:: $(EXPORTS)
$(INSTALL) $< $(DIST)/include/$(MODULE)/
libs:: $(SHARED_LIBRARY)
$(INSTALL) $< $(DIST)/install
install:: $(SHARED_LIBRARY)
$(INSTALL) $< $(DESTDIR)$(mozappdir)/install

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Двоичные данные
toolkit/mozapps/installer/windows/wizard/setuprsc/setup.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Просмотреть файл

@ -0,0 +1,29 @@
/* -*- 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
*
* 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>
*/
#include <windows.h>
int FAR PASCAL LibMain(HINSTANCE hInstance, WORD wDataSeg, WORD cbHeapSize, LPSTR lpCmdLine)
{
return(1);
}

Просмотреть файл

@ -0,0 +1,149 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by setuprsc.rc
//
#ifndef WINVER
#define WINVER 0x0400
#endif
#include "winresrc.h"
#define IDS_ERROR_FILE_NOT_FOUND 3
#define IDRESUME 3
#define IDPAUSE 4
#define IDS_MSG_RETRIEVE_INSTALLINI 11
#define IDI_ICON1 105
#define IDI_SETUP 105
#define IDB_BITMAP_WELCOME 108
#define DLG_MESSAGE 110
#define IDB_BITMAP_BANNER 114
#define IDB_QUICK_LAUNCH 115
#define DLG_BROWSE_DIR 503
#define IDC_STATUS 1001
#define IDC_STATUS1 1001
#define ID_DELETE 1001
#define IDC_STATUS_URL 1001
#define IDCONTINUE 1001
#define IDC_GAUGE 1002
#define IDC_GAUGE_FILE 1002
#define ID_IGNORE 1002
#define IDSKIP 1002
#define IDC_STATUS2 1003
#define IDC_STATUS_URL2 1003
#define IDC_STATUS_TO 1003
#define IDC_STATUS0 1004
#define IDC_STATUS3 1005
#define ID_YES_TO_ALL 1005
#define IDC_STATUS_URL3 1005
#define IDC_GAUGE_ARCHIVE 1006
#define IDC_EDIT_DESTINATION 1009
#define IDC_BUTTON_BROWSE 1010
#define IDC_EDIT_COMPONENT1 1013
#define IDC_EDIT_SUBCOMPONENT 1014
#define IDC_STATIC_SUBCOMPONENT 1016
#define IDC_CHECK1 1017
#define IDC_STATIC_DESCRIPTION 1018
#define IDC_EDIT_PROGRAM_FOLDER 1019
#define IDC_CHECK2 1023
#define IDC_LIST2 1023
#define IDC_LIST 1023
#define IDC_CHECK3 1024
#define IDC_EDIT_LICENSE 1024
#define IDC_CHECK0 1025
#define IDC_CURRENT_SETTINGS 1026
#define IDC_LIST_COMPONENTS 1027
#define IDC_LIST_SUBCOMPONENTS 1029
#define IDC_STATIC_DRIVE_SPACE_REQUIRED 1030
#define IDC_SPACE_AVAILABLE 1030
#define IDC_STATIC_DRIVE_SPACE_AVAILABLE 1031
#define IDC_STATIC_DESTINATION 1032
#define IDC_STATIC0 1033
#define IDC_STATIC1 1034
#define IDC_STATIC2 1035
#define IDC_STATIC3 1036
#define IDC_STATIC4 1037
#define IDC_PERCENTAGE 1038
#define IDC_MESSAGE1 1040
#define IDC_PICT0 1041
#define IDC_MESSAGE0 1042
#define IDC_STATIC_ST0_DESCRIPTION 1042
#define IDC_STATIC_ST1_DESCRIPTION 1043
#define IDC_MESSAGE2 1043
#define IDC_STATIC_ST2_DESCRIPTION 1044
#define IDC_STATIC_ST3_DESCRIPTION 1045
#define IDC_STATIC_MSG0 1046
#define IDC_MESSAGE 1049
#define IDC_LIST1 1053
#define IDC_BUTTON1 1055
#define IDC_README 1055
#define IDC_BUTTON_SITE_SELECTOR 1055
#define IDC_DOWNLOAD_SIZE 1058
#define IDC_SITE_SELECTOR 1059
#define IDC_LIST_SITE_SELECTOR 1059
#define IDC_CHECK_SAVE_INSTALLER 1061
#define IDC_CHECK_SAVE_INSTALLER_FILES 1061
#define IDC_EDIT_PROXY_SERVER 1062
#define IDC_EDIT_PROXY_PORT 1063
#define IDC_TAB1 1064
#define IDC_EDIT_PROXY_USER 1064
#define IDC_DELETE_PATH 1065
#define IDC_EDIT_PROXY_PASSWD 1065
#define IDC_LOCAL_INSTALLER_PATH 1066
#define IDC_EDIT_LOCAL_INSTALLER_PATH 1066
#define IDC_BUTTON_ADDITIONAL_SETTINGS 1067
#define IDC_BUTTON_PROXY_SETTINGS 1067
#define IDC_STATUS_FILE 1070
#define IDC_STATUS_STATUS 1071
#define IDC_USE_HTTP 1073
#define IDC_USE_FTP 1074
#define IDC_DESTINATION 1074
#define IDC_CHECK_TURBO_MODE 1075
#define IDC_CHECK_RECAPTURE_HOMEPAGE 1076
#define DLG_WELCOME 2001
#define DLG_LICENSE 2002
#define DLG_SETUP_TYPE 2003
#define DLG_SELECT_COMPONENTS_SINGLE 2004
#define DLG_SELECT_COMPONENTS 2004
#define DLG_SELECT_COMPONENTS_MULTI 2005
#define DLG_WINDOWS_INTEGRATION 2006
#define DLG_PROGRAM_FOLDER 2007
#define DLG_START_INSTALL 2008
#define DLG_EXTRACTING 2009
#define DLG_QUICK_LAUNCH 2010
#define DLG_RESTART 10206
#define DLG_SITE_SELECTOR 10207
#define DLG_ADVANCED_SETTINGS 10207
#define DLG_SELECT_ADDITIONAL_COMPONENTS 10208
#define DLG_UPGRADE 10209
#define DLG_ADDITIONAL_OPTIONS 10210
#define DLG_DOWNLOADING 10211
#define DLG_START_INSTALL1 10212
#define IDB_BOX_CHECKED 10304
#define IDB_BOX_UNCHECKED 10306
#define IDB_BOX_CHECKED_DISABLED 10307
#define IDC_RADIO_TYPICAL 11007
#define IDC_RADIO_ST0 11007
#define IDC_RADIO_CUSTOM 11008
#define IDC_RADIO_ST2 11008
#define IDC_RADIO_COMPACT 11009
#define IDC_RADIO_ST1 11009
#define IDC_RADIO_ST3 11010
#define IDC_RADIO_YES 11011
#define IDC_RADIO_NO 11012
#define IDWIZBACK 11013
#define IDWIZNEXT 11014
#define IDS_MSG_CREATE_DIRECTORY 11015
#define IDWIZNEXT2 11015
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 116
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1079
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Просмотреть файл

@ -0,0 +1,480 @@
//Microsoft Developer Studio generated resource script.
//
#include "setuprsc.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
"setuprsc.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
DLG_WELCOME DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_STATIC0,101,11,202,37,NOT WS_GROUP
LTEXT "",IDC_STATIC1,102,53,201,37,NOT WS_GROUP
LTEXT "",IDC_STATIC2,102,96,201,37,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_SETUP_TYPE DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_RADIO_ST0,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,102,29,65,12
CONTROL "",IDC_RADIO_ST1,"Button",BS_AUTORADIOBUTTON,102,57,65,
12
CONTROL "",IDC_RADIO_ST2,"Button",BS_AUTORADIOBUTTON,102,84,64,
12
CONTROL "",IDC_RADIO_ST3,"Button",BS_AUTORADIOBUTTON,102,112,64,
12
LTEXT "",IDC_STATIC_ST0_DESCRIPTION,175,31,126,24
LTEXT "",IDC_STATIC_ST1_DESCRIPTION,175,59,126,24
LTEXT "",IDC_STATIC_ST2_DESCRIPTION,175,86,126,24
LTEXT "",IDC_STATIC_ST3_DESCRIPTION,175,114,126,25
GROUPBOX "",IDC_DESTINATION,101,147,204,27
CONTROL "",IDC_EDIT_DESTINATION,"Static",SS_LEFTNOWORDWRAP |
WS_GROUP,107,160,143,9
PUSHBUTTON "",IDC_BUTTON_BROWSE,255,156,46,14
PUSHBUTTON "",IDC_README,11,186,83,14
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_STATIC_MSG0,101,11,204,17,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_SELECT_COMPONENTS DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",IDC_STATIC1,101,32,103,8
LISTBOX IDC_LIST_COMPONENTS,101,42,204,67,LBS_OWNERDRAWFIXED |
LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_GROUP | WS_TABSTOP
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,10,204,19,NOT WS_GROUP
GROUPBOX "",IDC_STATIC2,101,115,204,22
LTEXT "",IDC_STATIC_DESCRIPTION,106,124,195,8,SS_NOPREFIX
GROUPBOX "",IDC_STATIC,101,140,204,33
LTEXT "",IDC_DOWNLOAD_SIZE,105,160,92,8,NOT WS_GROUP
LTEXT "",IDC_SPACE_AVAILABLE,206,160,94,8,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
LTEXT "",IDC_STATIC,201,32,103,8,0,WS_EX_RIGHT
LTEXT "",IDC_STATIC3,105,148,92,9
LTEXT "",IDC_STATIC4,206,148,94,9
END
DLG_WINDOWS_INTEGRATION DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_CHECK0,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,32,205,17
CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,53,205,17
CONTROL "",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,73,205,17
CONTROL "",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,94,205,17
LTEXT "",IDC_MESSAGE1,101,117,205,54,NOT WS_GROUP
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,11,204,17,NOT WS_GROUP
CONTROL 108,IDC_PICT0,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC0,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_PROGRAM_FOLDER DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",IDC_STATIC1,101,54,105,8
EDITTEXT IDC_EDIT_PROGRAM_FOLDER,101,64,204,12,ES_AUTOHSCROLL
LTEXT "",IDC_STATIC2,101,84,163,8
LISTBOX IDC_LIST,101,94,204,79,LBS_SORT | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_LICENSE DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDWIZBACK,134,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
EDITTEXT IDC_EDIT_LICENSE,11,29,295,119,ES_MULTILINE |
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_GROUP
LTEXT "",IDC_MESSAGE0,11,8,295,17,NOT WS_GROUP
LTEXT "",IDC_MESSAGE1,11,152,295,19,NOT WS_GROUP
CONTROL "",-1,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_QUICK_LAUNCH DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_CHECK_TURBO_MODE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,101,157,204,9
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,14,204,18,NOT WS_GROUP
LTEXT "",IDC_MESSAGE1,101,50,204,20,NOT WS_GROUP
LTEXT "",IDC_MESSAGE2,101,127,204,18,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
CONTROL 115,IDC_STATIC,"Static",SS_BITMAP,102,76,20,20
END
DLG_BROWSE_DIR DIALOG DISCARDABLE 147, 23, 190, 143
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "",1092,8,6,92,9
EDITTEXT IDC_EDIT_DESTINATION,8,16,177,12,ES_AUTOHSCROLL |
ES_OEMCONVERT | NOT WS_BORDER,WS_EX_CLIENTEDGE
LISTBOX 1121,8,37,120,68,LBS_SORT | LBS_NOREDRAW |
LBS_OWNERDRAWFIXED | LBS_HASSTRINGS |
LBS_DISABLENOSCROLL | WS_VSCROLL | WS_HSCROLL |
WS_TABSTOP
LTEXT "",1091,8,108,92,9
COMBOBOX 1137,8,118,121,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "",1,135,43,50,14,WS_GROUP
PUSHBUTTON "",IDCANCEL,135,63,50,14,WS_GROUP
END
DLG_RESTART DIALOG FIXED IMPURE 133, 69, 255, 111
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",202,10,10,236,36,SS_NOPREFIX
CONTROL "",IDC_RADIO_YES,"Button",BS_AUTORADIOBUTTON,26,52,220,
12
CONTROL "",IDC_RADIO_NO,"Button",BS_AUTORADIOBUTTON,26,68,223,12
DEFPUSHBUTTON "",IDOK,189,88,50,14,WS_GROUP
END
DLG_MESSAGE DIALOG DISCARDABLE 0, 0, 236, 34
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
CTEXT "",IDC_MESSAGE,0,0,236,34,SS_CENTERIMAGE
END
DLG_EXTRACTING DIALOG DISCARDABLE 0, 0, 312, 154
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_STATUS0,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX |
WS_GROUP,12,64,286,8
CONTROL "",IDC_GAUGE_ARCHIVE,"GaugeArchive",0x0,12,77,286,11
CONTROL "",IDC_STATUS3,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX |
WS_GROUP,12,98,286,8
CONTROL "",IDC_GAUGE_FILE,"GaugeFile",0x0,12,110,286,11
CONTROL 114,IDB_BITMAP_BANNER,"Static",SS_BITMAP,0,0,312,34
END
DLG_ADVANCED_SETTINGS DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT_PROXY_SERVER,165,57,134,12,ES_AUTOHSCROLL
EDITTEXT IDC_EDIT_PROXY_PORT,165,74,134,12,ES_AUTOHSCROLL
EDITTEXT IDC_EDIT_PROXY_USER,165,101,134,12,ES_AUTOHSCROLL
EDITTEXT IDC_EDIT_PROXY_PASSWD,165,118,134,12,ES_PASSWORD |
ES_AUTOHSCROLL
CONTROL "",IDC_USE_FTP,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
101,148,205,9
CONTROL "",IDC_USE_HTTP,"Button",BS_AUTORADIOBUTTON,101,161,205,
9
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
RTEXT "",IDC_STATIC1,108,59,52,9
RTEXT "",IDC_STATIC2,108,75,52,9
GROUPBOX "",IDC_STATIC,101,44,206,94
LTEXT "",IDC_MESSAGE0,101,11,204,29,NOT WS_GROUP
RTEXT "",IDC_STATIC3,108,102,52,9
RTEXT "",IDC_STATIC4,108,120,52,9
END
DLG_SELECT_ADDITIONAL_COMPONENTS DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",IDC_STATIC1,101,32,125,8
LISTBOX IDC_LIST_COMPONENTS,101,42,204,67,LBS_OWNERDRAWFIXED |
LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_GROUP | WS_TABSTOP
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,101,10,204,19,NOT WS_GROUP
GROUPBOX "",IDC_STATIC2,101,115,204,22
LTEXT "",IDC_STATIC_DESCRIPTION,106,124,195,8,SS_NOPREFIX
GROUPBOX "",IDC_STATIC,101,140,204,33
LTEXT "",IDC_DOWNLOAD_SIZE,105,160,92,8,NOT WS_GROUP
LTEXT "",IDC_SPACE_AVAILABLE,206,160,94,8,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
LTEXT "",IDC_STATIC,241,32,63,8,0,WS_EX_RIGHT
LTEXT "",IDC_STATIC3,105,148,92,9
LTEXT "",IDC_STATIC4,206,148,94,9
END
DLG_UPGRADE DIALOG DISCARDABLE 51, 56, 310, 166
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDCONTINUE,65,147,53,14
PUSHBUTTON "",IDSKIP,128,147,53,14
PUSHBUTTON "",IDWIZBACK,191,147,53,14
LTEXT "",IDC_MESSAGE0,9,9,291,93,NOT WS_GROUP
GROUPBOX "",IDC_STATIC,9,109,291,25
LTEXT "",IDC_DELETE_PATH,13,118,282,12,SS_CENTERIMAGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,9,140,292,1,
WS_EX_STATICEDGE
END
DLG_ADDITIONAL_OPTIONS DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_CHECK_RECAPTURE_HOMEPAGE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,100,56,202,8
LTEXT "",IDC_MESSAGE1,100,76,204,33,NOT WS_GROUP
CONTROL "",IDC_CHECK_SAVE_INSTALLER_FILES,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,100,112,204,9
EDITTEXT IDC_EDIT_LOCAL_INSTALLER_PATH,100,124,204,12,
ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "",IDC_BUTTON_PROXY_SETTINGS,221,159,84,14
PUSHBUTTON "",IDWIZBACK,134,186,53,14
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
LTEXT "",IDC_MESSAGE0,100,20,204,33,NOT WS_GROUP
CONTROL 108,-1,"Static",SS_BITMAP,11,11,83,162,WS_EX_CLIENTEDGE
CONTROL "",-1,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_DOWNLOADING DIALOG DISCARDABLE 0, 0, 312, 154
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDPAUSE,136,134,50,14,WS_GROUP
PUSHBUTTON "",IDRESUME,187,134,50,14,WS_GROUP
PUSHBUTTON "",IDCANCEL,252,134,50,14,WS_GROUP
LTEXT "",IDC_MESSAGE0,9,39,293,23
LTEXT "",IDC_STATIC3,9,81,37,8,SS_NOPREFIX
CONTROL "",IDC_STATUS_URL,"Static",SS_LEFTNOWORDWRAP |
SS_NOPREFIX | WS_GROUP,49,81,253,8
LTEXT "",IDC_STATIC1,9,101,37,8,SS_NOPREFIX
CONTROL "",IDC_STATUS_STATUS,"Static",SS_LEFTNOWORDWRAP |
SS_NOPREFIX | WS_GROUP,49,101,253,8
LTEXT "",IDC_STATIC2,9,72,37,8,SS_NOPREFIX
CONTROL "",IDC_STATUS_FILE,"Static",SS_LEFTNOWORDWRAP |
SS_NOPREFIX | WS_GROUP,49,72,253,8
CONTROL "",IDC_GAUGE_FILE,"GaugeFile",0x0,9,114,271,11
LTEXT "",IDC_PERCENTAGE,283,115,20,8,SS_NOPREFIX
CONTROL 114,IDB_BITMAP_BANNER,"Static",SS_BITMAP,0,0,312,34
LTEXT "",IDC_STATIC4,9,91,37,8,SS_NOPREFIX
CONTROL "",IDC_STATUS_TO,"Static",SS_LEFTNOWORDWRAP |
SS_NOPREFIX | WS_GROUP,49,91,253,8
END
DLG_START_INSTALL DIALOG DISCARDABLE 51, 56, 315, 205
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
PUSHBUTTON "",IDWIZBACK,134,186,53,14
PUSHBUTTON "",IDCANCEL,252,186,53,14
EDITTEXT IDC_CURRENT_SETTINGS,101,67,204,102,ES_MULTILINE |
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_HSCROLL
LTEXT "",IDC_MESSAGE0,101,11,204,52,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_SETUP ICON DISCARDABLE "setup.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BOX_UNCHECKED BITMAP FIXED IMPURE "box_unch.bmp"
IDB_BOX_CHECKED BITMAP FIXED IMPURE "box_chec.bmp"
IDB_BITMAP_WELCOME BITMAP DISCARDABLE "bitmap1.bmp"
IDB_BOX_CHECKED_DISABLED BITMAP FIXED IMPURE "box_ch_d.bmp"
IDB_BITMAP_BANNER BITMAP DISCARDABLE "downloadLogo.bmp"
IDB_QUICK_LAUNCH BITMAP DISCARDABLE "turbo-systray.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
DLG_EXTRACTING, DIALOG
BEGIN
BOTTOMMARGIN, 153
END
DLG_UPGRADE, DIALOG
BEGIN
BOTTOMMARGIN, 165
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ERROR_FILE_NOT_FOUND "File not found: %s"
IDS_MSG_RETRIEVE_INSTALLINI
"Please wait while Setup is attempting to retrieve install.ini, required by Setup, from the Web..."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Просмотреть файл

Просмотреть файл

@ -0,0 +1,70 @@
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = uninstall
PROGRAM = uninstall$(BIN_SUFFIX)
RESFILE = uninstall.res
REQUIRES = $(ZLIB_REQUIRES)
EXTRA_DSO_LIBS = mozz_s
USE_NON_MT_LIBS = 1
EXPORTS = logkeys.h
CSRCS = \
uninstall.c \
extra.c \
dialogs.c \
parser.c \
ifuncns.c \
rdi.c \
process.c \
$(NULL)
MOZ_WINCONSOLE = 0
LOCAL_INCLUDES = -I$(srcdir)
ifdef GNU_CC
OS_LIBS += -lshell32 -lversion -lgdi32
else
OS_LIBS += shell32.lib version.lib
endif
NO_DIST_INSTALL = 1
include $(topsrcdir)/config/rules.mk
libs:: $(PROGRAM)
$(INSTALL) $(PROGRAM) $(DIST)/install
install:: $(PROGRAM)
$(INSTALL) $(PROGRAM) $(DESTDIR)$(mozappdir)/install
clean clobber realclean clobber_all::
$(RM) $(DIST)/install/$(PROGRAM)

Просмотреть файл

@ -0,0 +1,526 @@
/* -*- 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 "extra.h"
#include "dialogs.h"
#include "ifuncns.h"
#include "parser.h"
#include "rdi.h"
#include "shlobj.h"
#define MOZ_HWND_BROADCAST_MSG_TIMEOUT 5000
#define MOZ_CLIENT_BROWSER_KEY "Software\\Clients\\StartMenuInternet"
#define MOZ_CLIENT_MAIL_KEY "Software\\Clients\\Mail"
void SetDefault()
{
char szBuf[MAX_BUF];
char szRegKey[MAX_BUF];
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientTypeName", "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
wsprintf(szRegKey, "SOFTWARE\\Clients\\%s", szBuf);
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientProductKey", "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
SetWinReg(HKEY_LOCAL_MACHINE, szRegKey, "", REG_SZ, szBuf, lstrlen(szBuf));
}
void ParseDefaultsInfo()
{
char szBuf[MAX_BUF];
char szIniKey[MAX_BUF];
char szStorageDir[MAX_BUF];
char szShortcutPath[MAX_BUF];
char szStoredShortcutPath[MAX_BUF];
char szRegKey[MAX_BUF];
char szClientTypeName[MAX_BUF];
char szClientProductKey[MAX_BUF];
int iIndex;
DWORD dwIconsVisible;
// If szAppPath is a null sting, i.e. we cannot find where the app has been installed:
// - HIDEICONS will still remove the shortcuts but
// - SHOWICONS will do nothing because we won't be able to find the shortcuts to display.
ParsePath(ugUninstall.szAppPath, szStorageDir, MAX_BUF, PP_PATH_ONLY);
lstrcat(szStorageDir, "defaults\\shortcuts\\");
// CLEANUP ISSUE: For all of the SHOWICON and HIDEICONS blocks below, there is a lot of
// redundancy:
// - Right now I'm just trying to create icons and, if I can't, trying under the PERSONAL
// key instead. I would be cleaner to check for restricted access once, and then just
// create the appropriate key each time.
// - Creating a ShowIcon() and a HideIcon() function would rid us much of the redundency.
// Deal with Desktop Icons
iIndex = 0;
wsprintf(szIniKey, "DesktopShortcut%d", iIndex);
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
while(szBuf[0] != '\0')
{
strcpy(szShortcutPath, "COMMON_DESKTOP");
DecryptVariable(szShortcutPath, MAX_BUF);
if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0'))
{
wsprintf(szStoredShortcutPath, "%s%s", szStorageDir, szBuf);
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
{
strcpy(szShortcutPath, "PERSONAL_DESKTOP");
DecryptVariable(szShortcutPath, MAX_BUF);
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
}
}
if (ugUninstall.mode == HIDEICONS)
{
AppendBackSlash(szShortcutPath, MAX_BUF);
lstrcat(szShortcutPath, szBuf);
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
{
strcpy(szShortcutPath, "PERSONAL_DESKTOP");
DecryptVariable(szShortcutPath, MAX_BUF);
AppendBackSlash(szShortcutPath, MAX_BUF);
lstrcat(szShortcutPath, szBuf);
}
FileDelete(szShortcutPath);
}
iIndex++;
wsprintf(szIniKey, "DesktopShortcut%d", iIndex);
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
}
// Deal with StartMenu Icons
iIndex = 0;
wsprintf(szIniKey, "StartMenuShortcut%d", iIndex);
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
while(szBuf[0] != '\0')
{
strcpy(szShortcutPath, "COMMON_STARTMENU");
DecryptVariable(szShortcutPath, MAX_BUF);
if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0'))
{
lstrcpy(szStoredShortcutPath, szStorageDir);
lstrcat(szStoredShortcutPath, szBuf);
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
{
strcpy(szShortcutPath, "PERSONAL_STARTMENU");
DecryptVariable(szShortcutPath, MAX_BUF);
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
}
}
if (ugUninstall.mode == HIDEICONS)
{
AppendBackSlash(szShortcutPath, MAX_BUF);
lstrcat(szShortcutPath, szBuf);
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
{
strcpy(szShortcutPath, "PERSONAL_STARTMENU");
DecryptVariable(szShortcutPath, MAX_BUF);
AppendBackSlash(szShortcutPath, MAX_BUF);
lstrcat(szShortcutPath, szBuf);
}
FileDelete(szShortcutPath);
}
iIndex++;
wsprintf(szIniKey, "StartMenuShortcut%d", iIndex);
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
}
// Deal with QuickLaunch Bar Icons
iIndex = 0;
wsprintf(szIniKey, "QuickLaunchBarShortcut%d", iIndex);
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
while(szBuf[0] != '\0')
{
GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", szShortcutPath, MAX_BUF);
lstrcat(szShortcutPath, "\\Microsoft\\Internet Explorer\\Quick Launch");
if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0'))
{
wsprintf(szStoredShortcutPath, "%s%s", szStorageDir, szBuf);
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
{
GetWinReg(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups", "Quick Launch", szShortcutPath, MAX_BUF);
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
}
}
if (ugUninstall.mode == HIDEICONS)
{
AppendBackSlash(szShortcutPath, MAX_BUF);
lstrcat(szShortcutPath, szBuf);
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
{
GetWinReg(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups", "Quick Launch", szShortcutPath, MAX_BUF);
AppendBackSlash(szShortcutPath, MAX_BUF);
lstrcat(szShortcutPath, szBuf);
}
FileDelete(szShortcutPath);
}
++iIndex;
wsprintf(szIniKey, "QuickLaunchBarShortcut%d", iIndex);
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
}
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientTypeName", "", szClientTypeName, MAX_BUF, szFileIniDefaultsInfo);
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientProductKey", "", szClientProductKey, MAX_BUF, szFileIniDefaultsInfo);
wsprintf(szRegKey, "SOFTWARE\\Clients\\%s\\%s\\InstallInfo", szClientTypeName, szClientProductKey);
if (ugUninstall.mode == SHOWICONS)
dwIconsVisible = 1;
else
dwIconsVisible = 0;
SetWinRegNumValue(HKEY_LOCAL_MACHINE, szRegKey, "IconsVisible", dwIconsVisible);
}
void ParseAllUninstallLogs()
{
char szFileInstallLog[MAX_BUF];
char szKey[MAX_BUF];
sil *silFile;
DWORD dwFileFound;
DWORD dwRv = 0;
UndoDesktopIntegration();
CleanupMailIntegration();
dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog));
while(dwFileFound)
{
if((silFile = InitSilNodes(szFileInstallLog)) != NULL)
{
FileDelete(szFileInstallLog);
dwRv = Uninstall(silFile);
DeInitSilNodes(&silFile);
if(dwRv == WTD_CANCEL)
break;
}
dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog));
}
if(dwRv != WTD_CANCEL)
{
lstrcpy(szFileInstallLog, ugUninstall.szLogPath);
AppendBackSlash(szFileInstallLog, MAX_BUF);
lstrcat(szFileInstallLog, ugUninstall.szLogFilename);
if(FileExists(szFileInstallLog))
{
if((silFile = InitSilNodes(szFileInstallLog)) != NULL)
{
FileDelete(szFileInstallLog);
Uninstall(silFile);
DeInitSilNodes(&silFile);
}
}
/* clean up the uninstall windows registry key */
lstrcpy(szKey, "Software\\Microsoft\\Windows\\CurrentVersion\\uninstall\\");
lstrcat(szKey, ugUninstall.szUninstallKeyDescription);
RegDeleteKey(HKEY_LOCAL_MACHINE, szKey);
/* update Wininit.ini to remove itself at reboot */
RemoveUninstaller(ugUninstall.szUninstallFilename);
// Calling SHChangeNotify() will update the file association icons
// in case they had been reset.
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
}
/* Broadcast message only if the windows registry keys exist
* in case they were changed during uninstallation. If they
* were, then the broadcast will alert the OS to update the appropriate UIs.
* This needs to be done regardless if the user canceled the uninstall
* process or not.
*/
if(WinRegKeyExists(HKEY_LOCAL_MACHINE, MOZ_CLIENT_BROWSER_KEY))
{
SendMessageTimeout(HWND_BROADCAST,
WM_SETTINGCHANGE,
0,
(LPARAM)MOZ_CLIENT_BROWSER_KEY,
SMTO_NORMAL|SMTO_ABORTIFHUNG,
MOZ_HWND_BROADCAST_MSG_TIMEOUT,
NULL);
}
if(WinRegKeyExists(HKEY_LOCAL_MACHINE, MOZ_CLIENT_MAIL_KEY))
{
SendMessageTimeout(HWND_BROADCAST,
WM_SETTINGCHANGE,
0,
(LPARAM)MOZ_CLIENT_MAIL_KEY,
SMTO_NORMAL|SMTO_ABORTIFHUNG,
MOZ_HWND_BROADCAST_MSG_TIMEOUT,
NULL);
}
}
LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
char szBuf[MAX_BUF];
RECT rDlg;
switch(msg)
{
case WM_INITDIALOG:
SetWindowText(hDlg, diUninstall.szTitle);
wsprintf(szBuf, diUninstall.szMessage0, ugUninstall.szDescription);
SetDlgItemText(hDlg, IDC_MESSAGE0, szBuf);
GetPrivateProfileString("Dialog Uninstall", "Yes", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, IDWIZNEXT, szBuf);
GetPrivateProfileString("Dialog Uninstall", "No", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, IDCANCEL, szBuf);
SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, IDWIZNEXT, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDWIZNEXT:
EnableWindow(GetDlgItem(hDlg, IDWIZNEXT), FALSE);
EnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE);
ParseAllUninstallLogs();
VerifyAndDeleteInstallationFolder();
DestroyWindow(hDlg);
PostQuitMessage(0);
break;
case IDCANCEL:
DestroyWindow(hDlg);
PostQuitMessage(0);
break;
default:
break;
}
break;
}
return(0);
}
LRESULT CALLBACK DlgProcWhatToDo(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
char szBuf[MAX_BUF];
RECT rDlg;
switch(msg)
{
case WM_INITDIALOG:
GetPrivateProfileString("Messages", "DLG_REMOVE_FILE_TITLE", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetWindowText(hDlg, szBuf);
if((LPSTR)lParam != NULL)
SetDlgItemText(hDlg, IDC_STATIC_SHARED_FILENAME, (LPSTR)lParam);
GetPrivateProfileString("Dialog Uninstall", "Message1", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, IDC_MESSAGE0, szBuf);
GetPrivateProfileString("Dialog Uninstall", "Message2", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, IDC_MESSAGE1, szBuf);
GetPrivateProfileString("Dialog Uninstall", "FileName", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, IDC_STATIC, szBuf);
GetPrivateProfileString("Dialog Uninstall", "No", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, ID_NO, szBuf);
GetPrivateProfileString("Dialog Uninstall", "NoToAll", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, ID_NO_TO_ALL, szBuf);
GetPrivateProfileString("Dialog Uninstall", "Yes", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, ID_YES, szBuf);
GetPrivateProfileString("Dialog Uninstall", "YesToAll", "", szBuf, sizeof(szBuf), szFileIniUninstall);
SetDlgItemText(hDlg, ID_YES_TO_ALL, szBuf);
SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, IDC_MESSAGE1, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, IDC_STATIC, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, IDC_STATIC_SHARED_FILENAME, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, ID_NO, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, ID_NO_TO_ALL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, ID_YES, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
SendDlgItemMessage (hDlg, ID_YES_TO_ALL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case ID_NO:
EndDialog(hDlg, WTD_NO);
break;
case ID_NO_TO_ALL:
EndDialog(hDlg, WTD_NO_TO_ALL);
break;
case ID_YES:
EndDialog(hDlg, WTD_YES);
break;
case ID_YES_TO_ALL:
EndDialog(hDlg, WTD_YES_TO_ALL);
break;
default:
break;
}
break;
}
return(0);
}
LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
{
RECT rDlg;
HWND hSTMessage = GetDlgItem(hDlg, IDC_MESSAGE); /* handle to the Static Text message window */
HDC hdcSTMessage;
SIZE sizeString;
LOGFONT logFont;
HFONT hfontTmp;
HFONT hfontOld;
int i;
switch(msg)
{
case WM_INITDIALOG:
SendDlgItemMessage (hDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_MESSAGE:
hdcSTMessage = GetWindowDC(hSTMessage);
SystemParametersInfo(SPI_GETICONTITLELOGFONT,
sizeof(logFont),
(PVOID)&logFont,
0);
hfontTmp = CreateFontIndirect(&logFont);
if(hfontTmp)
hfontOld = SelectObject(hdcSTMessage, hfontTmp);
GetTextExtentPoint32(hdcSTMessage, (LPSTR)lParam, lstrlen((LPSTR)lParam), &sizeString);
SelectObject(hdcSTMessage, hfontOld);
DeleteObject(hfontTmp);
ReleaseDC(hSTMessage, hdcSTMessage);
SetWindowPos(hDlg, HWND_TOP,
(dwScreenX/2)-((sizeString.cx + 40)/2), (dwScreenY/2)-((sizeString.cy + 40)/2),
sizeString.cx + 40, sizeString.cy + 40,
SWP_SHOWWINDOW);
if(GetClientRect(hDlg, &rDlg))
SetWindowPos(hSTMessage,
HWND_TOP,
rDlg.left,
rDlg.top,
rDlg.right,
rDlg.bottom,
SWP_SHOWWINDOW);
for(i = 0; i < lstrlen((LPSTR)lParam); i++)
{
if((((LPSTR)lParam)[i] == '\r') || (((LPSTR)lParam)[i] == '\n'))
((LPSTR)lParam)[i] = ' ';
}
SetDlgItemText(hDlg, IDC_MESSAGE, (LPSTR)lParam);
break;
}
break;
}
return(0);
}
void ProcessWindowsMessages()
{
MSG msg;
while(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void ShowMessage(LPSTR szMessage, BOOL bShow)
{
char szBuf[MAX_BUF];
if(ugUninstall.mode != SILENT)
{
if((bShow) && (hDlgMessage == NULL))
{
ZeroMemory(szBuf, sizeof(szBuf));
GetPrivateProfileString("Messages", "MB_MESSAGE_STR", "", szBuf, sizeof(szBuf), szFileIniUninstall);
hDlgMessage = InstantiateDialog(hWndMain, DLG_MESSAGE, szBuf, DlgProcMessage);
SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage);
}
else if(!bShow && hDlgMessage)
{
DestroyWindow(hDlgMessage);
hDlgMessage = NULL;
}
}
}
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc)
{
char szBuf[MAX_BUF];
HWND hDlg = NULL;
if((hDlg = CreateDialog(hInst, MAKEINTRESOURCE(dwDlgID), hParent, wpDlgProc)) == NULL)
{
char szEDialogCreate[MAX_BUF];
if(GetPrivateProfileString("Messages", "ERROR_DIALOG_CREATE", "", szEDialogCreate, sizeof(szEDialogCreate), szFileIniUninstall))
{
wsprintf(szBuf, szEDialogCreate, szTitle);
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
return(hDlg);
}

Просмотреть файл

@ -0,0 +1,40 @@
/* -*- 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 DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcWhatToDo(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
void ParseAllUninstallLogs();
void ParseDefaultsInfo();
void SetDefault();
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
void ShowMessage(LPSTR szMessage, BOOL bShow);
void ProcessWindowsMessages(void);
#endif

Просмотреть файл

@ -0,0 +1,63 @@
/* -*- 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 "uninstall.h"
/* external global variables */
extern HINSTANCE hInst;
extern HANDLE hAccelTable;
extern HWND hDlgUninstall;
extern HWND hDlgMessage;
extern HWND hWndMain;
extern LPSTR szEGlobalAlloc;
extern LPSTR szEStringLoad;
extern LPSTR szEDllLoad;
extern LPSTR szEStringNull;
extern LPSTR szTempSetupPath;
extern LPSTR szClassName;
extern LPSTR szUninstallDir;
extern LPSTR szTempDir;
extern LPSTR szOSTempDir;
extern LPSTR szFileIniUninstall;
extern LPSTR szFileIniDefaultsInfo;
extern LPSTR gszSharedFilename;
extern ULONG ulOSType;
extern DWORD dwScreenX;
extern DWORD dwScreenY;
extern DWORD gdwWhatToDo;
extern BOOL gbAllowMultipleInstalls;
extern uninstallGen ugUninstall;
extern diU diUninstall;
#endif

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,106 @@
/* -*- 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_
#include <windows.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 InitApplication(HINSTANCE hInstance);
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);
void GetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, LPSTR szReturnValue, DWORD dwSize);
void SetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, DWORD dwType, LPSTR szData, DWORD dwSize);
void SetWinRegNumValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName, DWORD dwData);
HRESULT InitUninstallGeneral(void);
HRESULT InitDlgUninstall(diU *diDialog);
sil *CreateSilNode();
void SilNodeInsert(sil *silHead, sil *silTemp);
void SilNodeDelete(sil *silTemp);
void DeInitialize(void);
void DeInitDlgUninstall(diU *diDialog);
void DetermineOSVersion(void);
void DeInitILomponents(void);
void DeInitUninstallGeneral(void);
HRESULT ParseUninstallIni();
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);
HRESULT FileExists(LPSTR szFile);
BOOL IsWin95Debute(void);
HRESULT CheckInstances();
BOOL GetFileVersion(LPSTR szFile, verBlock *vbVersion);
BOOL CheckLegacy(HWND hDlg);
int CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew);
void RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize);
int MozCopyStr(LPSTR szSrc, LPSTR szDest, DWORD dwDestBufSize);
LPSTR GetFirstSpace(LPSTR lpszString);
LPSTR GetFirstNonSpace(LPSTR lpszString);
LPSTR MozStrChar(LPSTR lpszString, char c);
int GetArgC(LPSTR lpszCommandLine);
LPSTR GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize);
DWORD ParseCommandLine(LPSTR lpszCmdLine);
void SetUninstallRunMode(LPSTR szMode);
void Delay(DWORD dwSeconds);
HRESULT GetAppPath();
DWORD CleanupAppList();
DWORD ProcessAppItem(HKEY hkRoot, LPSTR szKeyAppList, LPSTR szAppID);
void RemovePathToExeXX(HKEY hkRootKey, LPSTR szKey, DWORD dwIndex, const DWORD dwUpperLimit);
HRESULT GetUninstallLogPath();
BOOL WinRegNameExists(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
void DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
BOOL IsPathWithinWindir(char *aTargetPath);
void VerifyAndDeleteInstallationFolder(void);
#endif /* _EXTRA_H_ */

Просмотреть файл

@ -0,0 +1,393 @@
/* -*- 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 "ifuncns.h"
#include "extra.h"
BOOL SearchForUninstallKeys(char *szStringToMatch)
{
char szBuf[MAX_BUF];
char szStringToMatchLowerCase[MAX_BUF];
char szBufKey[MAX_BUF];
char szSubKey[MAX_BUF];
HKEY hkHandle;
BOOL bFound;
DWORD dwIndex;
DWORD dwSubKeySize;
DWORD dwTotalSubKeys;
DWORD dwTotalValues;
FILETIME ftLastWriteFileTime;
char szWRMSUninstallKeyPath[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
char szWRMSUninstallName[] = "UninstallString";
lstrcpyn(szStringToMatchLowerCase, szStringToMatch, sizeof(szStringToMatchLowerCase));
CharLower(szStringToMatchLowerCase);
bFound = FALSE;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, szWRMSUninstallKeyPath, 0, KEY_READ, &hkHandle) != ERROR_SUCCESS)
return(bFound);
dwTotalSubKeys = 0;
dwTotalValues = 0;
RegQueryInfoKey(hkHandle, NULL, NULL, NULL, &dwTotalSubKeys, NULL, NULL, &dwTotalValues, NULL, NULL, NULL, NULL);
for(dwIndex = 0; dwIndex < dwTotalSubKeys; dwIndex++)
{
dwSubKeySize = sizeof(szSubKey);
if(RegEnumKeyEx(hkHandle, dwIndex, szSubKey, &dwSubKeySize, NULL, NULL, NULL, &ftLastWriteFileTime) == ERROR_SUCCESS)
{
wsprintf(szBufKey, "%s\\%s", szWRMSUninstallKeyPath, szSubKey);
GetWinReg(HKEY_LOCAL_MACHINE, szBufKey, szWRMSUninstallName, szBuf, sizeof(szBuf));
CharLower(szBuf);
if(strstr(szBuf, szStringToMatchLowerCase) != NULL)
{
bFound = TRUE;
/* found one subkey. break out of the for() loop */
break;
}
}
}
RegCloseKey(hkHandle);
return(bFound);
}
HRESULT FileMove(LPSTR szFrom, LPSTR szTo)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szFromDir[MAX_BUF];
char szFromTemp[MAX_BUF];
char szToTemp[MAX_BUF];
char szBuf[MAX_BUF];
BOOL bFound;
/* From file path exists and To file path does not exist */
if((FileExists(szFrom)) && (!FileExists(szTo)))
{
MoveFile(szFrom, szTo);
return(FO_SUCCESS);
}
/* From file path exists and To file path exists */
if(FileExists(szFrom) && FileExists(szTo))
{
/* Since the To file path exists, assume it to be a directory and proceed. */
/* We don't care if it's a file. If it is a file, then config.ini needs to be */
/* corrected to remove the file before attempting a MoveFile(). */
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
ParsePath(szFrom, szBuf, MAX_BUF, PP_FILENAME_ONLY);
lstrcat(szToTemp, szBuf);
MoveFile(szFrom, szToTemp);
return(FO_SUCCESS);
}
ParsePath(szFrom, szFromDir, MAX_BUF, PP_PATH_ONLY);
if((hFile = FindFirstFile(szFrom, &fdFile)) == INVALID_HANDLE_VALUE)
bFound = FALSE;
else
bFound = TRUE;
while(bFound)
{
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
/* create full path string including filename for source */
lstrcpy(szFromTemp, szFromDir);
AppendBackSlash(szFromTemp, sizeof(szFromTemp));
lstrcat(szFromTemp, fdFile.cFileName);
/* create full path string including filename for destination */
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
lstrcat(szToTemp, fdFile.cFileName);
MoveFile(szFromTemp, szToTemp);
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
return(FO_SUCCESS);
}
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szFromDir[MAX_BUF];
char szFromTemp[MAX_BUF];
char szToTemp[MAX_BUF];
char szBuf[MAX_BUF];
BOOL bFound;
if(FileExists(szFrom))
{
/* The file in the From file path exists */
ParsePath(szFrom, szBuf, MAX_BUF, PP_FILENAME_ONLY);
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
lstrcat(szToTemp, szBuf);
CopyFile(szFrom, szToTemp, bFailIfExists);
return(FO_SUCCESS);
}
/* The file in the From file path does not exist. Assume to contain wild args and */
/* proceed acordingly. */
ParsePath(szFrom, szFromDir, MAX_BUF, PP_PATH_ONLY);
if((hFile = FindFirstFile(szFrom, &fdFile)) == INVALID_HANDLE_VALUE)
bFound = FALSE;
else
bFound = TRUE;
while(bFound)
{
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
/* create full path string including filename for source */
lstrcpy(szFromTemp, szFromDir);
AppendBackSlash(szFromTemp, sizeof(szFromTemp));
lstrcat(szFromTemp, fdFile.cFileName);
/* create full path string including filename for destination */
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
lstrcat(szToTemp, fdFile.cFileName);
CopyFile(szFromTemp, szToTemp, bFailIfExists);
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
return(FO_SUCCESS);
}
HRESULT CreateDirectoriesAll(char* szPath)
{
int i;
int iLen = lstrlen(szPath);
char szCreatePath[MAX_BUF];
HRESULT hrResult;
ZeroMemory(szCreatePath, MAX_BUF);
memcpy(szCreatePath, szPath, iLen);
for(i = 0; i < iLen; i++)
{
if((iLen > 1) &&
((i != 0) && ((szPath[i] == '\\') || (szPath[i] == '/'))) &&
(!((szPath[0] == '\\') && (i == 1)) && !((szPath[1] == ':') && (i == 2))))
{
szCreatePath[i] = '\0';
hrResult = CreateDirectory(szCreatePath, NULL);
szCreatePath[i] = szPath[i];
}
}
return(hrResult);
}
HRESULT FileDelete(LPSTR szDestination)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szBuf[MAX_BUF];
char szPathOnly[MAX_BUF];
BOOL bFound;
if(FileExists(szDestination))
{
/* The file in the From file path exists */
DeleteFile(szDestination);
return(FO_SUCCESS);
}
/* The file in the From file path does not exist. Assume to contain wild args and */
/* proceed acordingly. */
ParsePath(szDestination, szPathOnly, MAX_BUF, PP_PATH_ONLY);
if((hFile = FindFirstFile(szDestination, &fdFile)) == INVALID_HANDLE_VALUE)
bFound = FALSE;
else
bFound = TRUE;
while(bFound)
{
if(!(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
lstrcpy(szBuf, szPathOnly);
AppendBackSlash(szBuf, sizeof(szBuf));
lstrcat(szBuf, fdFile.cFileName);
DeleteFile(szBuf);
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
return(FO_SUCCESS);
}
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szDestTemp[MAX_BUF];
BOOL bFound;
if(!FileExists(szDestination))
return(FO_SUCCESS);
if(bRemoveSubdirs == TRUE)
{
lstrcpy(szDestTemp, szDestination);
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
lstrcat(szDestTemp, "*");
bFound = TRUE;
hFile = FindFirstFile(szDestTemp, &fdFile);
while((hFile != INVALID_HANDLE_VALUE) && (bFound == TRUE))
{
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
/* create full path */
lstrcpy(szDestTemp, szDestination);
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
lstrcat(szDestTemp, fdFile.cFileName);
if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
DirectoryRemove(szDestTemp, bRemoveSubdirs);
}
else
{
DeleteFile(szDestTemp);
}
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
}
RemoveDirectory(szDestination);
return(FO_SUCCESS);
}
HKEY ParseRootKey(LPSTR szRootKey)
{
HKEY hkRootKey;
if(lstrcmpi(szRootKey, "HKEY_CURRENT_CONFIG") == 0)
hkRootKey = HKEY_CURRENT_CONFIG;
else if(lstrcmpi(szRootKey, "HKEY_CURRENT_USER") == 0)
hkRootKey = HKEY_CURRENT_USER;
else if(lstrcmpi(szRootKey, "HKEY_LOCAL_MACHINE") == 0)
hkRootKey = HKEY_LOCAL_MACHINE;
else if(lstrcmpi(szRootKey, "HKEY_USERS") == 0)
hkRootKey = HKEY_USERS;
else if(lstrcmpi(szRootKey, "HKEY_PERFORMANCE_DATA") == 0)
hkRootKey = HKEY_PERFORMANCE_DATA;
else if(lstrcmpi(szRootKey, "HKEY_DYN_DATA") == 0)
hkRootKey = HKEY_DYN_DATA;
else /* HKEY_CLASSES_ROOT */
hkRootKey = HKEY_CLASSES_ROOT;
return(hkRootKey);
}
LPSTR GetStringRootKey(HKEY hkRootKey, LPSTR szString, DWORD dwStringSize)
{
if(hkRootKey == HKEY_CURRENT_CONFIG)
{
if(sizeof("HKEY_CURRENT_CONFIG") <= dwStringSize)
lstrcpy(szString, "HKEY_CURRENT_CONFIG");
else
return(NULL);
}
else if(hkRootKey == HKEY_CURRENT_USER)
{
if(sizeof("HKEY_CURRENT_USER") <= dwStringSize)
lstrcpy(szString, "HKEY_CURRENT_USER");
else
return(NULL);
}
else if(hkRootKey == HKEY_LOCAL_MACHINE)
{
if(sizeof("HKEY_LOCAL_MACHINE") <= dwStringSize)
lstrcpy(szString, "HKEY_LOCAL_MACHINE");
else
return(NULL);
}
else if(hkRootKey == HKEY_USERS)
{
if(sizeof("HKEY_USERS") <= dwStringSize)
lstrcpy(szString, "HKEY_USERS");
else
return(NULL);
}
else if(hkRootKey == HKEY_PERFORMANCE_DATA)
{
if(sizeof("HKEY_PERFORMANCE_DATA") <= dwStringSize)
lstrcpy(szString, "HKEY_PERFORMANCE_DATA");
else
return(NULL);
}
else if(hkRootKey == HKEY_DYN_DATA)
{
if(sizeof("HKEY_DYN_DATA") <= dwStringSize)
lstrcpy(szString, "HKEY_DYN_DATA");
else
return(NULL);
}
else
{
if(sizeof("HKEY_CLASSES_ROOT") <= dwStringSize)
lstrcpy(szString, "HKEY_CLASSES_ROOT");
else
return(NULL);
}
return(szString);
}
BOOL WinRegKeyExists(HKEY hkRootKey, LPSTR szKey)
{
HKEY hkResult;
BOOL bKeyExists = FALSE;
if(RegOpenKeyEx(hkRootKey, szKey, 0, KEY_READ, &hkResult) == ERROR_SUCCESS)
{
bKeyExists = TRUE;
RegCloseKey(hkResult);
}
return(bKeyExists);
}

Просмотреть файл

@ -0,0 +1,41 @@
/* -*- 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_
#include "uninstall.h"
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo);
HRESULT FileMove(LPSTR szFrom, LPSTR szTo);
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists);
HRESULT FileDelete(LPSTR szDestination);
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs);
HRESULT CreateDirectoriesAll(char* szPath);
HKEY ParseRootKey(LPSTR szRootKey);
LPSTR GetStringRootKey(HKEY hkRootKey, LPSTR szString, DWORD dwStringSize);
BOOL SearchForUninstallKeys(char *szStringToMatch);
BOOL WinRegKeyExists(HKEY hkRootKey, LPSTR szKey);
#endif

Просмотреть файл

@ -0,0 +1,45 @@
/* -*- 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 _LOGKEYS_H_
#define _LOGKEYS_H_
#define KEY_DO_NOT_UNINSTALL "(*dnu*) "
#define KEY_INSTALLING "installing: "
#define KEY_INSTALLING_SHARED_FILE "installing shared file: "
#define KEY_REPLACING "replacing: "
#define KEY_REPLACING_SHARED_FILE "replacing shared file: "
#define KEY_STORE_REG_STRING "store registry value string: "
#define KEY_STORE_REG_NUMBER "store registry value number: "
#define KEY_CREATE_REG_KEY "create registry key: "
#define KEY_COPY_FILE "copy file: "
#define KEY_MOVE_FILE "move file: "
#define KEY_RENAME_FILE "rename file: "
#define KEY_CREATE_FOLDER "create folder: "
#define KEY_RENAME_DIR "rename dir: "
#define KEY_WINDOWS_SHORTCUT "windows shortcut: "
#define KEY_WINDOWS_REGISTER_SERVER "windows register server: "
#define KEY_UNINSTALL_COMMAND "uninstall command: "
#endif

Просмотреть файл

@ -0,0 +1,791 @@
/* -*- 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 "logkeys.h"
#include "parser.h"
#include "extra.h"
#include "ifuncns.h"
#include "dialogs.h"
#define KEY_SHARED_DLLS "Software\\Microsoft\\Windows\\CurrentVersion\\SharedDlls"
BOOL DeleteOrDelayUntilReboot(LPSTR szFile)
{
FILE *ofp;
char szWinDir[MAX_BUF];
char szWininitFile[MAX_BUF];
BOOL bDelayDelete = FALSE;
BOOL bWriteRenameSection;
FileDelete(szFile);
if(FileExists(szFile))
{
bDelayDelete = TRUE;
if(ulOSType & OS_NT)
MoveFileEx(szFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
else
{
if(GetWindowsDirectory(szWinDir, sizeof(szWinDir)) == 0)
return(FALSE);
lstrcpy(szWininitFile, szWinDir);
AppendBackSlash(szWininitFile, sizeof(szWininitFile));
lstrcat(szWininitFile, "wininit.ini");
if(FileExists(szWininitFile) == FALSE)
bWriteRenameSection = TRUE;
else
bWriteRenameSection = FALSE;
if((ofp = fopen(szWininitFile, "a+")) == NULL)
return(FALSE);
if(bWriteRenameSection == TRUE)
fprintf(ofp, "[RENAME]\n");
fprintf(ofp, "NUL=%s\n", szFile);
fclose(ofp);
}
}
else
bDelayDelete = FALSE;
return(bDelayDelete);
}
void RemoveUninstaller(LPSTR szUninstallFilename)
{
char szBuf[MAX_BUF];
char szWinDir[MAX_BUF];
char szUninstallFile[MAX_BUF];
if(SearchForUninstallKeys(szUninstallFilename))
/* Found the uninstall file name in the windows registry uninstall
* key sections. We should not try to delete ourselves. */
return;
if(GetWindowsDirectory(szWinDir, sizeof(szWinDir)) == 0)
return;
lstrcpy(szBuf, szWinDir);
AppendBackSlash(szBuf, sizeof(szBuf));
lstrcat(szBuf, szUninstallFilename);
GetShortPathName(szBuf, szUninstallFile, sizeof(szUninstallFile));
DeleteOrDelayUntilReboot(szUninstallFile);
}
sil *InitSilNodes(char *szInFile)
{
FILE *ifp;
char szLineRead[MAX_BUF];
sil *silTemp;
sil *silHead;
ULONGLONG ullLineCount;
if(FileExists(szInFile) == FALSE)
return(NULL);
ullLineCount = 0;
silHead = NULL;
if((ifp = fopen(szInFile, "r")) == NULL)
exit(1);
while(fgets(szLineRead, MAX_BUF, ifp) != NULL)
{
silTemp = CreateSilNode();
silTemp->ullLineNumber = ++ullLineCount;
lstrcpy(silTemp->szLine, szLineRead);
if(silHead == NULL)
{
silHead = silTemp;
}
else
{
SilNodeInsert(silHead, silTemp);
}
ProcessWindowsMessages();
}
fclose(ifp);
return(silHead);
}
void DeInitSilNodes(sil **silHead)
{
sil *silTemp;
if(*silHead == NULL)
{
return;
}
else if(((*silHead)->Prev == NULL) || ((*silHead)->Prev == *silHead))
{
SilNodeDelete(*silHead);
return;
}
else
{
silTemp = (*silHead)->Prev;
}
while(silTemp != *silHead)
{
SilNodeDelete(silTemp);
silTemp = (*silHead)->Prev;
ProcessWindowsMessages();
}
SilNodeDelete(silTemp);
}
void DeleteWinRegKey(HKEY hkRootKey, LPSTR szKey, BOOL bAbsoluteDelete)
{
HKEY hkResult;
DWORD dwErr;
DWORD dwTotalSubKeys;
DWORD dwTotalValues;
DWORD dwSubKeySize;
FILETIME ftLastWriteFileTime;
char szSubKey[MAX_BUF];
char szNewKey[MAX_BUF];
long lRv;
dwErr = RegOpenKeyEx(hkRootKey, szKey, 0, KEY_QUERY_VALUE, &hkResult);
if(dwErr == ERROR_SUCCESS)
{
dwTotalSubKeys = 0;
dwTotalValues = 0;
RegQueryInfoKey(hkResult, NULL, NULL, NULL, &dwTotalSubKeys, NULL, NULL, &dwTotalValues, NULL, NULL, NULL, NULL);
RegCloseKey(hkResult);
if(((dwTotalSubKeys == 0) && (dwTotalValues == 0)) || bAbsoluteDelete)
{
if(dwTotalSubKeys && bAbsoluteDelete)
{
do
{
dwSubKeySize = sizeof(szSubKey);
lRv = 0;
if(RegOpenKeyEx(hkRootKey, szKey, 0, KEY_READ, &hkResult) == ERROR_SUCCESS)
{
if((lRv = RegEnumKeyEx(hkResult, 0, szSubKey, &dwSubKeySize, NULL, NULL, NULL, &ftLastWriteFileTime)) == ERROR_SUCCESS)
{
RegCloseKey(hkResult);
lstrcpy(szNewKey, szKey);
AppendBackSlash(szNewKey, sizeof(szNewKey));
lstrcat(szNewKey, szSubKey);
DeleteWinRegKey(hkRootKey, szNewKey, bAbsoluteDelete);
}
else
RegCloseKey(hkResult);
}
} while(lRv != ERROR_NO_MORE_ITEMS);
}
dwErr = RegDeleteKey(hkRootKey, szKey);
}
}
}
void ParseForUninstallCommand(LPSTR szString, LPSTR szKeyStr, LPSTR szFile, DWORD dwFileBufSize, LPSTR szParam, DWORD dwParamBufSize)
{
LPSTR szFirstNonSpace;
LPSTR szBeginParamStr;
LPSTR szEndOfFilePath;
LPSTR szEndQuote;
char *cmdStart;
int length;
ZeroMemory(szFile, dwFileBufSize);
ZeroMemory(szParam, dwParamBufSize);
length = lstrlen(szString);
if(szString[length - 1] == '\n')
szString[length - 1] = '\0';
// get to the beginning of the command given an install log string
cmdStart = szString + lstrlen(szKeyStr);
if((szFirstNonSpace = GetFirstNonSpace(cmdStart)) != NULL)
{
if(*szFirstNonSpace == '\"')
{
++szFirstNonSpace;
// found a beginning quote, look for the ending quote now
if((szEndQuote = MozStrChar(szFirstNonSpace, '\"')) != NULL)
{
// found ending quote. copy file path string *not* including the quotes
*szEndQuote = '\0';
MozCopyStr(szFirstNonSpace, szFile, dwFileBufSize);
// get the params substring now
if((szBeginParamStr = GetFirstNonSpace(++szEndQuote)) != NULL)
{
// the params string should be the first non space char after the
// quoted file path string to the end of the string.
MozCopyStr(szBeginParamStr, szParam, dwParamBufSize);
}
}
else
{
// could not find the ending quote. assume the _entire_ string is the file path
MozCopyStr(szFirstNonSpace, szFile, dwFileBufSize);
}
}
else
{
// no beginning quote found. file path is up to the first space character found
if((szEndOfFilePath = GetFirstSpace(szFirstNonSpace)) != NULL)
{
// found the first space char
*szEndOfFilePath = '\0';
MozCopyStr(szFirstNonSpace, szFile, dwFileBufSize);
// get the params substring now
if((szBeginParamStr = GetFirstNonSpace(++szEndOfFilePath)) != NULL)
{
// the params string should be the first non space char after the
// quoted file path string to the end of the string.
MozCopyStr(szBeginParamStr, szParam, dwParamBufSize);
}
}
else
{
// no space char found. assume the _entire_ string is the file path
MozCopyStr(szFirstNonSpace, szFile, dwFileBufSize);
}
}
}
}
void ParseForFile(LPSTR szString, LPSTR szKeyStr, LPSTR szFile, DWORD dwShortFilenameBufSize)
{
int iLen;
LPSTR szFirstNonSpace;
char szBuf[MAX_BUF];
if((szFirstNonSpace = GetFirstNonSpace(&(szString[lstrlen(szKeyStr)]))) != NULL)
{
iLen = lstrlen(szFirstNonSpace);
if(szFirstNonSpace[iLen - 1] == '\n')
szFirstNonSpace[iLen -1] = '\0';
if(lstrcmpi(szKeyStr, KEY_WINDOWS_SHORTCUT) == 0)
{
lstrcpy(szBuf, szFirstNonSpace);
lstrcat(szBuf, ".lnk");
szFirstNonSpace = szBuf;
}
lstrcpy(szFile, szFirstNonSpace);
}
}
void ParseForCopyFile(LPSTR szString, LPSTR szKeyStr, LPSTR szFile, DWORD dwShortFilenameBufSize)
{
int iLen;
LPSTR szFirstNonSpace;
LPSTR szSubStr = NULL;
char szBuf[MAX_BUF];
if((szSubStr = strstr(szString, " to ")) != NULL)
{
if((szFirstNonSpace = GetFirstNonSpace(&(szSubStr[lstrlen(" to ")]))) != NULL)
{
iLen = lstrlen(szFirstNonSpace);
if(szFirstNonSpace[iLen - 1] == '\n')
szFirstNonSpace[iLen -1] = '\0';
if(lstrcmpi(szKeyStr, KEY_WINDOWS_SHORTCUT) == 0)
{
lstrcpy(szBuf, szFirstNonSpace);
lstrcat(szBuf, ".lnk");
szFirstNonSpace = szBuf;
}
lstrcpy(szFile, szFirstNonSpace);
}
}
}
HRESULT ParseForWinRegInfo(LPSTR szString, LPSTR szKeyStr, LPSTR szRootKey, DWORD dwRootKeyBufSize, LPSTR szKey, DWORD dwKeyBufSize, LPSTR szName, DWORD dwNameBufSize)
{
int i;
int iLen;
int iBrackets;
char szStrCopy[MAX_BUF];
LPSTR szFirstNonSpace;
LPSTR szFirstBackSlash;
BOOL bFoundOpenBracket;
BOOL bFoundName;
*szRootKey = '\0';
*szKey = '\0';
*szName = '\0';
lstrcpy(szStrCopy, szString);
if((szFirstNonSpace = GetFirstNonSpace(&(szStrCopy[lstrlen(szKeyStr)]))) != NULL)
{
iLen = lstrlen(szFirstNonSpace);
if(szFirstNonSpace[iLen - 1] == '\n')
{
szFirstNonSpace[--iLen] = '\0';
}
szFirstBackSlash = strstr(szFirstNonSpace, "\\");
if(!szFirstBackSlash)
return(WIZ_ERROR_PARSING_UNINST_STRS);
szFirstBackSlash[0] = '\0';
lstrcpy(szRootKey, szFirstNonSpace);
szFirstNonSpace = &(szFirstBackSlash[1]);
iLen = lstrlen(szFirstNonSpace);
iBrackets = 0;
bFoundName = FALSE;
bFoundOpenBracket = FALSE;
for(i = iLen - 1; i >= 0; i--)
{
if(bFoundName == FALSE)
{
/* Find the Name created in the Windows registry key.
* Since the Name can contain '[' and ']', we have to
* parse for the brackets that denote the Name string in
* szFirstNonSpace. It parses from right to left.
*/
if(szFirstNonSpace[i] == ']')
{
if(iBrackets == 0)
szFirstNonSpace[i] = '\0';
++iBrackets;
}
else if(szFirstNonSpace[i] == '[')
{
bFoundOpenBracket = TRUE;
--iBrackets;
}
if((bFoundOpenBracket) && (iBrackets == 0))
{
lstrcpy(szName, &(szFirstNonSpace[i + 1]));
bFoundName = TRUE;
}
}
else
{
/* locate the first non space to the left of the last '[' */
if(!isspace(szFirstNonSpace[i]))
{
szFirstNonSpace[i + 1] = '\0';
lstrcpy(szKey, szFirstNonSpace);
break;
}
}
}
}
return(WIZ_OK);
}
DWORD DecrementSharedFileCounter(char *file)
{
HKEY keyHandle = 0;
LONG result;
DWORD type = REG_DWORD;
DWORD valbuf = 0;
DWORD valbufsize;
DWORD rv = 0;
valbufsize = sizeof(DWORD);
result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, 0, KEY_READ | KEY_WRITE, &keyHandle);
if(ERROR_SUCCESS == result)
{
result = RegQueryValueEx(keyHandle, file, NULL, &type, (LPBYTE)&valbuf, (LPDWORD)&valbufsize);
if((ERROR_SUCCESS == result) && (type == REG_DWORD))
{
rv = --valbuf;
}
RegSetValueEx(keyHandle, file, 0, REG_DWORD, (LPBYTE)&valbuf, valbufsize);
RegCloseKey(keyHandle);
}
return(rv);
}
int GetSharedFileCount(char *file)
{
HKEY keyHandle = 0;
LONG result;
DWORD type = REG_DWORD;
DWORD valbuf = 0;
DWORD valbufsize;
int rv = -999;
valbufsize = sizeof(DWORD);
result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, 0, KEY_READ, &keyHandle);
if(ERROR_SUCCESS == result)
{
result = RegQueryValueEx(keyHandle, file, NULL, &type, (LPBYTE)&valbuf, (LPDWORD)&valbufsize);
if((ERROR_SUCCESS == result) && (type == REG_DWORD))
rv = valbuf;
RegCloseKey(keyHandle);
}
return(rv);
}
BOOL UnregisterServer(char *file)
{
FARPROC DllUnReg;
HINSTANCE hLib;
BOOL bFailed = FALSE;
if(file != NULL)
{
if((hLib = LoadLibraryEx(file, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) != NULL)
{
if((DllUnReg = GetProcAddress(hLib, "DllUnregisterServer")) != NULL)
DllUnReg();
else
bFailed = TRUE;
FreeLibrary(hLib);
}
else
bFailed = TRUE;
}
else
bFailed = TRUE;
return(bFailed);
}
BOOL DetermineUnRegisterServer(sil *silInstallLogHead, LPSTR szFile)
{
sil *silInstallLogTemp;
int iSharedFileCount;
char szLCLine[MAX_BUF];
char szLCFile[MAX_BUF];
BOOL bRv;
bRv = FALSE;
if(silInstallLogHead != NULL)
{
silInstallLogTemp = silInstallLogHead;
iSharedFileCount = GetSharedFileCount(szFile);
lstrcpy(szLCFile, szFile);
CharLowerBuff(szLCFile, sizeof(szLCLine));
do
{
silInstallLogTemp = silInstallLogTemp->Prev;
lstrcpy(szLCLine, silInstallLogTemp->szLine);
CharLowerBuff(szLCLine, sizeof(szLCLine));
if((strstr(szLCLine, szLCFile) != NULL) &&
(strstr(szLCLine, KEY_INSTALLING_SHARED_FILE) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
--iSharedFileCount;
}
else if((strstr(szLCLine, szLCFile) != NULL) &&
(strstr(szLCLine, KEY_INSTALLING) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
bRv = TRUE;
break;
}
else if((strstr(szLCLine, szLCFile) != NULL) &&
(strstr(szLCLine, KEY_REPLACING_SHARED_FILE) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
--iSharedFileCount;
}
else if((strstr(szLCLine, szLCFile) != NULL) &&
(strstr(szLCLine, KEY_REPLACING) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
bRv = TRUE;
break;
}
else if((strstr(szLCLine, szLCFile) != NULL) &&
(strstr(szLCLine, KEY_COPY_FILE) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
bRv = TRUE;
break;
}
ProcessWindowsMessages();
} while(silInstallLogTemp != silInstallLogHead);
}
if((iSharedFileCount <= 0) && (iSharedFileCount != -999))
bRv = TRUE;
return(bRv);
}
DWORD Uninstall(sil* silInstallLogHead)
{
sil *silInstallLogTemp;
LPSTR szSubStr;
char szLCLine[MAX_BUF];
char szKey[MAX_BUF];
char szRootKey[MAX_BUF];
char szName[MAX_BUF];
char szFile[MAX_BUF];
char szParams[MAX_BUF];
HKEY hkRootKey;
int rv;
if(silInstallLogHead != NULL)
{
silInstallLogTemp = silInstallLogHead;
do
{
silInstallLogTemp = silInstallLogTemp->Prev;
lstrcpy(szLCLine, silInstallLogTemp->szLine);
CharLowerBuff(szLCLine, sizeof(szLCLine));
if(((szSubStr = strstr(szLCLine, KEY_WINDOWS_REGISTER_SERVER)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
ParseForFile(szSubStr, KEY_WINDOWS_REGISTER_SERVER, szFile, sizeof(szFile));
if(DetermineUnRegisterServer(silInstallLogHead, szFile) == TRUE)
UnregisterServer(szFile);
}
else if(((szSubStr = strstr(szLCLine, KEY_INSTALLING_SHARED_FILE)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
/* check for "Installing Shared File: " string and delete the file */
ParseForFile(szSubStr, KEY_INSTALLING_SHARED_FILE, szFile, sizeof(szFile));
if(DecrementSharedFileCounter(szFile) == 0)
{
if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL))
{
MessageBeep(MB_ICONEXCLAMATION);
gdwWhatToDo = DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_WHAT_TO_DO), hDlgUninstall, DlgProcWhatToDo, (LPARAM)szFile);
}
if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL))
{
DeleteWinRegValue(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, szFile);
DeleteOrDelayUntilReboot(szFile);
}
else if(gdwWhatToDo == WTD_CANCEL)
return(WTD_CANCEL);
}
}
else if(((szSubStr = strstr(szLCLine, KEY_INSTALLING)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
/* check for "Installing: " string and delete the file */
ParseForFile(szSubStr, KEY_INSTALLING, szFile, sizeof(szFile));
DeleteOrDelayUntilReboot(szFile);
}
else if(((szSubStr = strstr(szLCLine, KEY_REPLACING_SHARED_FILE)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
/* check for "Replacing Shared File: " string and delete the file */
ParseForFile(szSubStr, KEY_REPLACING_SHARED_FILE, szFile, sizeof(szFile));
if(DecrementSharedFileCounter(szFile) == 0)
{
if((gdwWhatToDo != WTD_NO_TO_ALL) && (gdwWhatToDo != WTD_YES_TO_ALL))
gdwWhatToDo = DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_WHAT_TO_DO), hDlgUninstall, DlgProcWhatToDo, (LPARAM)szFile);
if((gdwWhatToDo == WTD_YES) || (gdwWhatToDo == WTD_YES_TO_ALL))
{
DeleteWinRegValue(HKEY_LOCAL_MACHINE, KEY_SHARED_DLLS, szFile);
DeleteOrDelayUntilReboot(szFile);
}
else if(gdwWhatToDo == WTD_CANCEL)
return(WTD_CANCEL);
}
}
else if(((szSubStr = strstr(szLCLine, KEY_REPLACING)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
/* check for "Replacing: " string and delete the file */
ParseForFile(szSubStr, KEY_REPLACING, szFile, sizeof(szFile));
DeleteOrDelayUntilReboot(szFile);
}
else if(((szSubStr = strstr(szLCLine, KEY_STORE_REG_STRING)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
/* check for "Store Registry Value String: " string and remove the key */
rv = ParseForWinRegInfo(szSubStr, KEY_STORE_REG_STRING, szRootKey, sizeof(szRootKey), szKey, sizeof(szKey), szName, sizeof(szName));
if(WIZ_OK == rv)
{
hkRootKey = ParseRootKey(szRootKey);
DeleteWinRegValue(hkRootKey, szKey, szName);
}
}
else if(((szSubStr = strstr(szLCLine, KEY_STORE_REG_NUMBER)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
/* check for "Store Registry Value Number: " string and remove the key */
rv = ParseForWinRegInfo(szSubStr, KEY_STORE_REG_NUMBER, szRootKey, sizeof(szRootKey), szKey, sizeof(szKey), szName, sizeof(szName));
if(WIZ_OK == rv)
{
hkRootKey = ParseRootKey(szRootKey);
DeleteWinRegValue(hkRootKey, szKey, szName);
}
}
else if(((szSubStr = strstr(szLCLine, KEY_CREATE_REG_KEY)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
rv = ParseForWinRegInfo(szSubStr, KEY_CREATE_REG_KEY, szRootKey, sizeof(szRootKey), szKey, sizeof(szKey), szName, sizeof(szName));
if(WIZ_OK == rv)
{
hkRootKey = ParseRootKey(szRootKey);
DeleteWinRegKey(hkRootKey, szKey, FALSE);
}
}
else if(((szSubStr = strstr(szLCLine, KEY_CREATE_FOLDER)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
ParseForFile(szSubStr, KEY_CREATE_FOLDER, szFile, sizeof(szFile));
DirectoryRemove(szFile, FALSE);
}
else if(((szSubStr = strstr(szLCLine, KEY_WINDOWS_SHORTCUT)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
ParseForFile(szSubStr, KEY_WINDOWS_SHORTCUT, szFile, sizeof(szFile));
DeleteOrDelayUntilReboot(szFile);
}
else if(((szSubStr = strstr(szLCLine, KEY_COPY_FILE)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
/* check for "copy file: " string and delete the file */
ParseForCopyFile(szSubStr, KEY_COPY_FILE, szFile, sizeof(szFile));
DeleteOrDelayUntilReboot(szFile);
}
else if(((szSubStr = strstr(szLCLine, KEY_UNINSTALL_COMMAND)) != NULL) &&
(strstr(szLCLine, KEY_DO_NOT_UNINSTALL) == NULL))
{
ParseForUninstallCommand(szSubStr, KEY_UNINSTALL_COMMAND, szFile, sizeof(szFile), szParams, sizeof(szParams));
//execute szFile with szParams here!
if(FileExists(szFile))
WinSpawn(szFile, szParams, NULL, SW_HIDE, TRUE);
}
ProcessWindowsMessages();
} while(silInstallLogTemp != silInstallLogHead);
}
return(0);
}
DWORD GetLogFile(LPSTR szTargetPath, LPSTR szInFilename, LPSTR szOutBuf, DWORD dwOutBufSize)
{
int iFilenameOnlyLen;
char szSearchFilename[MAX_BUF];
char szSearchTargetFullFilename[MAX_BUF];
char szFilenameOnly[MAX_BUF];
char szFilenameExtensionOnly[MAX_BUF];
char szNumber[MAX_BUF];
long dwNumber;
long dwMaxNumber;
LPSTR szDotPtr;
HANDLE hFile;
WIN32_FIND_DATA fdFile;
BOOL bFound;
if(FileExists(szTargetPath))
{
/* zero out the memory */
ZeroMemory(szOutBuf, dwOutBufSize);
ZeroMemory(szSearchFilename, sizeof(szSearchFilename));
ZeroMemory(szFilenameOnly, sizeof(szFilenameOnly));
ZeroMemory(szFilenameExtensionOnly, sizeof(szFilenameExtensionOnly));
/* parse for the filename w/o extention and also only the extension */
if((szDotPtr = strstr(szInFilename, ".")) != NULL)
{
*szDotPtr = '\0';
lstrcpy(szSearchFilename, szInFilename);
lstrcpy(szFilenameOnly, szInFilename);
lstrcpy(szFilenameExtensionOnly, &szDotPtr[1]);
*szDotPtr = '.';
}
else
{
lstrcpy(szFilenameOnly, szInFilename);
lstrcpy(szSearchFilename, szInFilename);
}
/* create the wild arg filename to search for in the szTargetPath */
lstrcat(szSearchFilename, "*.*");
lstrcpy(szSearchTargetFullFilename, szTargetPath);
AppendBackSlash(szSearchTargetFullFilename, sizeof(szSearchTargetFullFilename));
lstrcat(szSearchTargetFullFilename, szSearchFilename);
iFilenameOnlyLen = lstrlen(szFilenameOnly);
dwNumber = 0;
dwMaxNumber = -1;
/* find the largest numbered filename in the szTargetPath */
if((hFile = FindFirstFile(szSearchTargetFullFilename, &fdFile)) == INVALID_HANDLE_VALUE)
bFound = FALSE;
else
bFound = TRUE;
while(bFound)
{
ZeroMemory(szNumber, sizeof(szNumber));
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
lstrcpy(szNumber, &fdFile.cFileName[iFilenameOnlyLen]);
dwNumber = atoi(szNumber);
if(dwNumber > dwMaxNumber)
dwMaxNumber = dwNumber;
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
lstrcpy(szOutBuf, szTargetPath);
AppendBackSlash(szOutBuf, dwOutBufSize);
lstrcat(szOutBuf, szFilenameOnly);
itoa(dwMaxNumber, szNumber, 10);
lstrcat(szOutBuf, szNumber);
if(*szFilenameExtensionOnly != '\0')
{
lstrcat(szOutBuf, ".");
lstrcat(szOutBuf, szFilenameExtensionOnly);
}
}
else
return(0);
return(FileExists(szOutBuf));
}

Просмотреть файл

@ -0,0 +1,46 @@
/* -*- 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 _PARSER_H_
#define _PARSER_H_
sil *InitSilNodes(char *szFileIni);
void DeInitSilNodes(sil **silHead);
HRESULT FileExists(LPSTR szFile);
DWORD Uninstall(sil* silFile);
void ParseForFile(LPSTR szString, LPSTR szKey, LPSTR szFile, DWORD dwShortFilenameBufSize);
void ParseForCopyFile(LPSTR szString, LPSTR szKeyStr, LPSTR szFile, DWORD dwShortFilenameBufSize);
HRESULT ParseForWinRegInfo(LPSTR szString, LPSTR szKeyStr, LPSTR szRootKey, DWORD dwRootKeyBufSize, LPSTR szKey, DWORD dwKeyBufSize, LPSTR szName, DWORD dwNameBufSize);
void ParseForUninstallCommand(LPSTR szString, LPSTR szKeyStr, LPSTR szFile, DWORD dwFileBufSize, LPSTR szParam, DWORD dwParamBufSize);
void DeleteWinRegKey(HKEY hkRootKey, LPSTR szKey, BOOL bAbsoluteDelete);
DWORD GetLogFile(LPSTR szTargetPath, LPSTR szInFilename, LPSTR szOutBuf, DWORD dwOutBufSize);
void RemoveUninstaller(LPSTR szUninstallFilename);
DWORD DecrementSharedFileCounter(char *file);
BOOL DeleteOrDelayUntilReboot(LPSTR szFile);
BOOL UnregisterServer(char *file);
int GetSharedFileCount(char *file);
BOOL DetermineUnRegisterServer(sil *silInstallLogHead, LPSTR szFile);
#endif

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,587 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Navigator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape Communications Corp. are
* Copyright (C) 1998, 1999, 2000, 2001 Netscape Communications Corp. All
* Rights Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
*/
#include "extern.h"
#include "parser.h"
#include "extra.h"
#include "ifuncns.h"
HKEY hkUnreadMailRootKey = HKEY_CURRENT_USER;
char szUnreadMailKey[] = "Software\\Microsoft\\Windows\\CurrentVersion\\UnreadMail";
char szMozillaDesktopKey[] = "Software\\Mozilla\\Desktop";
char szRDISection[] = "Restore Desktop Integration";
/* structure for use with UnreadMail registry keys */
typedef struct sKeyNode skn;
struct sKeyNode
{
char szKey[MAX_BUF];
skn *Next;
skn *Prev;
};
/* Function that creates an instance of skn */
skn *CreateSknNode()
{
skn *sknNode;
if((sknNode = NS_GlobalAlloc(sizeof(struct sKeyNode))) == NULL)
exit(1);
sknNode->Next = sknNode;
sknNode->Prev = sknNode;
return(sknNode);
}
/* Function that inserts a skn structure into a linked list */
void SknNodeInsert(skn **sknHead, skn *sknTemp)
{
if(*sknHead == NULL)
{
*sknHead = sknTemp;
(*sknHead)->Next = *sknHead;
(*sknHead)->Prev = *sknHead;
}
else
{
sknTemp->Next = *sknHead;
sknTemp->Prev = (*sknHead)->Prev;
(*sknHead)->Prev->Next = sknTemp;
(*sknHead)->Prev = sknTemp;
}
}
/* Function that removes a skn structure from a skn linked list.
* and frees memory. */
void SknNodeDelete(skn *sknTemp)
{
if(sknTemp != NULL)
{
sknTemp->Next->Prev = sknTemp->Prev;
sknTemp->Prev->Next = sknTemp->Next;
sknTemp->Next = NULL;
sknTemp->Prev = NULL;
FreeMemory(&sknTemp);
}
}
/* Function that traverses a skn linked list and deletes each node. */
void DeInitSknList(skn **sknHeadNode)
{
skn *sknTemp;
if(*sknHeadNode == NULL)
return;
sknTemp = (*sknHeadNode)->Prev;
while(sknTemp != *sknHeadNode)
{
SknNodeDelete(sknTemp);
sknTemp = (*sknHeadNode)->Prev;
}
SknNodeDelete(sknTemp);
*sknHeadNode = NULL;
}
/* Function to check if [windir]\mapi32.dll belongs to mozilla or not */
int IsMapiMozMapi(BOOL *bIsMozMapi)
{
HINSTANCE hLib;
char szMapiFilePath[MAX_BUF];
int iRv = WIZ_ERROR_UNDEFINED;
int (PASCAL *GetMapiDllVersion)(void);
char szMapiVersionKey[] = "MAPI version installed";
char szBuf[MAX_BUF];
int iMapiVersionInstalled;
/* Get the Mapi version that we installed from uninstall.ini.
* If there is none set, then return WIZ_ERROR_UNDEFINED. */
GetPrivateProfileString(szRDISection, szMapiVersionKey, "", szBuf, sizeof(szBuf), szFileIniUninstall);
if(*szBuf == '\0')
return(iRv);
iMapiVersionInstalled = atoi(szBuf);
if(GetSystemDirectory(szMapiFilePath, sizeof(szMapiFilePath)) == 0)
return(iRv);
AppendBackSlash(szMapiFilePath, sizeof(szMapiFilePath));
lstrcat(szMapiFilePath, "Mapi32.dll");
if(!FileExists(szMapiFilePath))
iRv = WIZ_FILE_NOT_FOUND;
else if((hLib = LoadLibrary(szMapiFilePath)) != NULL)
{
iRv = WIZ_OK;
*bIsMozMapi = FALSE;
if(((FARPROC)GetMapiDllVersion = GetProcAddress(hLib, "GetMapiDllVersion")) != NULL)
{
if(iMapiVersionInstalled == GetMapiDllVersion())
*bIsMozMapi = TRUE;
}
FreeLibrary(hLib);
}
return(iRv);
}
/* This function parses takes as input a registry key path string beginning
* with HKEY_XXXX (root key) and parses out the sub key path and the root
* key.
*
* It returns the root key as HKEY and the sub key path as char* */
HKEY GetRootKeyAndSubKeyPath(char *szInKeyPath, char *szOutSubKeyPath, DWORD dwOutSubKeyPathSize)
{
char *ptr = szInKeyPath;
HKEY hkRootKey = HKEY_CLASSES_ROOT;
ZeroMemory(szOutSubKeyPath, dwOutSubKeyPathSize);
if(ptr == NULL)
return(hkRootKey);
/* search for the first '\' char */
while(*ptr && (*ptr != '\\'))
++ptr;
if((*ptr == '\0') ||
(*ptr == '\\'))
{
BOOL bPtrModified = FALSE;
if(*ptr == '\\')
{
*ptr = '\0';
bPtrModified = TRUE;
}
hkRootKey = ParseRootKey(szInKeyPath);
if(bPtrModified)
*ptr = '\\';
if((*ptr != '\0') &&
((unsigned)lstrlen(ptr + 1) + 1 <= dwOutSubKeyPathSize))
/* copy only the sub key path after the root key string */
lstrcpy(szOutSubKeyPath, ptr + 1);
}
return(hkRootKey);
}
/* This function checks for nonprintable characters.
* If at least one is found in the input string, it will return TRUE,
* else FALSE */
BOOL CheckForNonPrintableChars(char *szInString)
{
int i;
int iLen;
BOOL bFoundNonPrintableChar = FALSE;
if(!szInString)
return(TRUE);
iLen = lstrlen(szInString);
for(i = 0; i < iLen; i++)
{
if(!isprint(szInString[i]))
{
bFoundNonPrintableChar = TRUE;
break;
}
}
return(bFoundNonPrintableChar);
}
/* This function checks to see if the key path is a ddeexec path. If so,
* it then checks for non printable chars */
BOOL DdeexecCheck(char *szKey, char *szValue)
{
char szKddeexec[] = "shell\\open\\ddeexec";
char szKeyLower[MAX_BUF];
BOOL bPass = TRUE;
lstrcpy(szKeyLower, szKey);
CharLowerBuff(szKeyLower, sizeof(szKeyLower));
if(strstr(szKeyLower, szKddeexec) && CheckForNonPrintableChars(szValue))
bPass = FALSE;
return(bPass);
}
/* This function enumerates HKEY_LOCAL_MACHINE\Sofware\Mozilla\Desktop for
* variable information on what desktop integration was done by the
* browser/mail client.
*
* These variables found cannot be deleted or modified until the enumeration
* is complete, or else this function will fail! */
void RestoreDesktopIntegration()
{
char szVarName[MAX_BUF];
char szValue[MAX_BUF];
char szSubKey[MAX_BUF];
HKEY hkHandle;
DWORD dwIndex;
DWORD dwSubKeySize;
DWORD dwTotalValues;
char szKHKEY[] = "HKEY";
char szKisHandling[] = "isHandling";
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, szMozillaDesktopKey, 0, KEY_READ|KEY_WRITE, &hkHandle) != ERROR_SUCCESS)
return;
dwTotalValues = 0;
RegQueryInfoKey(hkHandle, NULL, NULL, NULL, NULL, NULL, NULL, &dwTotalValues, NULL, NULL, NULL, NULL);
for(dwIndex = 0; dwIndex < dwTotalValues; dwIndex++)
{
/* Enumerate thru all the vars found within the Mozilla Desktop key */
dwSubKeySize = sizeof(szVarName);
if(RegEnumValue(hkHandle, dwIndex, szVarName, &dwSubKeySize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{
if(strnicmp(szVarName, szKHKEY, lstrlen(szKHKEY)) == 0)
{
HKEY hkRootKey;
hkRootKey = GetRootKeyAndSubKeyPath(szVarName, szSubKey, sizeof(szSubKey));
if(*szSubKey != '\0')
{
GetWinReg(HKEY_LOCAL_MACHINE, szMozillaDesktopKey, szVarName, szValue, sizeof(szValue));
if(*szValue != '\0')
{
/* Due to a bug in the browser code that saves the previous HKEY
* value it's trying to replace as garbage chars, we need to try
* to detect it. If found, do not restore it. This bug only
* happens for the saved ddeexec keys. */
if(DdeexecCheck(szSubKey, szValue))
{
/* Restore the previous saved setting here */
SetWinReg(hkRootKey,
szSubKey,
NULL,
REG_SZ,
szValue,
lstrlen(szValue));
}
}
else
/* if the saved value is an empty string, then
* delete the default var for this key */
DeleteWinRegValue(hkRootKey,
szSubKey,
szValue);
}
}
}
}
RegCloseKey(hkHandle);
return;
}
void RestoreMozMapi()
{
char szMozMapiBackupFile[MAX_BUF];
BOOL bFileIsMozMapi = FALSE;
GetWinReg(HKEY_LOCAL_MACHINE,
szMozillaDesktopKey,
"Mapi_backup_dll",
szMozMapiBackupFile,
sizeof(szMozMapiBackupFile));
/* If the windows registry Mapi_backup_dll var name does not exist,
* then we're not the default mail handler for the system.
*
* If the backup mapi file does not exist for some reason, then
* there's no way to restore the previous saved mapi32.dll file. */
if((*szMozMapiBackupFile == '\0') || !FileExists(szMozMapiBackupFile))
return;
/* A TRUE for bFileIsMozMapi indicates that we need to restore
* the backed up mapi32.dll (if one was backed up).
*
* bFileIsMozMapi is TRUE in the following conditions:
* * mapi32.dll is not found
* * mapi32.dll loads and GetMapiDllVersion() exists
* _and_ returns the same version indicated in the uninstall.ini file:
*
* [Restore Desktop Integration]
* Mapi version installed=94
*
* 94 indicates version 0.9.4 */
if(IsMapiMozMapi(&bFileIsMozMapi) == WIZ_FILE_NOT_FOUND)
bFileIsMozMapi = TRUE;
if(bFileIsMozMapi)
{
char szDestinationFilename[MAX_BUF];
/* Get the Windows System (or System32 under NT) directory */
if(GetSystemDirectory(szDestinationFilename, sizeof(szDestinationFilename)))
{
/* Copy the backup filename into the normal Mapi32.dll filename */
AppendBackSlash(szDestinationFilename, sizeof(szDestinationFilename));
lstrcat(szDestinationFilename, "Mapi32.dll");
CopyFile(szMozMapiBackupFile, szDestinationFilename, FALSE);
}
}
/* Delete the backup Mapi filename */
FileDelete(szMozMapiBackupFile);
}
BOOL UndoDesktopIntegration(void)
{
char szMozillaKey[] = "Software\\Mozilla";
char szBuf[MAX_BUF];
/* Check to see if uninstall.ini has indicated to restore
* the destktop integration performed by the browser/mail */
GetPrivateProfileString(szRDISection, "Enabled", "", szBuf, sizeof(szBuf), szFileIniUninstall);
if(lstrcmpi(szBuf, "TRUE") == 0)
{
RestoreDesktopIntegration();
RestoreMozMapi();
DeleteWinRegKey(HKEY_LOCAL_MACHINE, szMozillaDesktopKey, TRUE);
DeleteWinRegKey(HKEY_LOCAL_MACHINE, szMozillaKey, FALSE);
}
return(0);
}
/* Function that retrieves the app name (including path) that is going to be
* uninstalled. The return string is in upper case. */
int GetUninstallAppPathName(char *szAppPathName, DWORD dwAppPathNameSize)
{
char szKey[MAX_BUF];
HKEY hkRoot;
if(*ugUninstall.szUserAgent != '\0')
{
hkRoot = ugUninstall.hWrMainRoot;
lstrcpy(szKey, ugUninstall.szWrMainKey);
AppendBackSlash(szKey, sizeof(szKey));
lstrcat(szKey, ugUninstall.szUserAgent);
AppendBackSlash(szKey, sizeof(szKey));
lstrcat(szKey, "Main");
}
else
{
return(CMI_APP_PATHNAME_NOT_FOUND);
}
GetWinReg(hkRoot, szKey, "PathToExe", szAppPathName, dwAppPathNameSize);
CharUpperBuff(szAppPathName, dwAppPathNameSize);
return(CMI_OK);
}
/* Function to delete the UnreadMail keys that belong to the app that is being
* uninstalled. The skn list that is passed in should only contain UnreadMail
* subkeys to be deleted. */
void DeleteUnreadMailKeys(skn *sknHeadNode)
{
skn *sknTempNode;
char szUnreadMailDeleteKey[MAX_BUF];
DWORD dwLength;
if(sknHeadNode == NULL)
return;
sknTempNode = sknHeadNode;
do
{
/* build the full UnreadMail key to be deleted */
dwLength = sizeof(szUnreadMailDeleteKey) > lstrlen(szUnreadMailKey) ?
lstrlen(szUnreadMailKey) + 1: sizeof(szUnreadMailDeleteKey);
lstrcpyn(szUnreadMailDeleteKey, szUnreadMailKey, dwLength);
AppendBackSlash(szUnreadMailDeleteKey, sizeof(szUnreadMailDeleteKey));
if((unsigned)(lstrlen(sknTempNode->szKey) + 1) <
(sizeof(szUnreadMailDeleteKey) - lstrlen(szUnreadMailKey) + 1))
{
lstrcat(szUnreadMailDeleteKey, sknTempNode->szKey);
/* delete the UnreadMail key (even if it has subkeys) */
DeleteWinRegKey(hkUnreadMailRootKey, szUnreadMailDeleteKey, TRUE);
}
/* get the next key to delete */
sknTempNode = sknTempNode->Next;
}while(sknTempNode != sknHeadNode);
}
/* Function that builds a list of UnreadMail subkey names that only belong to
* the app that is being uninstalled. The list is a linked list of skn
* structures. */
BOOL GetUnreadMailKeyList(char *szUninstallAppPathName, skn **sknWinRegKeyList)
{
HKEY hkSubKeyHandle;
HKEY hkHandle;
DWORD dwErr = ERROR_SUCCESS;
DWORD dwTotalSubKeys;
DWORD dwSubKeySize;
DWORD dwIndex;
DWORD dwBufSize;
BOOL bFoundAtLeastOne = FALSE;
char szSubKey[MAX_BUF];
char szBuf[MAX_BUF];
char szNewKey[MAX_BUF];
skn *sknTempNode;
/* open the UnreadMail key so we can enumerate its subkeys */
dwErr = RegOpenKeyEx(hkUnreadMailRootKey,
szUnreadMailKey,
0,
KEY_READ|KEY_QUERY_VALUE,
&hkHandle);
if(dwErr == ERROR_SUCCESS)
{
dwTotalSubKeys = 0;
RegQueryInfoKey(hkHandle,
NULL,
NULL,
NULL,
&dwTotalSubKeys,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if(dwTotalSubKeys != 0)
{
dwIndex = 0;
do
{
/* For each UnreadMail subkey, parse it's 'Application' var name for
* the app we're uninstalling (full path). Compare against both long
* path name and short path name. If match found, add to linked list
* of skn structures.
*
* No key deletion is performed at this time! */
sknTempNode = NULL; /* reset temporaty node pointer */
dwSubKeySize = sizeof(szSubKey);
if((dwErr = RegEnumKeyEx(hkHandle,
dwIndex,
szSubKey,
&dwSubKeySize,
NULL,
NULL,
NULL,
NULL)) == ERROR_SUCCESS)
{
lstrcpy(szNewKey, szUnreadMailKey);
AppendBackSlash(szNewKey, sizeof(szNewKey));
lstrcat(szNewKey, szSubKey);
if(RegOpenKeyEx(hkUnreadMailRootKey,
szNewKey,
0,
KEY_READ,
&hkSubKeyHandle) == ERROR_SUCCESS)
{
dwBufSize = sizeof(szBuf);
if(RegQueryValueEx(hkSubKeyHandle,
"Application",
NULL,
NULL,
szBuf,
&dwBufSize) == ERROR_SUCCESS)
{
CharUpperBuff(szBuf, sizeof(szBuf));
if(strstr(szBuf, szUninstallAppPathName) != NULL)
{
bFoundAtLeastOne = TRUE;
sknTempNode = CreateSknNode();
lstrcpyn(sknTempNode->szKey, szSubKey, dwSubKeySize + 1);
}
else
{
char szUninstallAppPathNameShort[MAX_BUF];
GetShortPathName(szUninstallAppPathName,
szUninstallAppPathNameShort,
sizeof(szUninstallAppPathNameShort));
if(strstr(szBuf, szUninstallAppPathNameShort) != NULL)
{
bFoundAtLeastOne = TRUE;
sknTempNode = CreateSknNode();
lstrcpyn(sknTempNode->szKey, szSubKey, dwSubKeySize + 1);
}
}
}
RegCloseKey(hkSubKeyHandle);
}
}
if(sknTempNode)
SknNodeInsert(sknWinRegKeyList, sknTempNode);
++dwIndex;
} while(dwErr != ERROR_NO_MORE_ITEMS);
}
RegCloseKey(hkHandle);
}
return(bFoundAtLeastOne);
}
/* Main function that deals with cleaning up the UnreadMail subkeys belonging
* to the app were currently uninstalling. */
int CleanupMailIntegration(void)
{
char szCMISection[] = "Cleanup Mail Integration";
char szUninstallApp[MAX_BUF];
char szBuf[MAX_BUF];
skn *sknWinRegKeyList = NULL;
/* Check to see if uninstall.ini has indicated to cleanup
* the mail integration performed by mail */
GetPrivateProfileString(szCMISection,
"Enabled",
"",
szBuf,
sizeof(szBuf),
szFileIniUninstall);
if(lstrcmpi(szBuf, "TRUE") != 0)
return(CMI_OK);
/* Get the full app name we're going to uninstall */
if(GetUninstallAppPathName(szUninstallApp, sizeof(szUninstallApp)) != CMI_OK)
return(CMI_APP_PATHNAME_NOT_FOUND);
/* Build a list of UnreadMail subkeys that needs to be deleted */
if(GetUnreadMailKeyList(szUninstallApp, &sknWinRegKeyList))
/* Delete the UnreadMail subkeys using the list built by
* GetUnreadMailKeyList() */
DeleteUnreadMailKeys(sknWinRegKeyList);
/* Clean up the linked list */
DeInitSknList(&sknWinRegKeyList);
return(CMI_OK);
}

Просмотреть файл

@ -0,0 +1,31 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* 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 Navigator.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corp. Portions created by Netscape Communications Corp. are
* Copyright (C) 1998, 1999, 2000, 2001 Netscape Communications Corp. All
* Rights Reserved.
*
* Contributor(s):
* Sean Su <ssu@netscape.com>
*/
#ifndef _RDI_H_
#define _RDI_H_
BOOL UndoDesktopIntegration(void);
int CleanupMailIntegration(void);
#endif

Просмотреть файл

@ -0,0 +1,50 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by uninstall.rc
//
#ifndef WINVER
#define WINVER 0x0400
#endif
#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
#define IDS_ERROR_FAILED 6
#define IDI_SETUP 105
#define IDI_UNINSTALL 105
#define DLG_MESSAGE 110
#define IDC_LIST_PRODUCTS 1000
#define ID_NO 1001
#define IDC_GAUGE_FILE 1002
#define ID_NO_TO_ALL 1002
#define IDC_STATUS0 1004
#define ID_YES 1004
#define IDC_STATUS3 1005
#define ID_YES_TO_ALL 1005
#define IDC_GAUGE_ARCHIVE 1006
#define IDC_STATIC_SHARED_FILENAME 1006
#define IDC_EDIT_CURRENT_SETTINGS 1026
#define IDC_MESSAGE0 1042
#define IDC_MESSAGE1 1043
#define IDC_MESSAGE 1049
#define DLG_UNINSTALL 2008
#define DLG_EXTRACTING 2009
#define DLG_PRODUCT_LIST 2009
#define DLG_WHAT_TO_DO 2009
#define IDWIZBACK 11013
#define IDWIZNEXT 11014
#define IDC_STATIC -1
// 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 1007
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Просмотреть файл

@ -0,0 +1,149 @@
/* -*- 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 "uninstall.h"
#include "extra.h"
#include "dialogs.h"
#include "ifuncns.h"
/* global variables */
HINSTANCE hInst;
HANDLE hAccelTable;
HWND hDlgUninstall;
HWND hDlgMessage;
HWND hWndMain;
LPSTR szEGlobalAlloc;
LPSTR szEStringLoad;
LPSTR szEDllLoad;
LPSTR szEStringNull;
LPSTR szTempSetupPath;
LPSTR szClassName;
LPSTR szUninstallDir;
LPSTR szTempDir;
LPSTR szOSTempDir;
LPSTR szFileIniUninstall;
LPSTR szFileIniDefaultsInfo;
LPSTR gszSharedFilename;
ULONG ulOSType;
DWORD dwScreenX;
DWORD dwScreenY;
DWORD gdwWhatToDo;
BOOL gbAllowMultipleInstalls = FALSE;
uninstallGen ugUninstall;
diU diUninstall;
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];
int iRv = WIZ_OK;
HWND hwndFW;
if(!hPrevInstance)
{
hInst = GetModuleHandle(NULL);
if(InitUninstallGeneral())
PostQuitMessage(1);
else if(ParseCommandLine(lpszCmdLine))
PostQuitMessage(1);
else if((hwndFW = FindWindow(CLASS_NAME_UNINSTALL_DLG, NULL)) != NULL && !gbAllowMultipleInstalls)
{
/* Allow only one instance of setup to run.
* Detect a previous instance of setup, bring it to the
* foreground, and quit current instance */
ShowWindow(hwndFW, SW_RESTORE);
SetForegroundWindow(hwndFW);
iRv = WIZ_SETUP_ALREADY_RUNNING;
PostQuitMessage(1);
}
else if(Initialize(hInst))
{
PostQuitMessage(1);
}
else if(!InitApplication(hInst))
{
char szEFailed[MAX_BUF];
if(NS_LoadString(hInst, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK)
{
wsprintf(szBuf, szEFailed, "InitApplication().");
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
else if(ParseUninstallIni())
{
PostQuitMessage(1);
}
else if(ugUninstall.bUninstallFiles == TRUE)
{
if(diUninstall.bShowDialog == TRUE)
hDlgUninstall = InstantiateDialog(hWndMain, DLG_UNINSTALL, diUninstall.szTitle, DlgProcUninstall);
// Assumes that SHOWICONS, HIDEICONS, and SETDEFAULT never show dialogs
else if((ugUninstall.mode == SHOWICONS) || (ugUninstall.mode == HIDEICONS))
ParseDefaultsInfo();
else if(ugUninstall.mode == SETDEFAULT)
SetDefault();
else
ParseAllUninstallLogs();
}
}
if((ugUninstall.bUninstallFiles == TRUE) && (diUninstall.bShowDialog == TRUE))
{
while(GetMessage(&msg, NULL, 0, 0))
{
if((!IsDialogMessage(hDlgUninstall, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
/* garbage collection */
DeInitUninstallGeneral();
if(iRv != WIZ_SETUP_ALREADY_RUNNING)
/* Do clean up before exiting from the application */
DeInitialize();
return(msg.wParam);
} /* End of WinMain */

Просмотреть файл

@ -0,0 +1,179 @@
/* -*- 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 "resource.h"
#define CLASS_NAME "Uninstall"
#define CLASS_NAME_UNINSTALL_DLG "MozillaSetupDlg"
#define FILE_INI_UNINSTALL "uninstall.ini"
#define FILE_LOG_INSTALL "install_wizard.log"
#define WIZ_TEMP_DIR "ns_temp"
#define MAX_KILL_PROCESS_RETRIES 10
/* WTD: What To Do */
#define WTD_ASK 0
#define WTD_CANCEL 1
#define WTD_NO 2
#define WTD_NO_TO_ALL 3
#define WTD_YES 4
#define WTD_YES_TO_ALL 5
/* WS: WinSpawn wait values */
#define WS_DO_NOT_WAIT FALSE
#define WS_WAIT TRUE
/* CI: Check Instance */
#define CI_FORCE_QUIT_PROCESS TRUE
#define CI_CLOSE_PROCESS FALSE
/* PP: Parse Path */
#define PP_FILENAME_ONLY 1
#define PP_PATH_ONLY 2
#define PP_ROOT_ONLY 3
#define MAX_BUF 4096
#define MAX_BUF_TINY 256
#define ERROR_CODE_HIDE 0
#define ERROR_CODE_SHOW 1
#define CX_CHECKBOX 13
#define CY_CHECKBOX 13
/* WIZ: WIZARD defines */
#define WIZ_OK 0
#define WIZ_ERROR_UNDEFINED 1024
#define WIZ_MEMORY_ALLOC_FAILED 1025
#define WIZ_OUT_OF_MEMORY WIZ_MEMORY_ALLOC_FAILED
#define WIZ_ARCHIVES_MISSING 1026
#define WIZ_CRC_PASS WIZ_OK
#define WIZ_CRC_FAIL 1028
#define WIZ_SETUP_ALREADY_RUNNING 1029
#define WIZ_TOO_MANY_NETWORK_ERRORS 1030
#define WIZ_ERROR_PARSING_INTERNAL_STR 1031
#define WIZ_ERROR_REGKEY 1032
#define WIZ_ERROR_INIT 1033
#define WIZ_ERROR_LOADING_RESOURCE_LIB 1034
#define WIZ_FILE_NOT_FOUND 1035
#define WIZ_ERROR_PARSING_UNINST_STRS 1036
/* CMI: Cleanup Mail Integration */
#define CMI_OK 0
#define CMI_APP_PATHNAME_NOT_FOUND 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 NOT_SET -1
#define NORMAL 0
#define SILENT 1
#define AUTO 2
#define SHOWICONS 3
#define HIDEICONS 4
#define SETDEFAULT 5
/* OS: Operating System */
#define OS_WIN9x 0x00000001
#define OS_WIN95_DEBUTE 0x00000002
#define OS_WIN95 0x00000004
#define OS_WIN98 0x00000008
#define OS_NT 0x00000010
#define OS_NT3 0x00000020
#define OS_NT4 0x00000040
#define OS_NT5 0x00000080
#define OS_NT50 0x00000100
#define OS_NT51 0x00000200
typedef struct dlgUninstall
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
} diU;
typedef struct uninstallStruct
{
int mode;
LPSTR szAppPath;
LPSTR szLogPath;
LPSTR szLogFilename;
LPSTR szCompanyName;
LPSTR szProductName;
LPSTR szDescription;
LPSTR szUninstallKeyDescription;
LPSTR szUninstallFilename;
HKEY hWrMainRoot;
LPSTR szWrMainKey;
HKEY hWrRoot;
LPSTR szWrKey;
LPSTR szUserAgent;
LPSTR szDefaultComponent;
LPSTR szClientAppID;
LPSTR szClientAppPath;
BOOL bVerbose;
BOOL bUninstallFiles;
BOOL bSharedInst;
HFONT definedFont;
char szInstallPath[MAX_BUF];
} uninstallGen;
typedef struct sInfoLine sil;
struct sInfoLine
{
ULONGLONG ullLineNumber;
LPSTR szLine;
sil *Next;
sil *Prev;
};
#endif

Двоичные данные
toolkit/mozapps/installer/windows/wizard/uninstall/uninstall.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Просмотреть файл

@ -0,0 +1,171 @@
//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,2
PRODUCTVERSION 1,0,0,2
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", "mozilla.org\0"
VALUE "FileDescription", "uninstall\0"
VALUE "FileVersion", "1, 0, 0, 2\0"
VALUE "InternalName", "uninstall\0"
VALUE "LegalCopyright", "Copyright © 2001\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "uninstall.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Mozilla uninstaller\0"
VALUE "ProductVersion", "1, 0, 0, 2\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.
IDI_UNINSTALL ICON DISCARDABLE "uninstall.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
DLG_UNINSTALL DIALOG DISCARDABLE 51, 56, 225, 79
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CLASS "MozillaSetupDlg"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",IDWIZNEXT,54,55,53,14
PUSHBUTTON "",IDCANCEL,118,55,53,14
LTEXT "",IDC_MESSAGE0,17,11,191,32,NOT WS_GROUP
END
DLG_MESSAGE DIALOG DISCARDABLE 0, 0, 236, 34
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
CTEXT "",IDC_MESSAGE,0,0,236,34,SS_CENTERIMAGE
END
DLG_WHAT_TO_DO DIALOG DISCARDABLE 51, 56, 333, 140
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "",ID_NO,40,108,53,14
PUSHBUTTON "",ID_NO_TO_ALL,107,108,53,14
PUSHBUTTON "",ID_YES,174,108,53,14
PUSHBUTTON "",ID_YES_TO_ALL,241,108,53,14
LTEXT "",IDC_MESSAGE0,16,13,301,33,NOT WS_GROUP
LTEXT "",IDC_MESSAGE1,16,50,301,19,NOT WS_GROUP
RTEXT "",IDC_STATIC,18,81,41,8
LTEXT "Static",IDC_STATIC_SHARED_FILENAME,66,79,251,14,
SS_CENTERIMAGE | SS_SUNKEN
END
/////////////////////////////////////////////////////////////////////////////
//
// 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