зеркало из https://github.com/mozilla/pjs.git
Include IB into the wizard
This commit is contained in:
Родитель
b647484cb7
Коммит
ce93886aa0
|
@ -46,7 +46,7 @@ Caption=1st level node
|
||||||
|
|
||||||
[Navigation Controls]
|
[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
|
Help=InstallerHelp.ini
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,6 @@
|
||||||
#include "NewDialog.h"
|
#include "NewDialog.h"
|
||||||
#include "NewConfigDialog.h"
|
#include "NewConfigDialog.h"
|
||||||
|
|
||||||
// for CopyDir
|
|
||||||
#include "winbase.h"
|
|
||||||
|
|
||||||
// The following is included to make
|
// The following is included to make
|
||||||
// the browse for a dir code compile
|
// the browse for a dir code compile
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
@ -222,44 +219,6 @@ BOOL CInterpret::Progress()
|
||||||
return TRUE;
|
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)
|
void CInterpret::ExecuteCommand(char *command, int showflag)
|
||||||
{
|
{
|
||||||
STARTUPINFO startupInfo;
|
STARTUPINFO startupInfo;
|
||||||
|
@ -604,8 +563,6 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
|
||||||
else if (strcmp(pcmd, "Message") ==0)
|
else if (strcmp(pcmd, "Message") ==0)
|
||||||
{
|
{
|
||||||
int rv = AfxMessageBox(parms,MB_YESNO);
|
int rv = AfxMessageBox(parms,MB_YESNO);
|
||||||
if (rv == IDYES)
|
|
||||||
return TRUE;
|
|
||||||
if (rv == IDNO)
|
if (rv == IDNO)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ public:
|
||||||
BOOL BrowseFile(WIDGET *curWidget);
|
BOOL BrowseFile(WIDGET *curWidget);
|
||||||
BOOL BrowseDir(WIDGET *curWidget);
|
BOOL BrowseDir(WIDGET *curWidget);
|
||||||
BOOL Progress(); // Not actually used right now
|
BOOL Progress(); // Not actually used right now
|
||||||
void CopyDir(CString from, CString to);
|
|
||||||
void ExecuteCommand(char *command, int showflag);
|
void ExecuteCommand(char *command, int showflag);
|
||||||
BOOL IterateListBox(char *parms);
|
BOOL IterateListBox(char *parms);
|
||||||
CString replaceVars(CString str, char *listval);
|
CString replaceVars(CString str, char *listval);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "WizardTypes.h"
|
#include "WizardTypes.h"
|
||||||
|
#include "winbase.h" // for CopyDir
|
||||||
|
#include <direct.h>
|
||||||
|
|
||||||
__declspec(dllexport) WIDGET GlobalWidgetArray[1000];
|
__declspec(dllexport) WIDGET GlobalWidgetArray[1000];
|
||||||
__declspec(dllexport) int GlobalArrayIndex=0;
|
__declspec(dllexport) int GlobalArrayIndex=0;
|
||||||
|
@ -50,4 +52,42 @@ char *GetGlobal(CString theName)
|
||||||
return "";
|
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) char * GetGlobal(CString theName);
|
||||||
extern "C" __declspec(dllimport) WIDGET* SetGlobal(CString theName, CString theValue);
|
extern "C" __declspec(dllimport) WIDGET* SetGlobal(CString theName, CString theValue);
|
||||||
extern "C" __declspec(dllimport) WIDGET* findWidget(CString theName);
|
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)
|
extern "C" __declspec(dllexport)
|
||||||
int StartIB(CString parms)
|
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;
|
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
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче