This commit is contained in:
selmer%netscape.com 1999-10-23 01:21:09 +00:00
Родитель b647484cb7
Коммит ce93886aa0
6 изменённых файлов: 59 добавлений и 116 удалений

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

@ -46,7 +46,7 @@ Caption=1st level node
[Navigation Controls]
onNext=Message(Are you ready to build your customized installers? [Yes]/[No])
onNext=Message(Are you ready to build your customized installers? [Yes]/[No]);IBEngine.StartIB()
Help=InstallerHelp.ini

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

@ -9,9 +9,6 @@
#include "NewDialog.h"
#include "NewConfigDialog.h"
// for CopyDir
#include "winbase.h"
// The following is included to make
// the browse for a dir code compile
#include <shlobj.h>
@ -222,44 +219,6 @@ BOOL CInterpret::Progress()
return TRUE;
}
void CInterpret::CopyDir(CString from, CString to)
{
WIN32_FIND_DATA data;
HANDLE d;
CString dot = ".";
CString dotdot = "..";
CString fchild, tchild;
CString pattern = from + "\\*.*";
int found;
DWORD tmp;
d = FindFirstFile((const char *) to, &data);
if (d == INVALID_HANDLE_VALUE)
mkdir(to);
d = FindFirstFile((const char *) pattern, &data);
found = (d != INVALID_HANDLE_VALUE);
while (found)
{
if (data.cFileName != dot && data.cFileName != dotdot)
{
fchild = from + "\\" + data.cFileName;
tchild = to + "\\" + data.cFileName;
tmp = data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
if (tmp == FILE_ATTRIBUTE_DIRECTORY)
CopyDir(fchild, tchild);
else
CopyFile((const char *) fchild, (const char *) tchild, FALSE);
}
found = FindNextFile(d, &data);
}
FindClose(d);
}
void CInterpret::ExecuteCommand(char *command, int showflag)
{
STARTUPINFO startupInfo;
@ -604,8 +563,6 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
else if (strcmp(pcmd, "Message") ==0)
{
int rv = AfxMessageBox(parms,MB_YESNO);
if (rv == IDYES)
return TRUE;
if (rv == IDNO)
return FALSE;
}

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

@ -37,7 +37,6 @@ public:
BOOL BrowseFile(WIDGET *curWidget);
BOOL BrowseDir(WIDGET *curWidget);
BOOL Progress(); // Not actually used right now
void CopyDir(CString from, CString to);
void ExecuteCommand(char *command, int showflag);
BOOL IterateListBox(char *parms);
CString replaceVars(CString str, char *listval);

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

@ -1,5 +1,7 @@
#include "stdafx.h"
#include "WizardTypes.h"
#include "winbase.h" // for CopyDir
#include <direct.h>
__declspec(dllexport) WIDGET GlobalWidgetArray[1000];
__declspec(dllexport) int GlobalArrayIndex=0;
@ -50,4 +52,42 @@ char *GetGlobal(CString theName)
return "";
}
extern "C" __declspec(dllexport)
void CopyDir(CString from, CString to)
{
WIN32_FIND_DATA data;
HANDLE d;
CString dot = ".";
CString dotdot = "..";
CString fchild, tchild;
CString pattern = from + "\\*.*";
int found;
DWORD tmp;
d = FindFirstFile((const char *) to, &data);
if (d == INVALID_HANDLE_VALUE)
mkdir(to);
d = FindFirstFile((const char *) pattern, &data);
found = (d != INVALID_HANDLE_VALUE);
while (found)
{
if (data.cFileName != dot && data.cFileName != dotdot)
{
fchild = from + "\\" + data.cFileName;
tchild = to + "\\" + data.cFileName;
tmp = data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
if (tmp == FILE_ATTRIBUTE_DIRECTORY)
CopyDir(fchild, tchild);
else
CopyFile((const char *) fchild, (const char *) tchild, FALSE);
}
found = FindNextFile(d, &data);
}
FindClose(d);
}

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

