Various Mac installer features/fixes:

This commit is contained in:
sgehani%netscape.com 2000-04-05 01:56:37 +00:00
Родитель 39293204c1
Коммит e9f653b904
10 изменённых файлов: 165 добавлений и 116 удалений

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

@ -27,16 +27,15 @@ C2=Component2
Message0=Please select the components you wish to install:
[Component0]
Description Short= XPCOM
Description Short=XPCOM
Description Long=Installer technology software
Archive=install.xpi
Archive=xpcom.xpi
URL0=http://sweetlou.mcom.com/products/client/seamonkey/macos/8.x/ppc/<#buildID>/
URL1=http://dolfin.mcom.com/nsinstall/mac/xpiengine/debug/
Install Size=<#install_size>
Install Size=<#xpcom_size>
Attributes=SELECTED|INVISIBLE
[Component1]
Description Short= Navigator
Description Short=Navigator
Description Long=Web browser software
Archive=browser.xpi
Install Size=<#browser_size>
@ -44,7 +43,7 @@ URL0=ftp://sweetlou.mcom.com/products/client/seamonkey/macos/8.x/ppc/<#buildID>/
Attributes=SELECTED
[Component2]
Description Short= Mail & News
Description Short=Mail & News
Description Long=Email and Newsgroup software
Archive=mail.xpi
Install Size=<#mail_size>
@ -56,7 +55,7 @@ Message0=Click the Install button to download and install the selected component
[SmartDownload-Netscape Install]
core_file=install.xpi
core_file=xpcom.xpi
no_ads=true
silent=false
execution=false
@ -69,5 +68,5 @@ Target Document=:Mozilla Folder:Mozilla Installer
[LegacyCheck0]
Filename=:Mozilla Folder:Mozilla
Version=5.0.0b.14
Version=5.0.0a.13
Message=An older installation of Mozilla has been detected in the folder selected. You may select another folder or continue.

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

@ -27,16 +27,15 @@ C2=Component2
Message0=Please select the components you wish to install:
[Component0]
Description Short= XPCOM
Description Short=XPCOM
Description Long=Installer technology software
Archive=install.xpi
Archive=xpcom.xpi
URL0=http://sweetlou.mcom.com/products/client/seamonkey/macos/8.x/ppc/<#buildID>/
URL1=http://dolfin.mcom.com/nsinstall/mac/xpiengine/debug/
Install Size=<#install_size>
Install Size=<#xpcom_size>
Attributes=SELECTED|INVISIBLE
[Component1]
Description Short= Navigator
Description Short=Navigator
Description Long=Web browser software
Archive=browser.xpi
Install Size=<#browser_size>
@ -44,7 +43,7 @@ URL0=ftp://sweetlou.mcom.com/products/client/seamonkey/macos/8.x/ppc/<#buildID>/
Attributes=SELECTED
[Component2]
Description Short= Mail & News
Description Short=Mail & News
Description Long=Email and Newsgroup software
Archive=mail.xpi
Install Size=<#mail_size>
@ -56,7 +55,7 @@ Message0=Click the Install button to download and install the selected component
[SmartDownload-Netscape Install]
core_file=install.xpi
core_file=xpcom.xpi
no_ads=true
silent=false
execution=false
@ -69,5 +68,5 @@ Target Document=:Mozilla Folder:Mozilla Installer
[LegacyCheck0]
Filename=:Mozilla Folder:Mozilla
Version=5.0.0b.14
Version=5.0.0a.13
Message=An older installation of Mozilla has been detected in the folder selected. You may select another folder or continue.

Двоичные данные
xpinstall/wizard/mac/rsrc/MIWCommon.rsrc

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

Двоичные данные
xpinstall/wizard/mac/rsrc/Mozilla.rsrc

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

Двоичные данные
xpinstall/wizard/mac/rsrc/Netscape.rsrc

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

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

