Back to index

lightning-sunbird  0.9+nobinonly
extra.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Sean Su <ssu@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #ifndef _EXTRA_H_
00041 #define _EXTRA_H_
00042 
00043 #include "supersede.h"
00044 
00045 BOOL              InitDialogClass(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
00046 BOOL              InitApplication(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
00047 BOOL              InitInstance(HINSTANCE hInstance, DWORD dwCmdShow);
00048 void              PrintError(LPSTR szMsg, DWORD dwErrorCodeSH);
00049 void              FreeMemory(void **vPointer);
00050 void              *NS_GlobalReAlloc(HGLOBAL *hgMemory,
00051                                     DWORD dwMemoryBufSize,
00052                                     DWORD dwNewSize);
00053 void              *NS_GlobalAlloc(DWORD dwMaxBuf);
00054 HRESULT           Initialize(HINSTANCE hInstance);
00055 HRESULT           NS_LoadStringAlloc(HANDLE hInstance, DWORD dwID, LPSTR *szStringBuf, DWORD dwStringBuf);
00056 HRESULT           NS_LoadString(HANDLE hInstance, DWORD dwID, LPSTR szStringBuf, DWORD dwStringBuf);
00057 HRESULT           WinSpawn(LPSTR szClientName, LPSTR szParameters, LPSTR szCurrentDir, int iShowCmd, BOOL bWait);
00058 HRESULT           ParseConfigIni(LPSTR lpszCmdLine);
00059 HRESULT           ParseInstallIni();
00060 HRESULT           DecryptString(LPSTR szOutputStr, LPSTR szInputStr);
00061 HRESULT           DecryptVariable(LPSTR szVariable, DWORD dwVariableSize);
00062 void              CollateBackslashes(LPSTR szInputOutputStr);
00063 HRESULT           InitSetupGeneral(void);
00064 HRESULT           InitDlgWelcome(diW *diDialog);
00065 HRESULT           InitDlgLicense(diL *diDialog);
00066 HRESULT           InitDlgQuickLaunch(diQL *diDialog);
00067 HRESULT           InitDlgSetupType(diST *diDialog);
00068 HRESULT           InitDlgSelectComponents(diSC *diDialog, DWORD dwSM);
00069 HRESULT           InitDlgWindowsIntegration(diWI *diDialog);
00070 HRESULT           InitDlgProgramFolder(diPF *diDialog);
00071 HRESULT           InitDlgStartInstall(diSI *diDialog);
00072 HRESULT           InitDlgSiteSelector(diAS *diDialog);
00073 HRESULT           InitSDObject(void);
00074 void              DeInitSDObject(void);
00075 siC               *CreateSiCNode(void);
00076 void              SiCNodeInsert(siC **siCHead, siC *siCTemp);
00077 void              SiCNodeDelete(siC *siCTemp);
00078 siCD              *CreateSiCDepNode(void);
00079 void              SiCDepNodeDelete(siCD *siCDepTemp);
00080 void              SiCDepNodeInsert(siCD **siCDepHead, siCD *siCDepTemp);
00081 HRESULT           SiCNodeGetAttributes(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00082 void              SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible, DWORD dwACFlag, HWND hwndListBox);
00083 void              SiCNodeSetItemsSelected(DWORD dwSetupType);
00084 char              *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00085 char              *SiCNodeGetDescriptionShort(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00086 char              *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00087 char              *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00088 siC               *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs, DWORD dwACFlag);
00089 ULONGLONG         SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00090 ULONGLONG         SiCNodeGetInstallSizeSystem(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00091 ULONGLONG         SiCNodeGetInstallSizeArchive(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00092 siC               *SiCNodeFind(siC *siComponents, char *szInReferenceName);
00093 void              InitSiComponents(char *szFileIni);
00094 HRESULT           ParseComponentAttributes(char *szBuf, DWORD dwAttributes, BOOL bOverride);
00095 void              InitSiteSelector(char *szFileIni);
00096 void              DeInitSiCDependencies(siCD *siCDDependencies);
00097 BOOL              ResolveDependencies(DWORD dwIndex, HWND hwndListBox);
00098 BOOL              ResolveComponentDependency(siCD *siCDInDependency, HWND hwndListBox);
00099 void              ResolveDependees(LPSTR szToggledDescriptionShort, HWND hwndListBox);
00100 BOOL              ResolveComponentDependee(siCD *siCDInDependee);
00101 void              STSetVisibility(st *stSetupType);
00102 HRESULT           InitSXpcomFile(void);
00103 void              DeInitSXpcomFile(void);
00104 void              DeInitialize(void);
00105 void              DeInitDlgWelcome(diW *diDialog);
00106 void              DeInitDlgLicense(diL *diDialog);
00107 void              DeInitDlgQuickLaunch(diQL *diDialog);
00108 void              DeInitDlgSetupType(diST *diDialog);
00109 void              DeInitDlgSelectComponents(diSC *diDialog);
00110 void              DeInitDlgWindowsIntegration(diWI *diDialog);
00111 void              DeInitDlgProgramFolder(diPF *diDialog);
00112 void              DeInitDlgStartInstall(diSI *diDialog);
00113 void              DeInitDlgSiteSelector(diAS *diDialog);
00114 void              DetermineOSVersionEx(void);
00115 void              DeInitSiComponents(siC **siComponents);
00116 void              DeInitSetupGeneral(void);
00117 HRESULT           ParseSetupIni(void);
00118 HRESULT           GetConfigIni(void);
00119 HRESULT           GetInstallIni(void);
00120 void              CleanTempFiles(void);
00121 void              OutputSetupTitle(HDC hDC);
00122 long              RetrieveArchives(void);
00123 long              RetrieveRedirectFile(void);
00124 void              ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, BOOL bUseSlash, DWORD dwType);
00125 void              RemoveBackSlash(LPSTR szInput);
00126 void              AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
00127 void              RemoveSlash(LPSTR szInput);
00128 void              AppendSlash(LPSTR szInput, DWORD dwInputSize);
00129 BOOL              DeleteIdiGetConfigIni(void);
00130 BOOL              DeleteIdiGetArchives(void);
00131 BOOL              DeleteIdiGetRedirect(void);
00132 BOOL              DeleteIdiFileIniConfig(void);
00133 BOOL              DeleteIdiFileIniInstall(void);
00134 void              DeleteArchives(DWORD dwDeleteCheck);
00135 BOOL              DeleteIniRedirect(void);
00136 HRESULT           LaunchApps(void);
00137 HRESULT           FileExists(LPSTR szFile);
00138 int               ExtractDirEntries(char* directory,void* vZip);
00139 int               LocateJar(siC *siCObject, LPSTR szPath, int dwPathSize, BOOL bIncludeTempDir);
00140 HRESULT           AddArchiveToIdiFile(siC *siCObject,
00141                                       char *szSFile,
00142                                       char *szFileIdiGetArchives);
00143 int               SiCNodeGetIndexDS(char *szInDescriptionShort);
00144 int               SiCNodeGetIndexRN(char *szInReferenceName);
00145 void              ViewSiComponentsDependency(char *szBuffer, char *szIndentation, siC *siCNode);
00146 void              ViewSiComponentsDependee(char *szBuffer, char *szIndentation, siC *siCNode);
00147 void              ViewSiComponents(void);
00148 BOOL              IsWin95Debute(void);
00149 ULONGLONG         GetDiskSpaceRequired(DWORD dwType);
00150 ULONGLONG         GetDiskSpaceAvailable(LPSTR szPath);
00151 HRESULT           VerifyDiskSpace(void);
00152 HRESULT           ErrorMsgDiskSpace(ULONGLONG ullDSAvailable, ULONGLONG ullDSRequired, LPSTR szPath, BOOL bCrutialMsg);
00153 void              SetCustomType(void);
00154 void              GetAlternateArchiveSearchPath(LPSTR lpszCmdLine);
00155 BOOL              NeedReboot(void);
00156 BOOL              LocatePreviousPath(LPSTR szMainSectionName, LPSTR szPath, DWORD dwPathSize);
00157 BOOL              LocatePathNscpReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
00158 BOOL              LocatePathWinReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
00159 BOOL              LocatePath(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
00160 int               VR_GetPath(char *component_path, unsigned long sizebuf, char *buf);
00161 dsN               *CreateDSNode();
00162 void              DsNodeInsert(dsN **dsNHead, dsN *dsNTemp);
00163 void              DsNodeDelete(dsN **dsNTemp);
00164 void              DeInitDSNode(dsN **dsnComponentDSRequirement);
00165 void              UpdatePathDiskSpaceRequired(LPSTR szPath, ULONGLONG ullInstallSize, dsN **dsnComponentDSRequirement);
00166 HRESULT           InitComponentDiskSpaceInfo(dsN **dsnComponentDSRequirement);
00167 HRESULT           CheckInstances();
00168 long              RandomSelect(void);
00169 BOOL              CheckLegacy(HWND hDlg);
00170 COLORREF          DecryptFontColor(LPSTR szColor);
00171 ssi               *CreateSsiSiteSelectorNode();
00172 void              SsiSiteSelectorNodeInsert(ssi **ssiHead, ssi *ssiTemp);
00173 void              SsiSiteSelectorNodeDelete(ssi *ssiTemp);
00174 ssi*              SsiGetNode(LPSTR szDescription);
00175 void              UpdateSiteSelector(void);
00176 DWORD             GetAdditionalComponentsCount(void);
00177 DWORD             GetTotalArchivesToDownload();
00178 void              RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize);
00179 int               MozCopyStr(LPSTR szSrc, LPSTR szDest, DWORD dwDestBufSize);
00180 LPSTR             GetFirstNonSpace(LPSTR lpszString);
00181 LPSTR             MozStrChar(LPSTR lpszString, char c);
00182 int               GetArgC(LPSTR lpszCommandLine);
00183 LPSTR             GetArgV(LPSTR lpszCommandLine,
00184                           int iIndex,
00185                           LPSTR lpszDest,
00186                           int iDestSize);
00187 DWORD             ParseCommandLine(LPSTR lpszCmdLine);
00188 DWORD             ParseForStartupOptions(LPSTR aCmdLine);
00189 void              SetSetupRunMode(LPSTR szMode);
00190 void              Delay(DWORD dwSeconds);
00191 void              UnsetSetupState(void);
00192 void              SetSetupState(char *szState);
00193 siCD              *InitWinInitNodes(char *szInFile);
00194 void              UpdateWininit(LPSTR szUninstallFilename);
00195 char              *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize);
00196 void              SaveInstallerFiles(void);
00197 void              ResetComponentAttributes(char *szFileIni);
00198 BOOL              IsInList(DWORD dwCurrentItem,
00199                            DWORD dwItems,
00200                            DWORD *dwItemsSelected);
00201 int               LocateExistingPath(char *szPath,
00202                                      char *szExistingPath,
00203                                      DWORD dwExistingPathSize);
00204 BOOL              ContainsReparseTag(char *szPath,
00205                                      char *szReparsePath,
00206                                      DWORD dwReparsePathSize);
00207 BOOL              DeleteInstallLogFile(char *szFile);
00208 int               CRCCheckDownloadedArchives(char *szCorruptedArchiveList,
00209                                              DWORD dwCorruptedArchivelistSize,
00210                                              char *szFileIdiGetArchives);
00211 int               CRCCheckArchivesStartup(char *szCorruptedArchiveList,
00212                                           DWORD dwCorruptedArchiveListSize,
00213                                           BOOL bIncludeTempPath);
00214 BOOL              ResolveForceUpgrade(siC *siCObject);
00215 void              RestoreInvisibleFlag(siC *siCNode);
00216 void              RestoreAdditionalFlag(siC *siCNode);
00217 void              RestoreEnabledFlag(siC *siCNode);
00218 void              SwapFTPAndHTTP(char *szInUrl, DWORD dwInUrlSize);
00219 void              ClearWinRegUninstallFileDeletion(void);
00220 void              RemoveDelayedDeleteFileEntries(const char *aPathToMatch);
00221 int               AppendToGlobalMessageStream(char *szInfo);
00222 char              *GetOSTypeString(char *szOSType, DWORD dwOSTypeBufSize);
00223 int               UpdateIdiFile(char  *szPartialUrl,
00224                                 DWORD dwPartialUrlBufSize,
00225                                 siC   *siCObject,
00226                                 char  *szSection,
00227                                 char  *szKey,
00228                                 char  *szFileIdiGetArchives);
00229 void              SetDownloadFile(void);
00230 void              UnsetSetupCurrentDownloadFile(void);
00231 void              SetSetupCurrentDownloadFile(char *szCurrentFilename);
00232 char              *GetSetupCurrentDownloadFile(char *szCurrentDownloadFile,
00233                                        DWORD dwCurrentDownloadFileBufSize);
00234 BOOL              DeleteWGetLog(void);
00235 DWORD             ParseOSType(char *szOSType);
00236 BOOL              ShowAdditionalOptionsDialog(void);
00237 DWORD             GetPreviousUnfinishedState(void);
00238 void              RefreshIcons();
00239 void              NeedToInstallFiles(LPSTR szProdDir);
00240 void              LaunchOneComponent(siC *siCObject, greInfo *aGre);
00241 HRESULT           ProcessXpinstallEngine(void);
00242 void              GetXpinstallPath(char *aPath, int aPathBufSize);
00243 BOOL              GreInstallerNeedsReboot(void);
00244 void              ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
00245 void              UpdateGREAppInstallerProgress(int percent);
00246 BOOL              IsPathWithinWindir();
00247 void              CleanupOnUpgrade();
00248 BOOL              IsInstallerProductGRE(void);
00249 HRESULT           CleanupOrphanedGREs(void);
00250 
00251 #endif /* _EXTRA_H_ */
00252