@ -7,3 +7,4 @@ extern __declspec(dllimport) int GlobalArrayIndex;
extern "C" __declspec(dllimport) char * GetGlobal(CString theName);
extern "C" __declspec(dllimport) WIDGET* SetGlobal(CString theName, CString theValue);
extern "C" __declspec(dllimport) WIDGET* findWidget(CString theName);
extern "C" __declspec(dllimport) void CopyDir(CString from, CString to);

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

@ -7,77 +7,23 @@
extern "C" __declspec(dllexport)
int StartIB(CString parms)
{
CString root = GetGlobal("Root");
CString root = GetGlobal("Root");
CString config = GetGlobal("CustomizationList");
CString fromPath = root + "\\Installer";
CString destPath = root + "\\Configs\\" + config + "\\Output";
// Copy default installer files into config
CopyDir(fromPath, destPath);
// Update config.ini with new content
CString inst_text1 = GetGlobal("InstallerScreenText1");
CString programPath = CString("C:\\Program Files\\Netscape\\Communicator");
CString configINI = CString(destPath + "\\config.ini");
WritePrivateProfileString( "General", "Product Name", inst_text1, configINI);
WritePrivateProfileString( "General", "Path", programPath, configINI);
WritePrivateProfileString( "General", "Program Folder Name", config, configINI);
return TRUE;
}
#if 0
extern "C" __declspec(dllexport)
int StartIB_old(CString parms)
{
char installPath[MAX_SIZE];
char destPath[MAX_SIZE];
char curSrcFile[MAX_SIZE];
char curDestFile[MAX_SIZE];
// Added because wizmach had these global
CString CachePath;
CString Path;
// Create config.ini here
// Read from cck.che and write the relavant stuff to config.ini
char inst_text1[MAX_SIZE] = { '\0' };
char path[MAX_SIZE]= { '\0' };
char config[MAX_SIZE]= { '\0' };
/* Get globals??? */
GetPrivateProfileString("data", "InstallerScreenText1", "", inst_text1, MAX_SIZE, (LPCTSTR) CachePath);
GetPrivateProfileString("data", "Root", "", path, MAX_SIZE, (LPCTSTR) CachePath);
GetPrivateProfileString("data", "CustomizationList", "", config, MAX_SIZE, (LPCTSTR) CachePath);
int extractPosition = CachePath.ReverseFind('\\');
extractPosition++;
CString configPath = CachePath.Left(extractPosition);;
//windows path--Path
//dest path--configPath
// Setting up the install path
strcpy(installPath, (char *) (LPCTSTR) Path);
strcat(installPath, "install\\");
// Setting up the destination Path
strcpy(destPath, (char *) (LPCTSTR) configPath);
/* CopyDir??? */
strcpy(curSrcFile, installPath);
strcat(curSrcFile, "config.ini");
strcpy(curDestFile, destPath);
strcat(curDestFile, "config.ini");
CopyFile(curSrcFile, curDestFile, FALSE);
strcpy(curSrcFile, installPath);
strcat(curSrcFile, "setup.exe");
strcpy(curDestFile, destPath);
strcat(curDestFile, "setup.exe");
CopyFile(curSrcFile, curDestFile, FALSE);
strcpy(curSrcFile, installPath);
strcat(curSrcFile, "setuprsc.dll");
strcpy(curDestFile, destPath);
strcat(curDestFile, "setuprsc.dll");
CopyFile(curSrcFile, curDestFile, FALSE);
/* Update config.ini with new content */
WritePrivateProfileString( "General", "Product Name", inst_text1, configPath + "\\config.ini");
WritePrivateProfileString( "General", "Path", path, configPath + "\\config.ini");
WritePrivateProfileString( "General", "Program Folder Name", config, configPath + "\\config.ini");
return TRUE;
}
#endif