@ -35,6 +35,7 @@
static int rowToComp[kMaxComponents];
static int numRows = 0;
static Boolean bFirstDraw = true;
void
ShowComponentsWin(void)
@ -137,7 +138,7 @@ ShowComponentsWin(void)
FrameRect(&listBoxFrame);
ShowNavButtons( back, next);
if (bCellSelected)
SetOptInfo(NULL);
SetOptInfo(true);
else
DrawDiskSpaceMsgs( gControls->opt->vRefNum );
@ -261,7 +262,7 @@ InComponentsContent(EventRecord* evt, WindowPtr wCurrPtr)
}
}
SetOptInfo(evt);
SetOptInfo(false);
}
/* Mouse Down */
@ -447,53 +448,51 @@ UpdateRowHighlight(Point localPt)
}
void
UpdateDependencies(int row, EventRecord* evt)
ResolveDependees(int compIdx, int beingSelected)
{
int i;
short currRow;
Cell currCell;
Rect currCellRect;
Point currCellPt;
GrafPtr oldPort;
GetPort(&oldPort);
if (gWPtr)
SetPort(gWPtr);
// assume we are toggling and update this component's ref count
if (beingSelected == kSelected)
gControls->cfg->comp[compIdx].refcnt = 1;
else
gControls->cfg->comp[compIdx].refcnt = 0;
UpdateRefCount(compIdx, beingSelected);
// if row is selected
if (gControls->cfg->comp[rowToComp[row]].selected)
// resolve selected value based on updated ref counts
gControls->opt->numCompSelected = 0;
for (i = 0; i < gControls->cfg->numComps; i++)
{
// loop through all components numComps
for (i=0; i<gControls->cfg->numComps; i++)
if (gControls->cfg->comp[i].refcnt > 0)
{
// if kDependencyOn for curr dep component --> comp[rowToComp[row]].dep[i]
if (gControls->cfg->comp[rowToComp[row]].dep[i] == kDependencyOn)
{
// if curr dep component isn't on
if (gControls->cfg->comp[i].selected == kNotSelected)
{
// set curr dep comp to kSelected
gControls->cfg->comp[i].selected = kSelected;
// if curr dep comp is in currently displayed comps
currRow = GetCompRow(i);
if (currRow != kInvalidCompIdx)
gControls->opt->numCompSelected++;
}
else
{
// LClick the row to check curr dep comp's checkbox
SetPt(&currCell, 0, currRow);
LRect(&currCellRect, currCell, gControls->cw->compList);
SetPt(&currCellPt, currCellRect.left+1, currCellRect.top+1);
LClick(currCellPt, evt->modifiers, gControls->cw->compList);
gControls->cfg->comp[i].refcnt = 0; // prevent sub-zero
gControls->cfg->comp[i].selected = kNotSelected;
}
}
}
// resolve its dependencies
UpdateDependencies(currRow, evt);
}
}
}
}
void
UpdateRefCount(int compIdx, int beingSelected)
{
int i;
SetPort(oldPort);
// loop through all components
for (i = 0; i < gControls->cfg->numComps; i++)
{
// if the curr comp has currently toggled comp in its dep list
if (gControls->cfg->comp[i].dep[compIdx] == kDependeeOn)
{
if (beingSelected == kSelected)
gControls->cfg->comp[i].refcnt++;
else
gControls->cfg->comp[i].refcnt--;
}
}
}
short
@ -511,39 +510,55 @@ GetCompRow(int compIdx)
}
void
SetOptInfo(EventRecord* evt)
SetOptInfo(Boolean bDrawingWindow)
{
Boolean isCellSelected;
Cell currCell;
int i;
int row, beingSelected;
Boolean setSelected;
for(i=0; i<numRows; i++)
// if we are drawing window *and* doing so for the first time
// we need to go through each cell and resolve its dependees
// only turning them on
/*
if (bDrawingWindow && bFirstDraw)
{
if (gControls->cfg->comp[rowToComp[i]].invisible)
continue;
SetPt(&currCell, 0, i);
if ( (isCellSelected = LGetSelect( false, &currCell, gControls->cw->compList)) == true)
for (row = 0; row < numRows; row++)
{
if (gControls->cfg->comp[rowToComp[i]].selected == false)
{
gControls->cfg->comp[rowToComp[i]].selected = true;
gControls->opt->numCompSelected++;
if (evt)
UpdateDependencies(i, evt);
SetPt(&currCell, 0, row);
if (LGetSelect(false, &currCell, gControls->cw->compList))
ResolveDependees(rowToComp[row], kSelected);
}
if (!gControls->cw->compDescBox)
bFirstDraw = false;
}
*/
// else we are responding to a click
// so we must determine the row clicked and resolve its dependees
// bumping up their ref counts if this row is selected
// and down if this row is unselected
if (!bDrawingWindow)
{
ErrorHandler();
return;
currCell = LLastClick(gControls->cw->compList);
row = currCell.v;
// toggle from on to off or vice versa
if (gControls->cfg->comp[rowToComp[row]].selected)
beingSelected = kNotSelected;
else
beingSelected = kSelected;
ResolveDependees(rowToComp[row], beingSelected);
}
}
else if (gControls->cfg->comp[rowToComp[i]].selected == true)
// then update the UI
for (row = 0; row < numRows; row++)
{
gControls->cfg->comp[rowToComp[i]].selected = false;
gControls->opt->numCompSelected--;
}
SetPt(&currCell, 0, row);
if (gControls->cfg->comp[rowToComp[row]].selected == kSelected)
setSelected = true;
else
setSelected = false;
LSetSelect(setSelected, currCell, gControls->cw->compList);
}
ClearDiskSpaceMsgs();

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

