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 the GNU General Public License Version 2 or later (the "GPL"), or
00028  * 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           InitDlgSelectInstallPath(diSIP *diDialog);
00070 HRESULT           InitDlgUpgrade(diU *diDialog);
00071 HRESULT           InitDlgWindowsIntegration(diWI *diDialog);
00072 HRESULT           InitDlgProgramFolder(diPF *diDialog);
00073 HRESULT           InitDlgStartInstall(diSI *diDialog);
00074 HRESULT           InitDlgDownloading(diDL *diDialog);
00075 HRESULT           InitDlgInstalling(diI *diDialog);
00076 HRESULT           InitDlgSiteSelector(diAS *diDialog);
00077 HRESULT           InitSDObject(void);
00078 void              DeInitSDObject(void);
00079 siC               *CreateSiCNode(void);
00080 void              SiCNodeInsert(siC **siCHead, siC *siCTemp);
00081 void              SiCNodeDelete(siC *siCTemp);
00082 siCD              *CreateSiCDepNode(void);
00083 void              SiCDepNodeDelete(siCD *siCDepTemp);
00084 void              SiCDepNodeInsert(siCD **siCDepHead, siCD *siCDepTemp);
00085 HRESULT           SiCNodeGetAttributes(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00086 void              SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible, DWORD dwACFlag, HWND hwndListBox);
00087 void              SiCNodeSetItemsSelected(DWORD dwSetupType);
00088 char              *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00089 char              *SiCNodeGetDescriptionShort(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00090 char              *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00091 char              *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00092 siC               *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs, DWORD dwACFlag);
00093 ULONGLONG         SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00094 ULONGLONG         SiCNodeGetInstallSizeSystem(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00095 ULONGLONG         SiCNodeGetInstallSizeArchive(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
00096 siC               *SiCNodeFind(siC *siComponents, char *szInReferenceName);
00097 void              InitSiComponents();
00098 HRESULT           ParseComponentAttributes(char *szBuf, DWORD dwAttributes, BOOL bOverride);
00099 void              InitSiteSelector();
00100 void              DeInitSiCDependencies(siCD *siCDDependencies);
00101 BOOL              ResolveDependencies(DWORD dwIndex, HWND hwndListBox);
00102 BOOL              ResolveComponentDependency(siCD *siCDInDependency, HWND hwndListBox);
00103 void              ResolveDependees(LPSTR szToggledDescriptionShort, HWND hwndListBox);
00104 BOOL              ResolveComponentDependee(siCD *siCDInDependee);
00105 void              STSetVisibility(st *stSetupType);
00106 HRESULT           InitSXpcomFile(void);
00107 void              DeInitSXpcomFile(void);
00108 void              DeInitialize(void);
00109 void              DeInitDlgWelcome(diW *diDialog);
00110 void              DeInitDlgLicense(diL *diDialog);
00111 void              DeInitDlgQuickLaunch(diQL *diDialog);
00112 void              DeInitDlgSetupType(diST *diDialog);
00113 void              DeInitDlgSelectComponents(diSC *diDialog);
00114 void              DeInitDlgSelectInstallPath(diSIP *diDialog);
00115 void              DeInitDlgUpgrade(diU *diDialog);
00116 void              DeInitDlgWindowsIntegration(diWI *diDialog);
00117 void              DeInitDlgProgramFolder(diPF *diDialog);
00118 void              DeInitDlgStartInstall(diSI *diDialog);
00119 void              DeInitDlgDownloading(diDL *diDialog);
00120 void              DeInitDlgInstalling(diI *diDialog);
00121 void              DeInitDlgSiteSelector(diAS *diDialog);
00122 void              DetermineOSVersionEx(void);
00123 void              DeInitSiComponents(siC **siComponents);
00124 void              DeInitSetupGeneral(void);
00125 HRESULT           ParseSetupIni(void);
00126 HRESULT           GetConfigIni(void);
00127 DWORD             GetConfigIniProfileString(const char* aSection, const char *aKey,
00128                                             const char *aDefault,
00129                                             char *aResult, DWORD aMaxLen);
00130 HRESULT           GetInstallIni(void);
00131 void              CleanTempFiles(void);
00132 void              OutputSetupTitle(HDC hDC);
00133 long              RetrieveArchives(void);
00134 long              RetrieveRedirectFile(void);
00135 void              ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, BOOL bUseSlash, DWORD dwType);
00136 void              RemoveBackSlash(LPSTR szInput);
00137 void              AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
00138 void              RemoveSlash(LPSTR szInput);
00139 void              AppendSlash(LPSTR szInput, DWORD dwInputSize);
00140 BOOL              DeleteIdiGetConfigIni(void);
00141 BOOL              DeleteIdiGetArchives(void);
00142 BOOL              DeleteIdiGetRedirect(void);
00143 BOOL              DeleteIdiFileIniConfig(void);
00144 BOOL              DeleteIdiFileIniInstall(void);
00145 void              DeleteArchives(DWORD dwDeleteCheck);
00146 BOOL              DeleteIniRedirect(void);
00147 HRESULT           LaunchApps(void);
00148 HRESULT           FileExists(LPSTR szFile);
00149 int               ExtractDirEntries(char* directory,void* vZip);
00150 int               LocateJar(siC *siCObject, LPSTR szPath, int dwPathSize, BOOL bIncludeTempDir);
00151 HRESULT           AddArchiveToIdiFile(siC *siCObject,
00152                                       char *szSFile,
00153                                       char *szFileIdiGetArchives);
00154 int               SiCNodeGetIndexDS(char *szInDescriptionShort);
00155 int               SiCNodeGetIndexRN(char *szInReferenceName);
00156 void              ViewSiComponentsDependency(char *szBuffer, char *szIndentation, siC *siCNode);
00157 void              ViewSiComponentsDependee(char *szBuffer, char *szIndentation, siC *siCNode);
00158 void              ViewSiComponents(void);
00159 BOOL              IsWin95Debute(void);
00160 ULONGLONG         GetDiskSpaceRequired(DWORD dwType);
00161 ULONGLONG         GetDiskSpaceAvailable(LPSTR szPath);
00162 HRESULT           VerifyDiskSpace(void);
00163 HRESULT           ErrorMsgDiskSpace(ULONGLONG ullDSAvailable, ULONGLONG ullDSRequired, LPSTR szPath, BOOL bCrutialMsg);
00164 void              SetCustomType(void);
00165 void              GetAlternateArchiveSearchPath(LPSTR lpszCmdLine);
00166 BOOL              NeedReboot(void);
00167 BOOL              LocatePreviousPath(LPSTR szMainSectionName, LPSTR szPath, DWORD dwPathSize);
00168 BOOL              LocatePathNscpReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
00169 BOOL              LocatePathWinReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
00170 BOOL              LocatePath(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
00171 int               VR_GetPath(char *component_path, unsigned long sizebuf, char *buf);
00172 dsN               *CreateDSNode();
00173 void              DsNodeInsert(dsN **dsNHead, dsN *dsNTemp);
00174 void              DsNodeDelete(dsN **dsNTemp);
00175 void              DeInitDSNode(dsN **dsnComponentDSRequirement);
00176 void              UpdatePathDiskSpaceRequired(LPSTR szPath, ULONGLONG ullInstallSize, dsN **dsnComponentDSRequirement);
00177 HRESULT           InitComponentDiskSpaceInfo(dsN **dsnComponentDSRequirement);
00178 HRESULT           CheckInstances();
00179 long              RandomSelect(void);
00180 BOOL              CheckLegacy(HWND hDlg);
00181 COLORREF          DecryptFontColor(LPSTR szColor);
00182 ssi               *CreateSsiSiteSelectorNode();
00183 void              SsiSiteSelectorNodeInsert(ssi **ssiHead, ssi *ssiTemp);
00184 void              SsiSiteSelectorNodeDelete(ssi *ssiTemp);
00185 ssi*              SsiGetNode(LPSTR szDescription);
00186 void              UpdateSiteSelector(void);
00187 DWORD             GetAdditionalComponentsCount(void);
00188 DWORD             GetTotalArchivesToDownload();
00189 void              RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize);
00190 int               MozCopyStr(LPSTR szSrc, LPSTR szDest, DWORD dwDestBufSize);
00191 LPSTR             GetFirstNonSpace(LPSTR lpszString);
00192 LPSTR             MozStrChar(LPSTR lpszString, char c);
00193 int               GetArgC(LPSTR lpszCommandLine);
00194 LPSTR             GetArgV(LPSTR lpszCommandLine,
00195                           int iIndex,
00196                           LPSTR lpszDest,
00197                           int iDestSize);
00198 DWORD             ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine);
00199 DWORD             ParseForStartupOptions(LPSTR aCmdLine);
00200 void              SetSetupRunMode(LPSTR szMode);
00201 void              Delay(DWORD dwSeconds);
00202 void              UnsetSetupState(void);
00203 void              SetSetupState(char *szState);
00204 siCD              *InitWinInitNodes(char *szInFile);
00205 char              *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize);
00206 void              SaveInstallerFiles(void);
00207 void              ResetComponentAttributes(char *szFileIni);
00208 BOOL              IsInList(DWORD dwCurrentItem,
00209                            DWORD dwItems,
00210                            DWORD *dwItemsSelected);
00211 int               LocateExistingPath(char *szPath,
00212                                      char *szExistingPath,
00213                                      DWORD dwExistingPathSize);
00214 BOOL              ContainsReparseTag(char *szPath,
00215                                      char *szReparsePath,
00216                                      DWORD dwReparsePathSize);
00217 BOOL              DeleteInstallLogFile(char *szFile);
00218 int               CRCCheckDownloadedArchives(char *szCorruptedArchiveList,
00219                                              DWORD dwCorruptedArchivelistSize,
00220                                              char *szFileIdiGetArchives);
00221 int               CRCCheckArchivesStartup(char *szCorruptedArchiveList,
00222                                           DWORD dwCorruptedArchiveListSize,
00223                                           BOOL bIncludeTempPath);
00224 BOOL              ResolveForceUpgrade(siC *siCObject);
00225 void              RestoreInvisibleFlag(siC *siCNode);
00226 void              RestoreAdditionalFlag(siC *siCNode);
00227 void              RestoreEnabledFlag(siC *siCNode);
00228 void              SwapFTPAndHTTP(char *szInUrl, DWORD dwInUrlSize);
00229 void              RemoveDelayedDeleteFileEntries(const char *aPathToMatch);
00230 int               AppendToGlobalMessageStream(char *szInfo);
00231 char              *GetOSTypeString(char *szOSType, DWORD dwOSTypeBufSize);
00232 int               UpdateIdiFile(char  *szPartialUrl,
00233                                 DWORD dwPartialUrlBufSize,
00234                                 siC   *siCObject,
00235                                 char  *szSection,
00236                                 char  *szKey,
00237                                 char  *szFileIdiGetArchives);
00238 void              SetDownloadFile(void);
00239 void              UnsetSetupCurrentDownloadFile(void);
00240 void              SetSetupCurrentDownloadFile(char *szCurrentFilename);
00241 char              *GetSetupCurrentDownloadFile(char *szCurrentDownloadFile,
00242                                        DWORD dwCurrentDownloadFileBufSize);
00243 BOOL              DeleteWGetLog(void);
00244 DWORD             ParseOSType(char *szOSType);
00245 BOOL              ShowAdditionalOptionsDialog(void);
00246 DWORD             GetPreviousUnfinishedState(void);
00247 void              RefreshIcons();
00248 void              NeedToInstallFiles(LPSTR szProdDir);
00249 void              LaunchOneComponent(siC *siCObject, greInfo *aGre);
00250 HRESULT           ProcessXpinstallEngine(void);
00251 void              GetXpinstallPath(char *aPath, int aPathBufSize);
00252 BOOL              GreInstallerNeedsReboot(void);
00253 void              ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
00254 void              UpdateGREInstallProgress(int percent);
00255 BOOL              IsPathWithinWindir();
00256 void              CleanupOnUpgrade();
00257 BOOL              IsInstallerProductGRE(void);
00258 HRESULT           CleanupOrphanedGREs(void);
00259 
00260 #endif /* _EXTRA_H_ */
00261