Feeble first DLL for IB

git-svn-id: svn://10.0.0.236/trunk@51601 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
selmer%netscape.com 1999-10-23 00:10:24 +00:00
parent efe6dfa795
commit a1f6f3c1a3
2 changed files with 158 additions and 0 deletions

83
mozilla/cck/ib/ib.cpp Normal file
View File

@ -0,0 +1,83 @@
#include "stdafx.h"
#include <Winbase.h>
#include "globals.h"
#define MAX_SIZE 1024
extern "C" __declspec(dllexport)
int StartIB(CString parms)
{
CString root = GetGlobal("Root");
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

View File

@ -0,0 +1,75 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH=..\..
include <$(DEPTH)\config\config.mak>
LIBRARY_NAME=ibengine
MODULE=ib
REQUIRES=
IS_COMPONENT = 1
OBJS= \
.\$(OBJDIR)\ib.obj \
$(NULL)
LINCS= $(LINCS) \
-I..\include \
-I$(PUBLIC)\zlib \
$(NULL)
MAKE_OBJ_TYPE = DLL
DLLNAME = ibengine
DLL=.\$(OBJDIR)\$(DLLNAME).dll
CFLAGS = \
-W3 \
-GX \
-DWIN32 \
-D_WINDOWS \
-D_AFXDLL \
-D_MBCS \
-FD \
-c \
$(CFLAGS)
LCFLAGS = $(LCFLAGS) \
$(DEFINES) \
$(NULL)
# These are the libraries we need to link with to create the dll
LLIBS= $(LLIBS) \
../lib/globals.lib \
$(NULL)
!ifdef MOZ_NO_DEBUG_RTL
LLFLAGS= /NODEFAULTLIB msvcirt.lib msvcrt.lib
#LLFLAGS= /NODEFAULTLIB
!endif
include <$(DEPTH)\config\rules.mak>
libs:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll ..\cckwiz
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib ..\lib
#clobber::
# rm -f $(DIST)\bin\$(DLLNAME).dll
# rm -f $(DIST)\lib\$(DLLNAME).lib