@ -30,14 +30,14 @@
pascal void* Install(void* unused)
{
short vRefNum, srcVRefNum;
long dirID, srcDirID;
long dirID, srcDirID, modulesDirID;
OSErr err;
FSSpec idiSpec, coreFileSpec;
#ifdef MIW_DEBUG
FSSpec tmpSpec;
#endif
SDISTRUCT sdistruct;
Str255 pIDIfname;
Str255 pIDIfname, pModulesDir;
StringPtr coreFile;
THz ourHZ;
Boolean isDir = false, bCoreExists = false;
@ -77,8 +77,13 @@ pascal void* Install(void* unused)
return (void*)nil;
}
if (!ExistArchives(srcVRefNum, srcDirID))
/* get the "Installer Modules" relative subdir */
GetIndString(pModulesDir, rStringList, sInstModules);
isDir = false; /* reuse */
modulesDirID = 0;
GetDirectoryID(srcVRefNum, srcDirID, pModulesDir, &modulesDirID, &isDir);
srcDirID = modulesDirID;
if (!isDir || !ExistArchives(srcVRefNum, srcDirID))
{
/* download location is same as extraction location */
srcVRefNum = vRefNum;
@ -135,7 +140,7 @@ pascal void* Install(void* unused)
}
else
bCoreExists = true;
/* otherwise core exists in cwd, different from extraction location */
/* otherwise core exists in cwd:InstallerModules, different from extraction location */
/* check if coreFile was downloaded */
@ -709,13 +714,20 @@ InitProgressBar(void)
Boolean
InitSDLib(void)
{
Str255 libName;
Str255 libName, pModulesDir;
FSSpec libSpec;
short vRefNum;
long dirID;
long dirID, cwdDirID;
Boolean isDir = false;
OSErr err;
ERR_CHECK_RET(GetCWD(&dirID, &vRefNum), false);
ERR_CHECK_RET(GetCWD(&cwdDirID, &vRefNum), false);
/* get the "Installer Modules" relative subdir */
GetIndString(pModulesDir, rStringList, sInstModules);
GetDirectoryID(vRefNum, cwdDirID, pModulesDir, &dirID, &isDir);
if (!isDir) /* bail if we can't find the "Installer Modules" dir */
return false;
/* initialize SDI lib and struct */
GetIndString(libName, rStringList, sSDLib);

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

@ -136,8 +136,8 @@ if (err) \
#define kSelected 1
#define kNotInSetupType 0
#define kInSetupType 1
#define kDependencyOff 0
#define kDependencyOn 1
#define kDependeeOff 0
#define kDependeeOn 1
#define kInvalidCompIdx -999
#define kMaxCoreFiles 256
#define kMaxProgUnits 100.0
@ -216,6 +216,7 @@ if (err) \
#define sSpOfSp 26
#define sProcessing 27
#define sReadme 28
#define sInstModules 29
#define rTitleStrList 170
#define sNSInstTitle 1 /* end i18n strings */
@ -270,7 +271,7 @@ if (err) \
#define sInstSize 24
#define sAttributes 25
#define sURL 26
#define sDependency 31
#define sDependee 31
#define sRandomInstall 34
#define sRunApp 35
@ -312,10 +313,11 @@ typedef struct InstComp {
Boolean invisible;
Boolean launchapp;
/* dependencies */
/* dependees */
Handle depName[kMaxComponents];
short dep[kMaxComponents];
short numDeps;
short refcnt;
/* UI highlighting */
Boolean highlighted;
@ -511,7 +513,7 @@ OSErr PopulateCompWinKeys(char *);
OSErr PopulateTermWinKeys(char *);
OSErr PopulateIDIKeys(char *);
OSErr PopulateMiscKeys(char *);
OSErr MapDependencies(void);
OSErr MapDependees(void);
Boolean RandomSelect(long);
short GetComponentIndex(Handle);
Boolean FillKeyValueForIDIKey(short, Handle, char *);
@ -605,11 +607,12 @@ void UpdateCompWin(void);
void InComponentsContent(EventRecord*, WindowPtr);
void MouseMovedInComponentsWin(EventRecord *);
short GetCompRow(int);
void SetOptInfo(EventRecord* evt);
void SetOptInfo(Boolean);
void InitRowHighlight(int);
void UpdateRowHighlight(Point);
void UpdateLongDesc(int);
void UpdateDependencies(int, EventRecord*);
void ResolveDependees(int, int);
void UpdateRefCount(int, int);
Boolean LegacyFileCheck(short, long);
int CompareVersion(Handle, Handle);
void EnableComponentsWin(void);

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

@ -39,6 +39,7 @@ PullDownConfig(void *unused)
Str255 pIDIfname;
ERR_CHECK_RET(GetCWD(&dirID, &vRefNum), (void*)0);
// XXX if we ever use this we need to pull down to "Installer Modules" now
GetIndString(pIDIfname, rStringList, sConfigIDIName);
@ -80,7 +81,7 @@ ParseConfig(void)
ERR_CHECK(PopulateIDIKeys(cfgText));
ERR_CHECK(PopulateMiscKeys(cfgText));
ERR_CHECK(MapDependencies());
ERR_CHECK(MapDependees());
if (cfgText)
DisposePtr(cfgText);
@ -89,16 +90,22 @@ ParseConfig(void)
Boolean
ReadConfigFile(char **text)
{
Boolean bSuccess = false;
Boolean bSuccess = false, isDir = false;
OSErr err;
FSSpec cfgFile;
long dirID, dataSize;
long cwdDirID, dirID, dataSize;
short vRefNum, fileRefNum;
Str255 fname;
Str255 fname, pModulesDir;
*text = nil;
ERR_CHECK_RET(GetCWD(&dirID, &vRefNum), false);
ERR_CHECK_RET(GetCWD(&cwdDirID, &vRefNum), false);
/* get the "Installer Modules" relative subdir */
GetIndString(pModulesDir, rStringList, sInstModules);
GetDirectoryID(vRefNum, cwdDirID, pModulesDir, &dirID, &isDir);
if (!isDir) /* bail if we can't find the "Installer Modules" dir */
return false;
/* open config.ini file */
GetIndString(fname, rStringList, sConfigFName);
@ -330,9 +337,15 @@ PopulateCompWinKeys(char *cfgText)
if (randomPercent != 0) /* idiot proof for those giving 0 as the rand percent */
{
if (RandomSelect(randomPercent))
{
gControls->cfg->comp[i].selected = true;
gControls->cfg->comp[i].refcnt = 1;
}
else
{
gControls->cfg->comp[i].selected = false;
gControls->cfg->comp[i].refcnt = 0;
}
}
else
bRandomSet = false;
@ -358,9 +371,15 @@ PopulateCompWinKeys(char *cfgText)
if (!bRandomSet) /* when random key specified then selected attr is overriden */
{
if (NULL != strstr(*attrValH, attrType))
{
gControls->cfg->comp[i].selected = true;
gControls->cfg->comp[i].refcnt = 1;
}
else
{
gControls->cfg->comp[i].selected = false;
gControls->cfg->comp[i].refcnt = 0;
}
}
if (attrType)
DisposePtr(attrType);
@ -419,13 +438,13 @@ PopulateCompWinKeys(char *cfgText)
DisposePtr(currKeyBuf);
}
/* dependencies on other components */
/* dependees for other components */
gControls->cfg->comp[i].numDeps = 0;
GetIndString(pkey, rParseKeys, sDependency);
GetIndString(pkey, rParseKeys, sDependee);
currKeyBuf = PascalToC(pkey);
for (j=0; j<kMaxComponents; j++)
{
// currKey = "Dependency<j>"
// currKey = "Dependee<j>"
currDepNum = ltoa(j);
currKey = NewPtrClear(strlen(currKeyBuf) + strlen(currDepNum));
strncpy(currKey, currKeyBuf, strlen(currKeyBuf));
@ -714,28 +733,29 @@ PopulateMiscKeys(char *cfgText)
#pragma mark -
OSErr
MapDependencies()
MapDependees()
{
OSErr err = noErr;
int i, j, compIdx;
for (i=0; i<gControls->cfg->numComps; i++)
{
// init all deps to off
for (j=0; j<kMaxComponents; j++)
{
gControls->cfg->comp[i].dep[j] = kDependencyOff;
gControls->cfg->comp[i].dep[j] = kDependeeOff;
}
// loop through turning on deps
for(j=0; j<gControls->cfg->comp[i].numDeps; j++)
{
compIdx = GetComponentIndex(gControls->cfg->comp[i].depName[j]);
if (compIdx != kInvalidCompIdx)
{
gControls->cfg->comp[i].dep[compIdx] = kDependencyOn;
gControls->cfg->comp[i].dep[compIdx] = kDependeeOn;
// turn on dependencies
if (gControls->cfg->comp[i].selected == kSelected)
gControls->cfg->comp[compIdx].selected = kSelected;
// we deal with making it selected and mucking with the ref count
// in the components win code (see ComponentsWin.c:{SetOptInfo(), ResolveDependees()}
}
}
}
@ -769,7 +789,7 @@ GetComponentIndex(Handle compName)
for (i=0; i<gControls->cfg->numComps; i++)
{
HLock(gControls->cfg->comp[i].shortDesc);
if (0==strncmp(*gControls->cfg->comp[i].shortDesc, *compName, strlen(*gControls->cfg->comp[i].shortDesc)))
if (0==strcmp(*gControls->cfg->comp[i].shortDesc, *compName))
{
compIdx = i;
HUnlock(gControls->cfg->comp[i].shortDesc);

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

@ -360,6 +360,7 @@ InsertCompList(int instChoice)
for(i=0; i<kMaxComponents; i++)
{
if ( (gControls->cfg->st[instChoice].comp[i] == kInSetupType) &&
(!gControls->cfg->comp[i].invisible) &&
(compsDone < gControls->cfg->st[instChoice].numComps) )
{
currComp = gControls->cfg->comp[i];