This is the initial checkin for the windows native install wizard. This will not affect the seamonkey builds.

This commit is contained in:
ssu%netscape.com 1999-09-01 18:31:18 +00:00
Родитель b9c55873b4
Коммит e387fa8727
41 изменённых файлов: 10267 добавлений и 0 удалений

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

@ -0,0 +1,563 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#include <windows.h>
#include "resource.h"
#include "zlib.h"
#define BAR_MARGIN 1
#define BAR_SPACING 2
#define BAR_WIDTH 6
#define MAX_BUF 4096
char szTitle[4096];
HINSTANCE hInst;
/////////////////////////////////////////////////////////////////////////////
// Global Declarations
static DWORD nTotalBytes = 0; // sum of all the FILE resources
struct ExtractFilesDlgInfo {
HWND hWndDlg;
int nMaxBars; // maximum number of bars that can be displayed
int nBars; // current number of bars to display
} dlgInfo;
/////////////////////////////////////////////////////////////////////////////
// Utility Functions
// This function is similar to GetFullPathName except instead of
// using the current drive and directory it uses the path of the
// directory designated for temporary files
static BOOL
GetFullTempPathName(LPCTSTR lpszFileName, DWORD dwBufferLength, LPTSTR lpszBuffer)
{
DWORD dwLen;
dwLen = GetTempPath(dwBufferLength, lpszBuffer);
if (lpszBuffer[dwLen - 1] != '\\')
strcat(lpszBuffer, "\\");
strcat(lpszBuffer, lpszFileName);
return TRUE;
}
// this function appends a backslash at the end of a string,
// if one does not already exists.
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize)
{
if(szInput != NULL)
{
if(szInput[strlen(szInput) - 1] != '\\')
{
if(((DWORD)lstrlen(szInput) + 1) < dwInputSize)
{
lstrcat(szInput, "\\");
}
}
}
}
// This function removes a directory and its subdirectories
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szDestTemp[MAX_BUF];
BOOL bFound;
if(GetFileAttributes(szDestination) == -1)
return(0);
if(bRemoveSubdirs == TRUE)
{
lstrcpy(szDestTemp, szDestination);
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
lstrcat(szDestTemp, "*");
bFound = TRUE;
hFile = FindFirstFile(szDestTemp, &fdFile);
while((hFile != INVALID_HANDLE_VALUE) && (bFound == TRUE))
{
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
/* create full path */
lstrcpy(szDestTemp, szDestination);
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
lstrcat(szDestTemp, fdFile.cFileName);
if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
DirectoryRemove(szDestTemp, bRemoveSubdirs);
}
else
{
DeleteFile(szDestTemp);
}
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
}
RemoveDirectory(szDestination);
return(0);
}
// Centers the specified window over the desktop. Assumes the window is
// smaller both horizontally and vertically than the desktop
static void
CenterWindow(HWND hWndDlg)
{
RECT rect;
int iLeft, iTop;
GetWindowRect(hWndDlg, &rect);
iLeft = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
iTop = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
SetWindowPos(hWndDlg, NULL, iLeft, iTop, -1, -1,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
/////////////////////////////////////////////////////////////////////////////
// Extract Files Dialog
// This routine updates the status string in the extracting dialog
static void
SetStatusLine(LPCTSTR lpszStatus)
{
HWND hWndLabel = GetDlgItem(dlgInfo.hWndDlg, IDC_STATUS);
SetWindowText(hWndLabel, lpszStatus);
UpdateWindow(hWndLabel);
}
// This routine will update the progress bar to the specified percentage
// (value between 0 and 100)
static void
UpdateProgressBar(unsigned value)
{
int nBars;
// Figure out how many bars should be displayed
nBars = dlgInfo.nMaxBars * value / 100;
// Only paint if we need to display more bars
if (nBars > dlgInfo.nBars) {
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE);
RECT rect;
// Update the gauge state before painting
dlgInfo.nBars = nBars;
// Only invalidate the part that needs updating
GetClientRect(hWndGauge, &rect);
rect.left = BAR_MARGIN + (nBars - 1) * (BAR_WIDTH + BAR_SPACING);
InvalidateRect(hWndGauge, &rect, FALSE);
// Update the whole extracting dialog. We do this because we don't
// have a message loop to process WM_PAINT messages in case the
// extracting dialog was exposed
UpdateWindow(dlgInfo.hWndDlg);
}
}
// Window proc for dialog
BOOL APIENTRY
DialogProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
// Center the dialog over the desktop
CenterWindow(hWndDlg);
return FALSE;
case WM_COMMAND:
DestroyWindow(hWndDlg);
return TRUE;
}
return FALSE; // didn't handle the message
}
/////////////////////////////////////////////////////////////////////////////
// Resource Callback Functions
BOOL APIENTRY
DeleteTempFilesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
{
char szTmpFile[MAX_PATH];
// Get the path to the file in the temp directory
GetFullTempPathName(lpszName, sizeof(szTmpFile), szTmpFile);
// Delete the file
DeleteFile(szTmpFile);
return TRUE;
}
BOOL APIENTRY
SizeOfResourcesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
{
HRSRC hResInfo;
// Find the resource
hResInfo = FindResource((HINSTANCE)hModule, lpszName, lpszType);
#ifdef _DEBUG
if (!hResInfo) {
char buf[512];
wsprintf(buf, "Error '%d' when loading FILE resource: %s", GetLastError(), lpszName);
MessageBox(NULL, buf, szTitle, MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
#endif
// Add its size to the total size. Note that the return value is subject
// to alignment rounding, but it's close enough for our purposes
nTotalBytes += SizeofResource(NULL, hResInfo);
// Release the resource
FreeResource(hResInfo);
return TRUE; // keep enumerating
}
BOOL APIENTRY
ExtractFilesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
{
char szTmpFile[MAX_PATH];
char szArcLstFile[MAX_PATH];
HRSRC hResInfo;
HGLOBAL hGlobal;
LPBYTE lpBytes;
LPBYTE lpBytesUnCmp;
HANDLE hFile;
char szStatus[128];
char szText[4096];
// Update the UI
LoadString(hInst, IDS_STATUS_EXTRACTING, szText, sizeof(szText));
wsprintf(szStatus, szText, lpszName);
SetStatusLine(szStatus);
// Create a file in the temp directory
GetFullTempPathName(lpszName, sizeof(szTmpFile), szTmpFile);
// Extract the file
hResInfo = FindResource((HINSTANCE)hModule, lpszName, lpszType);
hGlobal = LoadResource((HINSTANCE)hModule, hResInfo);
lpBytes = (LPBYTE)LockResource(hGlobal);
// Create the file
hFile = CreateFile(szTmpFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_TEMPORARY, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
DWORD dwSize;
DWORD dwSizeUnCmp;
DWORD dwTemp;
GetFullTempPathName("Archive.lst", sizeof(szArcLstFile), szArcLstFile);
WritePrivateProfileString("Archives", lpszName, "TRUE", szArcLstFile);
lpBytesUnCmp = (LPBYTE)malloc((*(LPDWORD)(lpBytes + sizeof(DWORD))) + 1);
dwSizeUnCmp = *(LPDWORD)(lpBytes + sizeof(DWORD));
// Copy the file. The first DWORD specifies the size of the file
dwSize = *(LPDWORD)lpBytes;
lpBytes += (sizeof(DWORD) * 2);
dwTemp = uncompress(lpBytesUnCmp, &dwSizeUnCmp, lpBytes, dwSize);
while (dwSizeUnCmp > 0)
{
DWORD dwBytesToWrite, dwBytesWritten;
dwBytesToWrite = dwSizeUnCmp > 4096 ? 4096 : dwSizeUnCmp;
if (!WriteFile(hFile, lpBytesUnCmp, dwBytesToWrite, &dwBytesWritten, NULL))
{
char szBuf[512];
LoadString(hInst, IDS_STATUS_EXTRACTING, szText, sizeof(szText));
wsprintf(szBuf, szText, szTmpFile);
MessageBox(NULL, szBuf, szTitle, MB_OK | MB_ICONEXCLAMATION);
FreeResource(hResInfo);
return FALSE;
}
dwSizeUnCmp -= dwBytesWritten;
lpBytesUnCmp += dwBytesWritten;
// Update the UI to reflect the total number of bytes written
static DWORD nBytesWritten = 0;
nBytesWritten += dwBytesWritten;
UpdateProgressBar(nBytesWritten * 100 / nTotalBytes);
}
CloseHandle(hFile);
}
// Release the resource
FreeResource(hResInfo);
return TRUE; // keep enumerating
}
/////////////////////////////////////////////////////////////////////////////
// Progress bar
// Draws a recessed border around the gauge
static void
DrawGaugeBorder(HWND hWnd)
{
HDC hDC = GetWindowDC(hWnd);
RECT rect;
int cx, cy;
HPEN hShadowPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
HGDIOBJ hOldPen;
GetWindowRect(hWnd, &rect);
cx = rect.right - rect.left;
cy = rect.bottom - rect.top;
// Draw a dark gray line segment
hOldPen = SelectObject(hDC, (HGDIOBJ)hShadowPen);
MoveToEx(hDC, 0, cy - 1, NULL);
LineTo(hDC, 0, 0);
LineTo(hDC, cx - 1, 0);
// Draw a white line segment
SelectObject(hDC, GetStockObject(WHITE_PEN));
MoveToEx(hDC, 0, cy - 1, NULL);
LineTo(hDC, cx - 1, cy - 1);
LineTo(hDC, cx - 1, 0);
SelectObject(hDC, hOldPen);
DeleteObject(hShadowPen);
ReleaseDC(hWnd, hDC);
}
// Draws the blue progress bar
static void
DrawProgressBar(HWND hWnd)
{
PAINTSTRUCT ps;
HDC hDC = BeginPaint(hWnd, &ps);
RECT rect;
HBRUSH hBlueBrush = CreateSolidBrush(RGB(0, 0, 128));
// Draw the bars
GetClientRect(hWnd, &rect);
rect.left = rect.top = BAR_MARGIN;
rect.bottom -= BAR_MARGIN;
rect.right = rect.left + BAR_WIDTH;
for (int i = 0; i < dlgInfo.nBars; i++) {
RECT dest;
if (IntersectRect(&dest, &ps.rcPaint, &rect))
FillRect(hDC, &rect, hBlueBrush);
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
}
DeleteObject(hBlueBrush);
EndPaint(hWnd, &ps);
}
// Adjusts the width of the gauge based on the maximum number of bars
static void
SizeToFitGauge(HWND hWnd)
{
RECT rect;
int cx;
// Get the window size in pixels
GetWindowRect(hWnd, &rect);
// Size the width to fit
cx = 2 * GetSystemMetrics(SM_CXBORDER) + 2 * BAR_MARGIN +
dlgInfo.nMaxBars * BAR_WIDTH + (dlgInfo.nMaxBars - 1) * BAR_SPACING;
SetWindowPos(hWnd, NULL, -1, -1, cx, rect.bottom - rect.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
// Window proc for gauge
LRESULT APIENTRY
GaugeWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
DWORD dwStyle;
RECT rect;
switch (msg) {
case WM_NCCREATE:
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
return TRUE;
case WM_CREATE:
// Figure out the maximum number of bars that can be displayed
GetClientRect(hWnd, &rect);
dlgInfo.nBars = 0;
dlgInfo.nMaxBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) /
(BAR_WIDTH + BAR_SPACING);
// Size the gauge to exactly fit the maximum number of bars
SizeToFitGauge(hWnd);
return TRUE;
case WM_NCPAINT:
DrawGaugeBorder(hWnd);
return TRUE;
case WM_PAINT:
DrawProgressBar(hWnd);
return TRUE;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
/////////////////////////////////////////////////////////////////////////////
// WinMain
static BOOL
RunInstaller(LPSTR lpCmdLine)
{
PROCESS_INFORMATION pi;
STARTUPINFO sti;
char szCmdLine[MAX_PATH];
BOOL bRet;
char szText[256];
char szTempPath[4096];
char szTmp[MAX_PATH];
char szCurrentDirectory[MAX_PATH];
char szBuf[MAX_PATH];
// Update UI
UpdateProgressBar(100);
LoadString(hInst, IDS_STATUS_LAUNCHING_SETUP, szText, sizeof(szText));
SetStatusLine(szText);
memset(&sti,0,sizeof(sti));
sti.cb = sizeof(STARTUPINFO);
// Setup program is in the directory specified for temporary files
GetFullTempPathName("SETUP.EXE", sizeof(szCmdLine), szCmdLine);
GetTempPath(4096, szTempPath);
GetCurrentDirectory(MAX_PATH, szCurrentDirectory);
GetShortPathName(szCurrentDirectory, szBuf, MAX_PATH);
lstrcat(szCmdLine, " -a");
lstrcat(szCmdLine, szBuf);
if((lpCmdLine != NULL) && (*lpCmdLine != '\0'))
{
lstrcat(szCmdLine, " ");
lstrcat(szCmdLine, lpCmdLine);
}
// Launch the installer
bRet = CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, szTempPath, &sti, &pi);
if (!bRet)
return FALSE;
CloseHandle(pi.hThread);
// Wait for the InstallShield UI to appear before taking down the dialog box
WaitForInputIdle(pi.hProcess, 3000); // wait up to 3 seconds
DestroyWindow(dlgInfo.hWndDlg);
// Wait for the installer to complete
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
// That was just the installer bootstrapper. Now we need to wait for the
// installer itself. We can find the process ID by looking for a window of
// class ISINSTALLSCLASS
HWND hWnd = FindWindow("ISINSTALLSCLASS", NULL);
if (hWnd) {
DWORD dwProcessId;
HANDLE hProcess;
// Get the associated process handle and wait for it to terminate
GetWindowThreadProcessId(hWnd, &dwProcessId);
// We need the process handle to use WaitForSingleObject
hProcess = OpenProcess(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE, FALSE, dwProcessId);
if (hProcess) {
WaitForSingleObject(hProcess, INFINITE);
CloseHandle(hProcess);
}
}
// Delete the files from the temp directory
EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)DeleteTempFilesProc, 0);
// delete archive.lst file in the temp directory
GetFullTempPathName("Archive.lst", sizeof(szTmp), szTmp);
DeleteFile(szTmp);
GetFullTempPathName("core.ns", sizeof(szTmp), szTmp);
DirectoryRemove(szTmp, TRUE);
return TRUE;
}
int APIENTRY
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS wc;
hInst = hInstance;
LoadString(hInst, IDS_TITLE, szTitle, sizeof(szTitle));
// Figure out the total size of the resources
EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)SizeOfResourcesProc, 0);
// Register a class for the gauge
memset(&wc, 0, sizeof(wc));
wc.lpfnWndProc = (WNDPROC)GaugeWndProc;
wc.hInstance = hInstance;
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wc.lpszClassName = "NSGauge";
RegisterClass(&wc);
// Display the dialog box
dlgInfo.hWndDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXTRACTING),
NULL, (DLGPROC)DialogProc);
UpdateWindow(dlgInfo.hWndDlg);
// Extract the files
EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)ExtractFilesProc, 0);
// Launch the install program and wait for it to finish
RunInstaller(lpCmdLine);
return 0;
}

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

@ -0,0 +1,116 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_EXTRACTING DIALOG DISCARDABLE 0, 0, 193, 61
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Extracting..."
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",IDC_STATUS,9,13,159,8
CONTROL "",IDC_GAUGE,"NSGauge",0x0,9,31,175,11
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_STATUS_EXTRACTING "Extracting %s"
IDS_STATUS_LAUNCHING_SETUP "Launching Setup..."
IDS_ERROR_FILE_WRITE "Unable to write file %s"
IDS_TITLE "Netscape Communicator Installation"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

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

@ -0,0 +1,47 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by nsinstall.rc
//
#define IDS_PROMPT 1
#define IDS_STATUS_EXTRACTING 2
#define IDS_STATUS_LAUNCHING_SETUP 3
#define IDS_ERROR_FILE_WRITE 4
#define IDS_TITLE 5
#define IDD_EXTRACTING 101
#define IDC_STATUS 1001
#define IDC_GAUGE 1002
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1003
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

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

@ -0,0 +1,109 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// mainfrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "nszip.h"
#include "mainfrm.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// arrays of IDs used to initialize control bars
static UINT BASED_CODE indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
return 0;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers

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

@ -0,0 +1,68 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// mainfrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////

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

@ -0,0 +1,201 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// nszip.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "nszip.h"
#include "mainfrm.h"
#include "nszipdoc.h"
#include "nszipvw.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNsZipApp
BEGIN_MESSAGE_MAP(CNsZipApp, CWinApp)
//{{AFX_MSG_MAP(CNsZipApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNsZipApp construction
CNsZipApp::CNsZipApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CNsZipApp object
CNsZipApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CNsZipApp initialization
void CNsZipApp::ProcessCmdLine()
{
// Make a copy of the command line since we will change it while parsing
CString strCmdLine(m_lpCmdLine);
// Get the name of the archive
LPSTR lpArchive = strtok((LPSTR)(LPCSTR)strCmdLine, " ");
if (lpArchive) {
char szPath[MAX_PATH], szExtension[_MAX_EXT];
LPSTR lpFiles;
CDocTemplate* pTemplate;
CNsZipDoc* pDoc;
// ASSERT(m_templateList.GetCount() == 1);
// pTemplate = (CDocTemplate*)m_templateList.GetHead();
POSITION pos = GetFirstDocTemplatePosition();
pTemplate = (CDocTemplate*)GetNextDocTemplate(pos);
ASSERT(pTemplate);
ASSERT(pTemplate->IsKindOf(RUNTIME_CLASS(CDocTemplate)));
// Create a new document
VERIFY(pDoc = (CNsZipDoc*)pTemplate->CreateNewDocument());
// We need a fully qualified pathname
::GetFullPathName(lpArchive, sizeof(szPath), szPath, NULL);
// Make sure it ends with .EXE
_splitpath(szPath, NULL, NULL, NULL, szExtension);
if (stricmp(szExtension, ".exe") != 0)
strcat(szPath, ".exe");
// Now go ahead and create the archive
pDoc->OnNewDocument(szPath);
// Process the files. These can be wildcards
while (lpFiles = strtok(NULL, " "))
pDoc->AddFiles(lpFiles);
// while (lpFiles = strtok(lpArchive, " "))
// pDoc->AddFiles(lpFiles);
pDoc->OnSaveDocument(szPath);
delete pDoc;
}
}
BOOL CNsZipApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
Enable3dControls();
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CNsZipDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CNsZipView));
AddDocTemplate(pDocTemplate);
if (m_lpCmdLine[0] != '\0') {
ProcessCmdLine();
return FALSE;
}
// create a new (empty) document
OnFileNew();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// Implementation
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CNsZipApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CNsZipApp commands

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

@ -0,0 +1,66 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// nszip.h : main header file for the NSZIP application
//
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "zlib.h"
/////////////////////////////////////////////////////////////////////////////
// CNsZipApp:
// See nszip.cpp for the implementation of this class
//
class CNsZipApp : public CWinApp
{
public:
CNsZipApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNsZipApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
protected:
void ProcessCmdLine();
//{{AFX_MSG(CNsZipApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////

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

@ -0,0 +1,305 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
//Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""res\\nszip.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"\r\n"
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"#include ""afxres.rc"" \011// Standard components\r\n"
"\0"
END
/////////////////////////////////////////////////////////////////////////////
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
IDR_MAINFRAME ICON DISCARDABLE "res\\nszip.ico"
IDR_NSZIPTYPE ICON DISCARDABLE "res\\nszipdoc.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New Archive...\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open Archive...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Close Archive\tCtrl+L", ID_FILE_CLOSE
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Actions"
BEGIN
MENUITEM "Add...\tCtrl+A", ID_ACTIONS_ADD
MENUITEM "&Delete\tCtrl+D", ID_ACTIONS_DELETE
END
POPUP "&Help"
BEGIN
MENUITEM "&About NsZip...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 34, 22, 217, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About nszip"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "nszip Version 1.0",IDC_STATIC,40,10,119,8
LTEXT "Copyright \251 1995",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,176,6,32,14,WS_GROUP
END
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "NSZIP MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "NSZIP\0"
VALUE "LegalCopyright", "Copyright \251 1995\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "NSZIP.EXE\0"
VALUE "ProductName", "NSZIP Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "nszip\n\nNszip\n\n\nNszip.Document\nNszip Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "nszip"
AFX_IDS_IDLEMESSAGE "Ready"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "CAP"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "SCRL"
ID_INDICATOR_OVR "OVR"
ID_INDICATOR_REC "REC"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW "Create a new archive\nNew"
ID_FILE_OPEN "Open an existing archive\nOpen"
ID_FILE_CLOSE "Close the active archive\nClose"
ID_FILE_SAVE "Save the active document\nSave"
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "Open this document"
ID_FILE_MRU_FILE2 "Open this document"
ID_FILE_MRU_FILE3 "Open this document"
ID_FILE_MRU_FILE4 "Open this document"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "Erase the selection\nErase"
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
ID_EDIT_FIND "Find the specified text\nFind"
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
ID_EDIT_UNDO "Undo the last action\nUndo"
ID_EDIT_REDO "Redo the previously undone action\nRedo"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "Change the window size"
AFX_IDS_SCMOVE "Change the window position"
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "Restore the window to normal size"
AFX_IDS_SCTASKLIST "Activate Task List"
END
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "res\nszip.rc2" // non-Microsoft Visual C++ edited resources
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#include "afxres.rc" // Standard components
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

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

@ -0,0 +1,264 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// nszipdoc.cpp : implementation of the CNsZipDoc class
//
#include "stdafx.h"
#include "nszip.h"
#include "nszipdoc.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNsZipDoc
IMPLEMENT_DYNCREATE(CNsZipDoc, CDocument)
BEGIN_MESSAGE_MAP(CNsZipDoc, CDocument)
//{{AFX_MSG_MAP(CNsZipDoc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNsZipDoc construction/destruction
CNsZipDoc::CNsZipDoc()
{
m_hUpdateFile = NULL;
}
CNsZipDoc::~CNsZipDoc()
{
}
BOOL CNsZipDoc::OnNewDocument(LPCTSTR lpszPathName)
{
char szStub[MAX_PATH];
// If we were doing a resource update, discard any changes
if (m_hUpdateFile) {
VERIFY(::EndUpdateResource(m_hUpdateFile, TRUE));
// Delete the archive
DeleteFile(m_strPathName);
}
if (!CDocument::OnNewDocument())
return FALSE;
// Set the pathname
SetPathName(lpszPathName);
// Copy the stub executable and make it the basis of the archive
::GetModuleFileName(NULL, szStub, sizeof(szStub));
strcpy(strrchr(szStub, '\\') + 1, "Nsinstall.exe");
::CopyFile(szStub, m_strPathName, FALSE); // overwrite an existing file
// Get a handle we can use with UpdateResource()
VERIFY(m_hUpdateFile = ::BeginUpdateResource(m_strPathName, FALSE));
return m_hUpdateFile != NULL;
}
/////////////////////////////////////////////////////////////////////////////
// CNsZipDoc serialization
void CNsZipDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CNsZipDoc diagnostics
#ifdef _DEBUG
void CNsZipDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CNsZipDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CNsZipDoc commands
void CNsZipDoc::OnCloseDocument()
{
// If we were doing a resource update, discard any changes
if (m_hUpdateFile) {
VERIFY(::EndUpdateResource(m_hUpdateFile, TRUE));
m_hUpdateFile = NULL;
// Delete the archive
DeleteFile(m_strPathName);
}
CDocument::OnCloseDocument();
}
BOOL CNsZipDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
// If we were doing a resource update, discard any changes
if (m_hUpdateFile) {
VERIFY(::EndUpdateResource(m_hUpdateFile, TRUE));
// Delete the archive
DeleteFile(m_strPathName);
}
DeleteContents();
// ZZZ: Get a list of all the FILE resources
ASSERT(FALSE);
return TRUE;
}
void CNsZipDoc::DeleteContents()
{
m_hUpdateFile = NULL;
CDocument::DeleteContents();
}
BOOL CNsZipDoc::OnSaveDocument(LPCTSTR lpszPathName)
{
// If we were doing a resource update, save any changes
if (m_hUpdateFile) {
BOOL bRet = ::EndUpdateResource(m_hUpdateFile, FALSE);
ASSERT(bRet);
m_hUpdateFile = NULL;
return bRet;
}
return TRUE;
}
// Add a single file to the archive
BOOL CNsZipDoc::AddFile(LPCTSTR lpszFile)
{
HANDLE hFile;
LPBYTE lpBuf;
LPBYTE lpBufCmp;
DWORD dwBytesRead;
DWORD dwFileSize;
DWORD dwFileSizeCmp;
// Check if we are trying to add the archive file itself
// (this could happen if the user passes *.* as a file spec)
if (m_strPathName.CompareNoCase(lpszFile) == 0)
return FALSE;
// Open the file
hFile = ::CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return FALSE;
// Figure out how big the file is
dwFileSize = GetFileSize(hFile, NULL);
// Allocate enough space for the file contents and a DWORD header that
// contains the size of the file
lpBuf = (LPBYTE)malloc(dwFileSize);
lpBufCmp = (LPBYTE)malloc(dwFileSize + (sizeof(DWORD) * 2));
dwFileSizeCmp = dwFileSize;
if (lpBuf) {
CString strResourceName = strrchr(lpszFile, '\\') + 1;
// It's really important that the resource name be UPPERCASE
strResourceName.MakeUpper();
// *(LPDWORD)lpBuf = dwFileSize;
::ReadFile(hFile, lpBuf, dwFileSize, &dwBytesRead, NULL);
ASSERT(dwBytesRead == dwFileSize);
if(compress((lpBufCmp + (sizeof(DWORD) * 2)), &dwFileSizeCmp, (const Bytef*)lpBuf, dwFileSize) != Z_OK)
return(FALSE);
// The first DWORD holds the total size of the file to be stored in the
// resource (in this case, it's the compressed size)
// The second DWORD holds the original uncompressed size of the file.
*(LPDWORD)lpBufCmp = dwFileSizeCmp;
*(LPDWORD)(lpBufCmp + sizeof(DWORD)) = dwFileSize;
VERIFY(::UpdateResource(m_hUpdateFile, "FILE", strResourceName,
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), lpBufCmp, dwFileSizeCmp + (sizeof(DWORD) * 2)));
}
free(lpBuf);
::CloseHandle(hFile);
return TRUE;
}
// Add one or more files to the archive (lpszFiles can be a wildcard)
void CNsZipDoc::AddFiles(LPCTSTR lpszFiles)
{
ASSERT(m_hUpdateFile);
ASSERT(lpszFiles);
if (lpszFiles) {
HANDLE hFindFile;
WIN32_FIND_DATA findFileData;
char szPath[MAX_PATH];
// Get a full pathname to the files
::GetFullPathName(lpszFiles, sizeof(szPath), szPath, NULL);
// Get the first file that matches
hFindFile = ::FindFirstFile(szPath, &findFileData);
if (hFindFile == INVALID_HANDLE_VALUE)
return;
do {
char szFile[MAX_PATH];
// We need to pass to AddFile() whatever kind of path we were passed,
// e.g. simple, relative, full
strcpy(szFile, szPath);
strcpy(strrchr(szFile, '\\') + 1, findFileData.cFileName);
AddFile(szFile);
} while (::FindNextFile(hFindFile, &findFileData));
::FindClose(hFindFile);
}
}

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

@ -0,0 +1,80 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// nszipdoc.h : interface of the CNsZipDoc class
//
/////////////////////////////////////////////////////////////////////////////
class CNsZipDoc : public CDocument
{
protected: // create from serialization only
CNsZipDoc();
DECLARE_DYNCREATE(CNsZipDoc)
// Attributes
public:
// Operations
public:
// Create an archive with the specified file name. Wrapper around
// the MFC OnNewDocument member
BOOL OnNewDocument(LPCTSTR lpszPathName);
// Add a single file to the archive
BOOL AddFile(LPCTSTR lpszFile);
// Add one or more files to the archive (lpszFiles can be a wildcard)
void AddFiles(LPCTSTR lpszFiles);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNsZipDoc)
public:
virtual void OnCloseDocument();
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual void DeleteContents();
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CNsZipDoc();
virtual void Serialize(CArchive& ar); // overridden for document i/o
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
HANDLE m_hUpdateFile;
// Generated message map functions
protected:
//{{AFX_MSG(CNsZipDoc)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////

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

@ -0,0 +1,117 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// nszipvw.cpp : implementation of the CNsZipView class
//
#include "stdafx.h"
#include "nszip.h"
#include "nszipdoc.h"
#include "nszipvw.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNsZipView
IMPLEMENT_DYNCREATE(CNsZipView, CView)
BEGIN_MESSAGE_MAP(CNsZipView, CView)
//{{AFX_MSG_MAP(CNsZipView)
ON_COMMAND(ID_ACTIONS_DELETE, OnActionsDelete)
ON_UPDATE_COMMAND_UI(ID_ACTIONS_DELETE, OnUpdateActionsDelete)
ON_COMMAND(ID_ACTIONS_ADD, OnActionsAdd)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNsZipView construction/destruction
CNsZipView::CNsZipView()
{
// TODO: add construction code here
}
CNsZipView::~CNsZipView()
{
}
/////////////////////////////////////////////////////////////////////////////
// CNsZipView drawing
void CNsZipView::OnDraw(CDC* pDC)
{
CNsZipDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CNsZipView diagnostics
#ifdef _DEBUG
void CNsZipView::AssertValid() const
{
CView::AssertValid();
}
void CNsZipView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CNsZipDoc* CNsZipView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CNsZipDoc)));
return (CNsZipDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CNsZipView message handlers
void CNsZipView::OnActionsDelete()
{
// TODO: Add your command handler code here
}
void CNsZipView::OnUpdateActionsDelete(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
}
void CNsZipView::OnActionsAdd()
{
// TODO: Add your command handler code here
}

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

@ -0,0 +1,76 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// nszipvw.h : interface of the CNsZipView class
//
/////////////////////////////////////////////////////////////////////////////
class CNsZipView : public CView
{
protected: // create from serialization only
CNsZipView();
DECLARE_DYNCREATE(CNsZipView)
// Attributes
public:
CNsZipDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNsZipView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
protected:
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CNsZipView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CNsZipView)
afx_msg void OnActionsDelete();
afx_msg void OnUpdateActionsDelete(CCmdUI* pCmdUI);
afx_msg void OnActionsAdd();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in nszipvw.cpp
inline CNsZipDoc* CNsZipView::GetDocument()
{ return (CNsZipDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////

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

@ -0,0 +1,46 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by nszip.rc
//
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_NSZIPTYPE 129
#define ID_ACTIONS_ADD 32772
#define ID_ACTIONS_DELETE 32773
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32774
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

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

@ -0,0 +1,31 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// stdafx.cpp : source file that includes just the standard includes
// nszip.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

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

@ -0,0 +1,32 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Troy Chevalier <troy@netscape.com>
* Sean Su <ssu@netscape.com>
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions

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

@ -0,0 +1,458 @@
[General]
; Run Mode values:
; Normal - Shows all dialogs. Requires user input.
; Auto - Shows some dialogs, but none requiring user input. It will
; automatically install the product using default values.
; Silent - Show no dialogs at all. It will install product using default
; values.
Run Mode=Normal
Product Name=Netscape Seamonkey
; Destination Path values:
; PROGRAMFILESDIR
; WINDISK
; WINDIR
; WINSYSDIR
Path=[PROGRAMFILESDIR]\Netscape\Seamonkey
; Program Folder Path values:
; COMMON_STARTUP
; COMMON_PROGRAMS
; COMMON_STARTMENU
; COMMON_DESKTOP
;
; PERSONAL_STARTUP
; PERSONAL_PROGRAMS
; PERSONAL_STARTMENU
; PERSONAL_DESKTOP
;
; PERSONAL_APPDATA
; PERSONAL_CACHE
; PERSONAL_COOKIES
; PERSONAL_FAVORITES
; PERSONAL_FONTS
; PERSONAL_HISTORY
; PERSONAL_NETHOOD
; PERSONAL_PERSONAL
; PERSONAL_PRINTHOOD (supported only under Windows NT)
; PERSONAL_RECENT
; PERSONAL_SENDTO
; PERSONAL_TEMPLATES
;
; PROGRAMFILESDIR
; COMMONFILESDIR
; MEDIAPATH
; CONFIGPATH (supported only under Windows95 and Windows98)
; DEVICEPATH
Program Folder Name=Netscape Seamonkey
Program Folder Path=[COMMON_PROGRAMS]
; Default Setup Type values:
; Setup Type 0 - first radio button (default)
; Setup Type 1 - second radio button
; Setup Type 2 - third radio button
; Setup Type 3 - fourth radio button (usually the Custom option)
Default Setup Type=Setup Type 0
[Dialog Welcome]
Show Dialog=TRUE
Title=Welcome
Message0=Welcome to %s Setup.
Message1=It is strongly recommended that you exit all Windows programs before running this Setup program.
Message2=Click Cancel to quit Setup and then close any programs you have running. Click Next to continue the Setup Program.
[Dialog License]
Show Dialog=FALSE
Title=Software License Agreement
License File=license.txt
Message0=
Message1=
[Dialog Setup Type]
Show Dialog=TRUE
Title=Setup Type
Message0=Click the type of Setup you prefer, then click Next.
; at least one Setup Type needs to be set, and up to 4 can be
; set (Setup Type0, Setup Type1, Setup Type2, Setup Type3).
[Setup Type0]
Description Short=B&ase
Description Long=Program will be installed with the minimal options.
; List of components to install/enable for this Setup Type.
; All other components not listed here will be disabled if
; this Setup Type is selected.
C0=Component0
;C1=Component3
[Setup Type1]
Description Short=C&omplete
Description Long=Program will be installed with the most common options.
; List of components to install/enable for this Setup Type.
; All other components not listed here will be disabled if
; this Setup Type is selected.
C0=Component0
C1=Component1
C2=Component2
;C3=Component3
[Setup Type2]
Description Short=C&ustom
Description Long=You many choose the options you want to install. Recommended for advanced users.
;Description Short=&Pro
;Description Long=Program will be installed with all the options available.
; List of components to install/enable for this Setup Type.
; All other components not listed here will be disabled if
; this Setup Type is selected.
C0=Component0
C1=Component1
C2=Component2
;C3=Component3
;[Setup Type3]
;Description Short=C&ustom
;Description Long=You many choose the options you want to install. Recommended for advanced users.
; List of components to install/enable for this Setup Type.
; All other components not listed here will be disabled if
; this Setup Type is selected.
;C0=Component0
;C1=Component1
;C2=Component2
;C3=Component3
[Dialog Select Components]
Show Dialog=TRUE
Title=Select Components
Message0=
[Dialog Windows Integration]
Show Dialog=FALSE
Title=Windows Integration
Message0=Check the Netscape Preference options you would like Setup to perform.
Message1=These settings allow you to set default Internet preferences for browsing and searching. They affect browsers installed on your machine, including Netscape Communicator and Microsoft Internet Explorer.
; Only a maximum of 4 "Windows Integration-Item"s are allowded. Each Item
; shows up as a checkbox in the Windows Integration dialog.
[Windows Integration-Item0]
CheckBoxState=FALSE
Description=Make Netscape Communicator my default Internet browser
Archive=
[Windows Integration-Item1]
CheckBoxState=FALSE
Description=Make Netscape Netcenter my home page
Archive=
[Windows Integration-Item2]
CheckBoxState=FALSE
Description=Use Netscape Netcenter to search the Web
Archive=
[Dialog Program Folder]
Show Dialog=TRUE
Title=Program Folder
Message0=Setup will add program icons to the Program Folder listed below. You may type a new folder name, or select one from the existing folder list. Click Next to continue.
[Dialog Start Install]
Show Dialog=TRUE
Title=Start Install
Message0=Setup has enough information to start copying the program files. If you want to review or change settings, click Back. If you are satisfied with the current settings, click Install to begin copying files.
[Dialog Reboot]
; Show Dialog values are:
; TRUE - Always show
; FALSE - Don't show unless at least one component has its reboot show value set
; to TRUE. This will not show even if some files were in use and a reboot
; is necessary.
; AUTO - Don't show unless a component has its reboot show value set to
; TRUE or there was at least one file in use and a reboot is
; is required for the file to be replaced correctly.
Show Dialog=FALSE
; These SmartDownload sections contain information to configure SmartDownload.
; The info is applied to all components to be downloaded.
[SmartDownload-Netscape Install]
;core_file=base.zip
;core_dir=[SETUP PATH]
no_ads=false
silent=false
execution=false
confirm_install=false
;extract_msg=Uncompressing Seamonkey. Please wait...
[SmartDownload-Proxy]
[SmartDownload-Execution]
exe=
exe_param=
; These are the components to be offered to the user (shown in the Select
; Components dialog) for installation.
; There is no limit to the number of components to install.
[Component0]
Description Short=Netscape Seamonkey
Description Long=Browser software for the internet
Archive=base.xpi
Install Size=
Install Size System=
; Attributes can be the following values:
; SELECTED - the component is selected to be installed by default.
; INVISIBLE - the component is not shown in the Select Components dialog.
Attributes=SELECTED
; url keys can be as many as needed. url0 is attempted first. if it fails,
; the next url key is tried in sequential order.
; The url should not contain the filename. Setup will assemble the complete url
; using the url keys and the Archive key.
;url0=ftp://sweetlou.mcom.com/products/client/temp/ssu
url0=ftp://sweetlou.mcom.com/products/client/seamonkey/windows/32bit/x86/current
[Component1]
Description Short=Sun JRE 1.2.2
Description Long=Sun's Java Runtime Environment
Archive=jre122.exe
Install Size=
Install Size System=
;Dependency0=Netscape Seamonkey
Parameter=-a -jdk[WINDISK]\Progra~1\JavaSoft\JRE\1.2.2
; Attributes can be the following values:
; SELECTED - the component is selected to be installed by default.
; INVISIBLE - the component is not shown in the Select Components dialog.
Attributes=SELECTED|LAUNCHAPP
; url keys can be as many as needed. url0 is attempted first. if it fails,
; the next url key is tried in sequential order.
; The url should not contain the filename. Setup will assemble the complete url
; using the url keys and the Archive key.
;url0=ftp://sweetlou.mcom.com/products/client/temp/ssu
url0=ftp://sweetlou.mcom.com/products/client/seamonkey/windows/32bit/x86/current
[Component2]
Description Short=Extras
Description Long=Extra files for more indepth testing.
Archive=extratest.xpi
Install Size=
Install Size System=
;Dependency0=Sun JRE 1.2.2
; Attributes can be the following values:
; SELECTED - the component is selected to be installed by default.
; INVISIBLE - the component is not shown in the Select Components dialog.
Attributes=SELECTED
Parameter=
; url keys can be as many as needed. url0 is attempted first. if it fails,
; the next url key is tried in sequential order.
; The url should not contain the filename. Setup will assemble the complete url
; using the url keys and the Archive key.
;url0=ftp://sweetlou.mcom.com/products/client/temp/ssu
url0=ftp://sweetlou.mcom.com/products/client/seamonkey/windows/32bit/x86/current
;[Component3]
;Description Short=Mail&News
;Description Long=Seamonkey Mail&News
;Archive=mailnews.xpi
;Install Size=
;Install Size System=
;;Dependency0=Netscape Seamonkey
;; Attributes can be the following values:
;; SELECTED - the component is selected to be installed by default.
;; INVISIBLE - the component is not shown in the Select Components dialog.
;Attributes=SELECTED
;Parameter=
;; url keys can be as many as needed. url0 is attempted first. if it fails,
;; the next url key is tried in sequential order.
;; The url should not contain the filename. Setup will assemble the complete url
;; using the url keys and the Archive key.
;;url0=ftp://sweetlou.mcom.com/products/client/seamonkey/windows/32bit/x86/current
;url0=http://warp/u/ssu/demo
;[Core]
;Source=[JAR PATH]\base.xpi
;Destination=[TEMP]\core.ns
;Cleanup=TRUE
;Message=Preparing SmartUpdate, please wait...
; The Timing key needs to be one of the following values:
; pre download - process before any files have been downloaded.
; post download - process after all files have been downloaded.
; pre core - process before the core file has been uncompressed.
; post core - process after the core file has been uncompressed.
; pre smartupdate - process before the smartupdate engine has been launched.
; post smartupdate - process after the smartupdate engine has been launched.
; pre launchapp - process before the launching of executables.
; post launchapp - process after the launching of executables.
[Uncompress File0]
Timing=post download
Source=[JAR PATH]\base.xpi
Destination=[SETUP PATH]
Message=Configuring Seamonkey, please wait...
[Uncompress File1]
Timing=post download
Source=[JAR PATH]\extratest.xpi
Destination=[SETUP PATH]
Message=Configuring Extra test files, please wait...
;[Move File0]
;Timing=post download
;Source=[SETUP PATH]\bin\*
;Destination=[SETUP PATH]\program
;[Move File1]
;Timing=post download
;Source=[SETUP PATH]\ftmain\*
;Destination=[SETUP PATH]\program
[Copy File0]
Timing=post launchapp
Source=[WINDISK]\Progra~1\JavaSoft\JRE\1.2.2\bin\npjava*.dll
Destination=[SETUP PATH]\components
Fail If Exists=FALSE
;[Copy File1]
;Timing=post launchapp
;Source=[TEMP]\xtratest\x86rel\*.*
;Destination=[SETUP PATH]
;Fail If Exists=FALSE
;[Copy File1]
;Timing=post download
;Source=[SETUP PATH]\bin\*.exe
;Destination=[TEMP]
;Fail If Exists=
;[Create Directory0]
;Timing=post download
;Destination=[TEMP]\Test
;[Create Directory1]
;Timing=post download
;Destination=[TEMP]\Test\temp
[Delete File0]
Timing=post launchapp
Destination=[Setup Path]\install.js
;[Remove Directory0]
;Timing=post launchapp
;Destination=[TEMP]\xtratest
;Remove subdirs=TRUE
[RunApp0]
Timing=post launchapp
Wait=FALSE
Target=[SETUP PATH]\x86rel\apprunner.exe
Parameters=-installer
WorkingDir=[SETUP PATH]\x86rel
; Values for Show Folder:
; HIDE Hides the window and activates another window.
; MAXIMIZE Maximizes the specified window.
; MINIMIZE Minimizes the specified window and activates the next
; top-level window in the z-order.
; RESTORE Activates and displays the window. If the window is
; minimized or maximized, Windows restores it to its
; original size and position. An application should specify
; this flag when restoring a minimized window.
; SHOW Activates the window and displays it in its current size
; and position.
; SHOWMAXIMIZED Activates the window and displays it as a maximized
; window.
; SHOWMINIMIZED Activates the window and displays it as a minimized
; window.
; SHOWMINNOACTIVE Displays the window as a minimized window. The active
; window remains active.
; SHOWNA Displays the window in its current state. The active
; window remains active.
; SHOWNOACTIVATE Displays a window in its most recent size and position.
; The active window remains active.
; SHOWNORMAL Activates and displays a window. If the window is
; minimized or maximized, Windows restores it to its
; original size and position. An application should specify
; this flag when displaying the window for the first time.
[Program Folder0]
Timing=post download
Show Folder=SHOW
Program Folder=[Default Folder]
[Program Folder0-Shortcut0]
File=[SETUP PATH]\x86rel\apprunner.exe
Arguments=
Working Dir=[SETUP PATH]
Description=Netscape AppRunner
Icon Path=[SETUP PATH]\x86rel\apprunner.exe
Icon Id=0
;[Program Folder0-Shortcut1]
;File=[SETUP PATH]\x86rel\viewer.exe
;Arguments=
;Working Dir=[SETUP PATH]
;Description=Netscape Viewer
;Icon Path=[SETUP PATH]\x86rel\viewer.exe
;Icon Id=0
;[Program Folder0-Shortcut2]
;File=[SETUP PATH]\x86rel\Net2fone.exe
;Arguments=
;Working Dir=[SETUP PATH]
;Description=Net2Fone
;Icon Path=[SETUP PATH]\x86rel\Net2fone.exe
;Icon Id=0
;[Program Folder1]
;Timing=post download
;Show Folder=SHOW
;Program Folder=[Default Folder]\lala land
;[Program Folder1-Shortcut0]
;File=c:\bin\getver.exe
;Arguments=
;Working Dir=[TEMP]
;Description=Getver Test
;Icon Path=[WINDISK]\4nt\4nt.exe
;Icon Id=0
;[Program Folder1-Shortcut1]
;File=c:\perl\bin\perl.exe
;Arguments=
;Working Dir=[WINSYS]
;Description=Perl
;Icon Path=c:\perl\bin\perl.exe
;Icon Id=0

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,30 @@
#ifndef _DIALOGS_H_
#define _DIALOGS_H_
LRESULT CALLBACK DlgProcMain(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
LRESULT CALLBACK NewListBoxWndProc( HWND, UINT, WPARAM, LPARAM);
void AskCancelDlg(HWND hDlg);
void lbAddItem(HWND hList, siC *siCComponent);
void InstantiateDialog(DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
void DlgSequenceNext(void);
void DlgSequencePrev(void);
BOOL BrowseForDirectory(HWND hDlg, char *szCurrDir);
LRESULT CALLBACK BrowseHookProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
void ShowMessage(LPSTR szMessage, BOOL bShow);
void DrawCheck(LPDRAWITEMSTRUCT lpdis, HDC hdcMem);
void InvalidateLBCheckbox(HWND hwndListBox);
void ProcessWindowsMessages(void);
void CheckWizardStateCustom(DWORD dwDefault);
#endif

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

@ -0,0 +1,84 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#ifndef _EXTERN_H_
#define _EXTERN_H_
#include "setup.h"
/* external global variables */
extern HINSTANCE hInst;
extern HINSTANCE hSetupRscInst;
extern HINSTANCE hSDInst;
extern HINSTANCE hXPIStubInst;
extern HBITMAP hbmpBoxChecked;
extern HBITMAP hbmpBoxUnChecked;
extern HANDLE hAccelTable;
extern HWND hDlg;
extern HWND hDlgMessage;
extern HWND hWndMain;
extern SDI_NETINSTALL pfnNetInstall;
extern LPSTR szEGlobalAlloc;
extern LPSTR szEStringLoad;
extern LPSTR szEDllLoad;
extern LPSTR szEStringNull;
extern LPSTR szTempSetupPath;
extern LPSTR szClassName;
extern LPSTR szSetupDir;
extern LPSTR szTempDir;
extern LPSTR szFileIniConfig;
extern DWORD dwWizardState;
extern DWORD dwSetupType;
extern DWORD dwOSType;
extern DWORD dwScreenX;
extern DWORD dwScreenY;
extern DWORD dwTempSetupType;
extern BOOL bSDUserCanceled;
extern BOOL bIdiArchivesExists;
extern BOOL bCreateDestinationDir;
extern setupGen sgProduct;
extern diS diSetup;
extern diW diWelcome;
extern diL diLicense;
extern diST diSetupType;
extern diSC diSelectComponents;
extern diWI diWindowsIntegration;
extern diPF diProgramFolder;
extern diSI diStartInstall;
extern diR diReboot;
extern siSD siSDObject;
extern siCF siCFCoreFile;
extern siC *siComponents;
#endif

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,116 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#ifndef _EXTRA_H_
#define _EXTRA_H_
BOOL InitApplication(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
BOOL InitInstance(HINSTANCE hInstance, DWORD dwCmdShow);
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH);
void FreeMemory(void **vPointer);
void *NS_GlobalAlloc(DWORD dwMaxBuf);
HRESULT Initialize(HINSTANCE hInstance);
HRESULT NS_LoadStringAlloc(HANDLE hInstance, DWORD dwID, LPSTR *szStringBuf, DWORD dwStringBuf);
HRESULT NS_LoadString(HANDLE hInstance, DWORD dwID, LPSTR szStringBuf, DWORD dwStringBuf);
HRESULT WinSpawn(LPSTR szClientName, LPSTR szParameters, LPSTR szCurrentDir, int iShowCmd, BOOL bWait);
HRESULT ParseConfigIni(LPSTR lpszCmdLine);
HRESULT DecriptString(LPSTR szOutputStr, LPSTR szInputStr);
HRESULT DecriptVariable(LPSTR szVariable, DWORD dwVariableSize);
void GetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, LPSTR szReturnValue, DWORD dwSize);
HRESULT InitSetupGeneral(void);
HRESULT InitDlgWelcome(diW *diDialog);
HRESULT InitDlgLicense(diL *diDialog);
HRESULT InitDlgSetupType(diST *diDialog);
HRESULT InitDlgSelectComponents(diSC *diDialog, DWORD dwSM);
HRESULT InitDlgWindowsIntegration(diWI *diDialog);
HRESULT InitDlgProgramFolder(diPF *diDialog);
HRESULT InitDlgStartInstall(diSI *diDialog);
HRESULT InitSDObject(void);
void DeInitSDObject(void);
siC *CreateSiCNode(void);
void SiCNodeInsert(siC **siCHead, siC *siCTemp);
void SiCNodeDelete(siC *siCTemp);
siCD *CreateSiCDepNode(void);
void SiCDepNodeDelete(siCD *siCDepTemp);
void SiCDepNodeInsert(siCD **siCDepHead, siCD *siCDepTemp);
HRESULT SiCNodeGetAttributes(DWORD dwIndex);
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet);
void SiCNodeSetItemsSelected(DWORD dwItems, DWORD *dwItemsSelected);
char *SiCNodeGetDescriptionLong(DWORD dwIndex);
siC *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs);
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex);
void InitSiComponents(char *szFileIni);
HRESULT ParseComponentAttributes(char *szBuf);
void InitSiComponents(char *szFileIni);
void DeInitSiCDependencies(siCD *siCDDependencies);
BOOL ResolveDependencies(DWORD dwIndex);
BOOL ResolveComponentDependency(siCD *siCDInDependency);
void STGetComponents(LPSTR szSection, st *stSetupType, LPSTR szFileIni);
HRESULT InitSCoreFile(void);
void DeInitSCoreFile(void);
void DeInitialize(void);
void DeInitDlgWelcome(diW *diDialog);
void DeInitDlgLicense(diL *diDialog);
void DeInitDlgSetupType(diST *diDialog);
void DeInitDlgSelectComponents(diSC *diDialog);
void DeInitDlgWindowsIntegration(diWI *diDialog);
void DeInitDlgProgramFolder(diPF *diDialog);
void DeInitDlgStartInstall(diSI *diDialog);
void DetermineOSVersion(void);
void DeInitSiComponents(void);
void DeInitSetupGeneral(void);
HRESULT InitializeSmartDownload(void);
HRESULT DeInitializeSmartDownload(void);
HRESULT ParseSetupIni(void);
HRESULT GetConfigIni(void);
void CleanTempFiles(void);
void OutputTitle(HDC hDC, LPSTR szString);
HRESULT SdArchives(LPSTR szFileIdi, LPSTR szDownloadDir);
HRESULT RetrieveArchives(void);
/* HRESULT SmartUpdateJars(void); */
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwLength, DWORD dwType);
void RemoveBackSlash(LPSTR szInput);
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
BOOL DeleteIdiGetConfigIni(void);
BOOL DeleteIdiGetArchives(void);
BOOL DeleteIdiFileIniConfig(void);
void DeleteArchives(void);
HRESULT LaunchApps(void);
HRESULT FileExists(LPSTR szFile);
int ExtractDirEntries(char* directory,void* vZip);
BOOL LocateJar(siC *siCObject);
HRESULT AddArchiveToIdiFile(siC *siCObject, char *szSComponent, char *szSFile, char *szFileIdiGetArchives);
int SiCNodeGetIndexDS(char *szInDescriptionShort);
void ViewSiComponents(void);
BOOL IsWin95Debute(void);
ULONGLONG GetDiskSpaceRequired(DWORD dwType);
ULONGLONG GetDiskSpaceAvailable(LPSTR szPath);
HRESULT VerifyDiskSpace(void);
void SetCustomType(void);
void GetAlternateArchiveSearchPath(LPSTR lpszCmdLine);
BOOL bSDInit;
#endif

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

@ -0,0 +1,760 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#include "extern.h"
#include "extra.h"
#include "dialogs.h"
#include "shortcut.h"
#include "ifuncns.h"
HRESULT TimingCheck(DWORD dwTiming, LPSTR szSection, LPSTR szFile)
{
char szBuf[MAX_BUF];
GetPrivateProfileString(szSection, "Timing", "", szBuf, MAX_BUF, szFile);
if(*szBuf != '\0')
{
switch(dwTiming)
{
case T_PRE_DOWNLOAD:
if(lstrcmpi(szBuf, "pre download") == 0)
return(TRUE);
break;
case T_POST_DOWNLOAD:
if(lstrcmpi(szBuf, "post download") == 0)
return(TRUE);
break;
case T_PRE_CORE:
if(lstrcmpi(szBuf, "pre core") == 0)
return(TRUE);
break;
case T_POST_CORE:
if(lstrcmpi(szBuf, "post core") == 0)
return(TRUE);
break;
case T_PRE_SMARTUPDATE:
if(lstrcmpi(szBuf, "pre smartupdate") == 0)
return(TRUE);
break;
case T_POST_SMARTUPDATE:
if(lstrcmpi(szBuf, "post smartupdate") == 0)
return(TRUE);
break;
case T_PRE_LAUNCHAPP:
if(lstrcmpi(szBuf, "pre launchapp") == 0)
return(TRUE);
break;
case T_POST_LAUNCHAPP:
if(lstrcmpi(szBuf, "post launchapp") == 0)
return(TRUE);
break;
}
}
return(FALSE);
}
void ProcessFileOps(DWORD dwTiming)
{
ProcessUncompressFile(dwTiming);
ProcessCreateDirectory(dwTiming);
ProcessMoveFile(dwTiming);
ProcessCopyFile(dwTiming);
ProcessDeleteFile(dwTiming);
ProcessRemoveDirectory(dwTiming);
ProcessRunApp(dwTiming);
ProcessProgramFolder(dwTiming);
}
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo)
{
char szBuf[MAX_BUF];
DWORD dwReturn;
void *vZip;
/* Check for the existance of the from (source) file */
if(!FileExists(szFrom))
return(FO_ERROR_FILE_NOT_FOUND);
/* Check for the existance of the to (destination) path */
dwReturn = FileExists(szTo);
if(dwReturn && !(dwReturn & FILE_ATTRIBUTE_DIRECTORY))
{
/* found a file with the same name as the destination path */
return(FO_ERROR_DESTINATION_CONFLICT);
}
else if(!dwReturn)
{
lstrcpy(szBuf, szTo);
AppendBackSlash(szBuf, sizeof(szBuf));
CreateDirectoriesAll(szBuf);
}
GetCurrentDirectory(MAX_BUF, szBuf);
if(SetCurrentDirectory(szTo) == FALSE)
return(FO_ERROR_CHANGE_DIR);
ZIP_OpenArchive(szFrom, &vZip);
/* 1st parameter should be NULL or it will fail */
/* It indicates extract the entire archive */
ExtractDirEntries(NULL, vZip);
ZIP_CloseArchive(&vZip);
if(SetCurrentDirectory(szBuf) == FALSE)
return(FO_ERROR_CHANGE_DIR);
return(FO_SUCCESS);
}
HRESULT ProcessCoreFile()
{
if(*siCFCoreFile.szMessage != '\0')
ShowMessage(siCFCoreFile.szMessage, TRUE);
FileUncompress(siCFCoreFile.szSource, siCFCoreFile.szDestination);
if(*siCFCoreFile.szMessage != '\0')
ShowMessage(siCFCoreFile.szMessage, FALSE);
return(FO_SUCCESS);
}
HRESULT CleanupCoreFile()
{
if(siCFCoreFile.bCleanup == TRUE)
DirectoryRemove(siCFCoreFile.szDestination, TRUE);
return(FO_SUCCESS);
}
HRESULT ProcessUncompressFile(DWORD dwTiming)
{
DWORD dwIndex;
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szSection[MAX_BUF];
char szSource[MAX_BUF];
char szDestination[MAX_BUF];
dwIndex = 0;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Uncompress File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
{
DecriptString(szSource, szBuf);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szDestination, szBuf);
GetPrivateProfileString(szSection, "Message", "", szBuf, MAX_BUF, szFileIniConfig);
ShowMessage(szBuf, TRUE);
FileUncompress(szSource, szDestination);
ShowMessage(szBuf, FALSE);
}
++dwIndex;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Uncompress File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT FileMove(LPSTR szFrom, LPSTR szTo)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szFromDir[MAX_BUF];
char szFromTemp[MAX_BUF];
char szToTemp[MAX_BUF];
char szBuf[MAX_BUF];
BOOL bFound;
/* From file path exists and To file path does not exist */
if((FileExists(szFrom)) && (!FileExists(szTo)))
{
MoveFile(szFrom, szTo);
return(FO_SUCCESS);
}
/* From file path exists and To file path exists */
if(FileExists(szFrom) && FileExists(szTo))
{
/* Since the To file path exists, assume it to be a directory and proceed. */
/* We don't care if it's a file. If it is a file, then config.ini needs to be */
/* corrected to remove the file before attempting a MoveFile(). */
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
ParsePath(szFrom, szBuf, MAX_BUF, PP_FILENAME_ONLY);
lstrcat(szToTemp, szBuf);
MoveFile(szFrom, szToTemp);
return(FO_SUCCESS);
}
ParsePath(szFrom, szFromDir, MAX_BUF, PP_PATH_ONLY);
if((hFile = FindFirstFile(szFrom, &fdFile)) == INVALID_HANDLE_VALUE)
bFound = FALSE;
else
bFound = TRUE;
while(bFound)
{
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
/* create full path string including filename for source */
lstrcpy(szFromTemp, szFromDir);
AppendBackSlash(szFromTemp, sizeof(szFromTemp));
lstrcat(szFromTemp, fdFile.cFileName);
/* create full path string including filename for destination */
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
lstrcat(szToTemp, fdFile.cFileName);
MoveFile(szFromTemp, szToTemp);
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
return(FO_SUCCESS);
}
HRESULT ProcessMoveFile(DWORD dwTiming)
{
DWORD dwIndex;
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szSection[MAX_BUF];
char szSource[MAX_BUF];
char szDestination[MAX_BUF];
dwIndex = 0;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Move File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
{
DecriptString(szSource, szBuf);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szDestination, szBuf);
FileMove(szSource, szDestination);
}
++dwIndex;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Move File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szFromDir[MAX_BUF];
char szFromTemp[MAX_BUF];
char szToTemp[MAX_BUF];
char szBuf[MAX_BUF];
BOOL bFound;
if(FileExists(szFrom))
{
/* The file in the From file path exists */
ParsePath(szFrom, szBuf, MAX_BUF, PP_FILENAME_ONLY);
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
lstrcat(szToTemp, szBuf);
CopyFile(szFrom, szToTemp, bFailIfExists);
return(FO_SUCCESS);
}
/* The file in the From file path does not exist. Assume to contain wild args and */
/* proceed acordingly. */
ParsePath(szFrom, szFromDir, MAX_BUF, PP_PATH_ONLY);
if((hFile = FindFirstFile(szFrom, &fdFile)) == INVALID_HANDLE_VALUE)
bFound = FALSE;
else
bFound = TRUE;
while(bFound)
{
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
/* create full path string including filename for source */
lstrcpy(szFromTemp, szFromDir);
AppendBackSlash(szFromTemp, sizeof(szFromTemp));
lstrcat(szFromTemp, fdFile.cFileName);
/* create full path string including filename for destination */
lstrcpy(szToTemp, szTo);
AppendBackSlash(szToTemp, sizeof(szToTemp));
lstrcat(szToTemp, fdFile.cFileName);
CopyFile(szFromTemp, szToTemp, bFailIfExists);
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
return(FO_SUCCESS);
}
HRESULT ProcessCopyFile(DWORD dwTiming)
{
DWORD dwIndex;
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szSection[MAX_BUF];
char szSource[MAX_BUF];
char szDestination[MAX_BUF];
BOOL bFailIfExists;
dwIndex = 0;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Copy File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
{
DecriptString(szSource, szBuf);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szDestination, szBuf);
GetPrivateProfileString(szSection, "Fail If Exists", "", szBuf, MAX_BUF, szFileIniConfig);
if(lstrcmpi(szBuf, "TRUE") == 0)
bFailIfExists = TRUE;
else
bFailIfExists = FALSE;
FileCopy(szSource, szDestination, bFailIfExists);
}
++dwIndex;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Copy File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT CreateDirectoriesAll(char* szPath)
{
int i;
int iLen = lstrlen(szPath);
char szCreatePath[MAX_BUF];
HRESULT hrResult;
ZeroMemory(szCreatePath, MAX_BUF);
memcpy(szCreatePath, szPath, iLen);
for(i = 0; i < iLen; i++)
{
if((iLen > 1) &&
((i != 0) && ((szPath[i] == '\\') || (szPath[i] == '/'))) &&
(!((szPath[0] == '\\') && (i == 1)) && !((szPath[1] == ':') && (i == 2))))
{
szCreatePath[i] = '\0';
hrResult = CreateDirectory(szCreatePath, NULL);
szCreatePath[i] = szPath[i];
}
}
return(hrResult);
}
HRESULT ProcessCreateDirectory(DWORD dwTiming)
{
DWORD dwIndex;
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szSection[MAX_BUF];
char szDestination[MAX_BUF];
dwIndex = 0;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Create Directory");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
{
DecriptString(szDestination, szBuf);
CreateDirectoriesAll(szBuf);
}
++dwIndex;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Create Directory");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT FileDelete(LPSTR szDestination)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szBuf[MAX_BUF];
char szPathOnly[MAX_BUF];
BOOL bFound;
if(FileExists(szDestination))
{
/* The file in the From file path exists */
DeleteFile(szDestination);
return(FO_SUCCESS);
}
/* The file in the From file path does not exist. Assume to contain wild args and */
/* proceed acordingly. */
ParsePath(szDestination, szPathOnly, MAX_BUF, PP_PATH_ONLY);
if((hFile = FindFirstFile(szDestination, &fdFile)) == INVALID_HANDLE_VALUE)
bFound = FALSE;
else
bFound = TRUE;
while(bFound)
{
if(!(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
lstrcpy(szBuf, szPathOnly);
AppendBackSlash(szBuf, sizeof(szBuf));
lstrcat(szBuf, fdFile.cFileName);
DeleteFile(szBuf);
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
return(FO_SUCCESS);
}
HRESULT ProcessDeleteFile(DWORD dwTiming)
{
DWORD dwIndex;
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szSection[MAX_BUF];
char szDestination[MAX_BUF];
dwIndex = 0;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Delete File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
{
DecriptString(szDestination, szBuf);
FileDelete(szDestination);
}
++dwIndex;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Delete File");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs)
{
HANDLE hFile;
WIN32_FIND_DATA fdFile;
char szDestTemp[MAX_BUF];
BOOL bFound;
if(!FileExists(szDestination))
return(FO_SUCCESS);
if(bRemoveSubdirs == TRUE)
{
lstrcpy(szDestTemp, szDestination);
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
lstrcat(szDestTemp, "*");
bFound = TRUE;
hFile = FindFirstFile(szDestTemp, &fdFile);
while((hFile != INVALID_HANDLE_VALUE) && (bFound == TRUE))
{
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
{
/* create full path */
lstrcpy(szDestTemp, szDestination);
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
lstrcat(szDestTemp, fdFile.cFileName);
if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
DirectoryRemove(szDestTemp, bRemoveSubdirs);
}
else
{
DeleteFile(szDestTemp);
}
}
bFound = FindNextFile(hFile, &fdFile);
}
FindClose(hFile);
}
RemoveDirectory(szDestination);
return(FO_SUCCESS);
}
HRESULT ProcessRemoveDirectory(DWORD dwTiming)
{
DWORD dwIndex;
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szSection[MAX_BUF];
char szDestination[MAX_BUF];
BOOL bRemoveSubdirs;
dwIndex = 0;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Remove Directory");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
{
DecriptString(szDestination, szBuf);
GetPrivateProfileString(szSection, "Remove subdirs", "", szBuf, MAX_BUF, szFileIniConfig);
bRemoveSubdirs = FALSE;
if(lstrcmpi(szBuf, "TRUE") == 0)
bRemoveSubdirs = TRUE;
DirectoryRemove(szDestination, bRemoveSubdirs);
}
++dwIndex;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "Remove Directory");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT ProcessRunApp(DWORD dwTiming)
{
DWORD dwIndex;
char szIndex[MAX_BUF];
char szBuf[MAX_BUF];
char szSection[MAX_BUF];
char szTarget[MAX_BUF];
char szParameters[MAX_BUF];
char szWorkingDir[MAX_BUF];
BOOL bWait;
dwIndex = 0;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "RunApp");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Target", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
{
DecriptString(szTarget, szBuf);
GetPrivateProfileString(szSection, "Parameters", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szParameters, szBuf);
GetPrivateProfileString(szSection, "WorkingDir", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szWorkingDir, szBuf);
GetPrivateProfileString(szSection, "Wait", "", szBuf, MAX_BUF, szFileIniConfig);
if(lstrcmpi(szBuf, "FALSE") == 0)
{
bWait = FALSE;
}
else
{
bWait = TRUE;
}
WinSpawn(szTarget, szParameters, szWorkingDir, SW_SHOWNORMAL, bWait);
}
++dwIndex;
itoa(dwIndex, szIndex, 10);
lstrcpy(szSection, "RunApp");
lstrcat(szSection, szIndex);
GetPrivateProfileString(szSection, "Target", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT ProcessProgramFolder(DWORD dwTiming)
{
DWORD dwIndex0;
DWORD dwIndex1;
DWORD dwIconId;
char szIndex0[MAX_BUF];
char szIndex1[MAX_BUF];
char szBuf[MAX_BUF];
char szSection0[MAX_BUF];
char szSection1[MAX_BUF];
char szProgramFolder[MAX_BUF];
char szFile[MAX_BUF];
char szArguments[MAX_BUF];
char szWorkingDir[MAX_BUF];
char szDescription[MAX_BUF];
char szIconPath[MAX_BUF];
dwIndex0 = 0;
itoa(dwIndex0, szIndex0, 10);
lstrcpy(szSection0, "Program Folder");
lstrcat(szSection0, szIndex0);
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
if(TimingCheck(dwTiming, szSection0, szFileIniConfig))
{
DecriptString(szProgramFolder, szBuf);
dwIndex1 = 0;
itoa(dwIndex1, szIndex1, 10);
lstrcpy(szSection1, szSection0);
lstrcat(szSection1, "-Shortcut");
lstrcat(szSection1, szIndex1);
GetPrivateProfileString(szSection1, "File", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
DecriptString(szFile, szBuf);
GetPrivateProfileString(szSection1, "Arguments", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szArguments, szBuf);
GetPrivateProfileString(szSection1, "Working Dir", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szWorkingDir, szBuf);
GetPrivateProfileString(szSection1, "Description", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szDescription, szBuf);
GetPrivateProfileString(szSection1, "Icon Path", "", szBuf, MAX_BUF, szFileIniConfig);
DecriptString(szIconPath, szBuf);
GetPrivateProfileString(szSection1, "Icon Id", "", szBuf, MAX_BUF, szFileIniConfig);
if(*szBuf != '\0')
dwIconId = atol(szBuf);
else
dwIconId = 0;
CreateALink(szFile, szProgramFolder, szDescription, szWorkingDir, szArguments, szIconPath, dwIconId);
++dwIndex1;
itoa(dwIndex1, szIndex1, 10);
lstrcpy(szSection1, szSection0);
lstrcat(szSection1, "-Shortcut");
lstrcat(szSection1, szIndex1);
GetPrivateProfileString(szSection1, "File", "", szBuf, MAX_BUF, szFileIniConfig);
}
}
++dwIndex0;
itoa(dwIndex0, szIndex0, 10);
lstrcpy(szSection0, "Program Folder");
lstrcat(szSection0, szIndex0);
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}
HRESULT ProcessProgramFolderShowCmd()
{
DWORD dwIndex0;
int iShowFolder;
char szIndex0[MAX_BUF];
char szBuf[MAX_BUF];
char szSection0[MAX_BUF];
char szProgramFolder[MAX_BUF];
dwIndex0 = 0;
itoa(dwIndex0, szIndex0, 10);
lstrcpy(szSection0, "Program Folder");
lstrcat(szSection0, szIndex0);
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
while(*szBuf != '\0')
{
DecriptString(szProgramFolder, szBuf);
GetPrivateProfileString(szSection0, "Show Folder", "", szBuf, MAX_BUF, szFileIniConfig);
if(strcmpi(szBuf, "HIDE") == 0)
iShowFolder = SW_HIDE;
else if(strcmpi(szBuf, "MAXIMIZE") == 0)
iShowFolder = SW_MAXIMIZE;
else if(strcmpi(szBuf, "MINIMIZE") == 0)
iShowFolder = SW_MINIMIZE;
else if(strcmpi(szBuf, "RESTORE") == 0)
iShowFolder = SW_RESTORE;
else if(strcmpi(szBuf, "SHOW") == 0)
iShowFolder = SW_SHOW;
else if(strcmpi(szBuf, "SHOWMAXIMIZED") == 0)
iShowFolder = SW_SHOWMAXIMIZED;
else if(strcmpi(szBuf, "SHOWMINIMIZED") == 0)
iShowFolder = SW_SHOWMINIMIZED;
else if(strcmpi(szBuf, "SHOWMINNOACTIVE") == 0)
iShowFolder = SW_SHOWMINNOACTIVE;
else if(strcmpi(szBuf, "SHOWNA") == 0)
iShowFolder = SW_SHOWNA;
else if(strcmpi(szBuf, "SHOWNOACTIVATE") == 0)
iShowFolder = SW_SHOWNOACTIVATE;
else if(strcmpi(szBuf, "SHOWNORMAL") == 0)
iShowFolder = SW_SHOWNORMAL;
WinSpawn(szProgramFolder, NULL, NULL, iShowFolder, TRUE);
++dwIndex0;
itoa(dwIndex0, szIndex0, 10);
lstrcpy(szSection0, "Program Folder");
lstrcat(szSection0, szIndex0);
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
}
return(FO_SUCCESS);
}

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

@ -0,0 +1,55 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#ifndef _IFUNCNS_H_
#define _IFUNCNS_H_
HRESULT TimingCheck(DWORD dwTiming, LPSTR szSection, LPSTR szFile);
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo);
HRESULT ProcessCoreFile(void);
HRESULT CleanupCoreFile(void);
HRESULT ProcessUncompressFile(DWORD dwTiming);
HRESULT FileMove(LPSTR szFrom, LPSTR szTo);
HRESULT ProcessMoveFile(DWORD dwTiming);
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists);
HRESULT ProcessCopyFile(DWORD dwTiming);
HRESULT ProcessCreateDirectory(DWORD dwTiming);
HRESULT FileDelete(LPSTR szDestination);
HRESULT ProcessDeleteFile(DWORD dwTiming);
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs);
HRESULT ProcessRemoveDirectory(DWORD dwTiming);
HRESULT ProcessRunApp(DWORD dwTiming);
HRESULT CreateALink(LPSTR lpszPathObj,
LPSTR lpszPathLink,
LPSTR lpszDesc,
LPSTR lpszWorkingPath,
LPSTR lpszArgs,
LPSTR lpszIconFullPath,
int iIcon);
HRESULT ProcessProgramFolder(DWORD dwTiming);
HRESULT ProcessProgramFolderShowCmd(void);
HRESULT CreateDirectoriesAll(char* szPath);
void ProcessFileOps(DWORD dwTiming);
#endif

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

@ -0,0 +1,43 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by setup.rc
//
#define IDS_ERROR_DLL_LOAD 1
#define IDS_ERROR_STRING_LOAD 2
#define IDS_ERROR_STRING_NULL 4
#define IDS_ERROR_GLOBALALLOC 5
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

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

@ -0,0 +1,150 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#include "setup.h"
#include "extra.h"
#include "dialogs.h"
#include "ifuncns.h"
/* global variables */
HINSTANCE hInst;
HINSTANCE hSetupRscInst;
HINSTANCE hSDInst;
HINSTANCE hXPIStubInst;
HBITMAP hbmpBoxChecked;
HBITMAP hbmpBoxUnChecked;
HANDLE hAccelTable;
HWND hDlg;
HWND hDlgMessage;
HWND hWndMain;
SDI_NETINSTALL pfnNetInstall;
LPSTR szEGlobalAlloc;
LPSTR szEStringLoad;
LPSTR szEDllLoad;
LPSTR szEStringNull;
LPSTR szTempSetupPath;
LPSTR szClassName;
LPSTR szSetupDir;
LPSTR szTempDir;
LPSTR szFileIniConfig;
DWORD dwWizardState;
DWORD dwSetupType;
DWORD dwOSType;
DWORD dwScreenX;
DWORD dwScreenY;
DWORD dwTempSetupType;
BOOL bSDUserCanceled;
BOOL bIdiArchivesExists;
BOOL bCreateDestinationDir;
setupGen sgProduct;
diS diSetup;
diW diWelcome;
diL diLicense;
diST diSetupType;
diSC diSelectComponents;
diWI diWindowsIntegration;
diPF diProgramFolder;
diSI diStartInstall;
diR diReboot;
siSD siSDObject;
siCF siCFCoreFile;
siC *siComponents;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
/***********************************************************************/
/* HANDLE hInstance; handle for this instance */
/* HANDLE hPrevInstance; handle for possible previous instances */
/* LPSTR lpszCmdLine; long pointer to exec command line */
/* int nCmdShow; Show code for main window display */
/***********************************************************************/
MSG msg;
char szBuf[MAX_BUF];
if(!hPrevInstance)
{
if(Initialize(hInstance))
PostQuitMessage(1);
else if(!InitApplication(hInstance, hSetupRscInst))
{
char szEFailed[MAX_BUF];
if(NS_LoadString(hInstance, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK)
{
wsprintf(szBuf, szEFailed, "InitApplication().");
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
else if(!InitInstance(hInstance, nCmdShow))
{
char szEFailed[MAX_BUF];
if(NS_LoadString(hInstance, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK)
{
wsprintf(szBuf, szEFailed, "InitInstance().");
PrintError(szBuf, ERROR_CODE_SHOW);
}
PostQuitMessage(1);
}
else if(GetConfigIni())
{
PostQuitMessage(1);
}
else if(ParseConfigIni(lpszCmdLine))
{
PostQuitMessage(1);
}
else
{
DlgSequenceNext();
}
}
while(GetMessage(&msg, NULL, 0, 0))
{
if((!IsDialogMessage(hDlg, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
/* Do clean up before exiting from the application */
DeInitialize();
return(msg.wParam);
} /* End of WinMain */

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

@ -0,0 +1,276 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#ifndef _SETUP_H_
#define _SETUP_H_
#ifdef __cplusplus
#define PR_BEGIN_EXTERN_C extern "C" {
#define PR_END_EXTERN_C }
#else
#define PR_BEGIN_EXTERN_C
#define PR_END_EXTERN_C
#endif
#define PR_EXTERN(type) type
typedef unsigned int PRUint32;
typedef int PRInt32;
#include <windows.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <afxres.h>
#include <direct.h>
#include <tchar.h>
#include <commctrl.h>
#include "setuprsc\\setuprsc.h"
#include "resource.h"
#include "sdinst.h"
#include "zipfile.h"
#define CLASS_NAME "Setup"
#define FILE_INI_SETUP "setup.ini"
#define FILE_INI_CONFIG "config.ini"
#define FILE_IDI_GETCONFIGINI "getconfigini.idi"
#define FILE_IDI_GETARCHIVES "getarchives.idi"
/* PP: Parse Path */
#define PP_FILENAME_ONLY 1
#define PP_PATH_ONLY 2
#define PP_ROOT_ONLY 3
/* T: Timing */
#define T_PRE_DOWNLOAD 1
#define T_POST_DOWNLOAD 2
#define T_PRE_CORE 3
#define T_POST_CORE 4
#define T_PRE_SMARTUPDATE 5
#define T_POST_SMARTUPDATE 6
#define T_PRE_LAUNCHAPP 7
#define T_POST_LAUNCHAPP 8
#define MAX_BUF 4096
#define ERROR_CODE_HIDE 0
#define ERROR_CODE_SHOW 1
#define DLG_NONE 0
#define CX_CHECKBOX 13
#define CY_CHECKBOX 13
/* WIZ: WIZARD defines */
#define WIZ_OK 0
#define WIZ_MEMORY_ALLOC_FAILED 1
/* FO: File Operation */
#define FO_OK 0
#define FO_SUCCESS 0
#define FO_ERROR_FILE_NOT_FOUND 1
#define FO_ERROR_DESTINATION_CONFLICT 2
#define FO_ERROR_CHANGE_DIR 3
#define NORMAL 0
#define SILENT 1
#define AUTO 2
/* ST: Setup Type */
#define ST_RADIO0 0
#define ST_RADIO1 1
#define ST_RADIO2 2
#define ST_RADIO3 3
/* SM: Setup Type Mode */
#define SM_SINGLE 0
#define SM_MULTI 1
/* SIC: Setup Info Component*/
#define SIC_SELECTED 1
#define SIC_INVISIBLE 2
#define SIC_LAUNCHAPP 4
#define SIC_DOWNLOAD_REQUIRED 8
/* OS: Operating System */
#define OS_WIN95_DEBUTE 1
#define OS_WIN95 2
#define OS_WIN98 4
#define OS_NT3 8
#define OS_NT4 16
/* DSR: Disk Space Required */
#define DSR_DESTINATION 0
#define DSR_SYSTEM 1
typedef HRESULT (_cdecl *SDI_NETINSTALL) (LPSDISTRUCT);
typedef struct dlgSetup
{
DWORD dwDlgID;
WNDPROC fDlgProc;
LPSTR szTitle;
} diS;
typedef struct dlgWelcome
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szMessage1;
LPSTR szMessage2;
} diW;
typedef struct dlgLicense
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szLicenseFilename;
LPSTR szMessage0;
LPSTR szMessage1;
} diL;
typedef struct stStruct
{
BOOL bVisible;
DWORD dwItems;
DWORD dwItemsSelected[MAX_BUF];
LPSTR szDescriptionShort;
LPSTR szDescriptionLong;
} st;
typedef struct dlgSetupType
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
st stSetupType0;
st stSetupType1;
st stSetupType2;
st stSetupType3;
} diST;
typedef struct dlgSelectComponents
{
BOOL bShowDialog;
DWORD bShowDialogSM;
LPSTR szTitle;
LPSTR szMessage0;
} diSC;
typedef struct wiCBstruct
{
BOOL bEnabled;
BOOL bCheckBoxState;
LPSTR szDescription;
LPSTR szArchive;
} wiCBs;
typedef struct dlgWindowsIntegration
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
LPSTR szMessage1;
wiCBs wiCB0;
wiCBs wiCB1;
wiCBs wiCB2;
wiCBs wiCB3;
} diWI;
typedef struct dlgProgramFolder
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
} diPF;
typedef struct dlgStartInstall
{
BOOL bShowDialog;
LPSTR szTitle;
LPSTR szMessage0;
} diSI;
typedef struct dlgReboot
{
DWORD dwShowDialog;
LPSTR szTitle;
} diR;
typedef struct setupStruct
{
DWORD dwMode;
DWORD dwCustomType;
LPSTR szPath;
LPSTR szProductName;
LPSTR szProgramFolderName;
LPSTR szProgramFolderPath;
LPSTR szAlternateArchiveSearchPath;
} setupGen;
typedef struct sinfoSmartDownload
{
LPSTR szCoreFile;
LPSTR szCoreDir;
LPSTR szNoAds;
LPSTR szSilent;
LPSTR szExecution;
LPSTR szConfirmInstall;
LPSTR szExtractMsg;
LPSTR szExe;
LPSTR szExeParam;
LPSTR szCoreFilePath;
} siSD;
typedef struct sinfoCoreFile
{
LPSTR szSource;
LPSTR szDestination;
BOOL bCleanup;
LPSTR szMessage;
} siCF;
typedef struct sinfoComponentDep siCD;
struct sinfoComponentDep
{
LPSTR szDescriptionShort;
siCD *Next;
siCD *Prev;
};
typedef struct sinfoComponent siC;
struct sinfoComponent
{
ULONGLONG ullInstallSize;
ULONGLONG ullInstallSizeSystem;
DWORD dwAttributes;
LPSTR szArchiveName;
LPSTR szDescriptionShort;
LPSTR szDescriptionLong;
LPSTR szParameter;
siCD *siCDDependencies;
siC *Next;
siC *Prev;
};
#endif

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

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

@ -0,0 +1,147 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Netscape Communications\0"
VALUE "FileDescription", "setup\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "setup\0"
VALUE "LegalCopyright", "Copyright © 1999\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "setup.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Netscape Communications setup\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ERROR_DLL_LOAD "Could not load %s"
IDS_ERROR_STRING_LOAD "Could not load string resource ID %d"
IDS_ERROR_STRING_NULL "Null pointer encountered."
IDS_ERROR_GLOBALALLOC "Memory allocation error."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

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

@ -0,0 +1,77 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#include <shlobj.h>
#include "shortcut.h"
HRESULT CreateALink(LPSTR lpszPathObj, LPSTR lpszPathLink, LPSTR lpszDesc, LPSTR lpszWorkingPath, LPSTR lpszArgs, LPSTR lpszIconFullPath, int iIcon)
{
HRESULT hres;
IShellLink *psl;
char lpszFullPath[MAX_BUF];
lstrcpy(lpszFullPath, lpszPathLink);
lstrcat(lpszFullPath, "\\");
lstrcat(lpszFullPath, lpszDesc);
lstrcat(lpszFullPath, ".lnk");
CreateDirectory(lpszPathLink, NULL);
CoInitialize(NULL);
// Get a pointer to the IShellLink interface.
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *)&psl);
if(SUCCEEDED(hres))
{
IPersistFile* ppf;
// Set the path to the shortcut target, and add the
// description.
psl->SetPath(lpszPathObj);
psl->SetDescription(lpszDesc);
if(lpszWorkingPath)
psl->SetWorkingDirectory(lpszWorkingPath);
if(lpszArgs)
psl->SetArguments(lpszArgs);
psl->SetIconLocation(lpszIconFullPath, iIcon);
// Query IShellLink for the IPersistFile interface for saving the
// shortcut in persistent storage.
hres = psl->QueryInterface(IID_IPersistFile, (LPVOID FAR *)&ppf);
if(SUCCEEDED(hres))
{
WORD wsz[MAX_BUF];
// Ensure that the string is ANSI.
MultiByteToWideChar(CP_ACP, 0, lpszFullPath, -1, (wchar_t *)wsz, MAX_BUF);
// Save the link by calling IPersistFile::Save.
hres = ppf->Save((wchar_t *)wsz, TRUE);
ppf->Release();
}
psl->Release();
}
CoUninitialize();
return hres;
}

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

@ -0,0 +1,43 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#ifndef _SHORTCUT_H_
#define _SHORTCUT_H_
#ifndef MAX_BUF
#define MAX_BUF 4096
#endif
#ifdef __cplusplus
extern "C"
{
#endif
HRESULT CreateALink(LPSTR lpszPathObj, LPSTR lpszPathLink, LPSTR lpszDesc, LPSTR lpszWorkingPath, LPSTR lpszArgs, LPSTR lpszIconFullPath, int iIcon);
#ifdef __cplusplus
}
#endif
#endif

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

@ -0,0 +1,559 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#include "extern.h"
#include "dialogs.h"
#include "extra.h"
#include "xpistub.h"
#include "xpi.h"
static XpiInit pfnXpiInit;
static XpiInstall pfnXpiInstall;
static XpiExit pfnXpiExit;
static long lFileCounter;
static DWORD dwCurrentArchive;
static DWORD dwTotalArchives;
static void UpdateGaugeFileProgressBar(unsigned value);
static void UpdateGaugeArchiveProgressBar(unsigned value);
static void UpdateFileStatus(const char *szFullFilename);
struct ExtractFilesDlgInfo
{
HWND hWndDlg;
int nMaxFileBars; // maximum number of bars that can be displayed
int nMaxArchiveBars; // maximum number of bars that can be displayed
int nFileBars; // current number of bars to display
int nArchiveBars; // current number of bars to display
} dlgInfo;
HRESULT InitializeXPIStub()
{
char szBuf[MAX_BUF];
char szXPIStubFile[MAX_BUF];
char szEGetProcAddress[MAX_BUF];
hXPIStubInst = NULL;
if(NS_LoadString(hSetupRscInst, IDS_ERROR_GETPROCADDRESS, szEGetProcAddress, MAX_BUF) != WIZ_OK)
return(1);
/* change current directory to where xpistub.dll */
lstrcpy(szBuf, siCFCoreFile.szDestination);
AppendBackSlash(szBuf, sizeof(szBuf));
lstrcat(szBuf, "x86rel");
chdir(szBuf);
/* build full path to xpistub.dll */
lstrcpy(szXPIStubFile, szBuf);
AppendBackSlash(szXPIStubFile, sizeof(szXPIStubFile));
lstrcat(szXPIStubFile, "xpistub.dll");
if(FileExists(szXPIStubFile) == FALSE)
return(2);
/* load xpistub.dll */
if((hXPIStubInst = LoadLibraryEx(szXPIStubFile, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) == NULL)
{
wsprintf(szBuf, szEDllLoad, szXPIStubFile);
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
if(((FARPROC)pfnXpiInit = GetProcAddress(hXPIStubInst, "XPI_Init")) == NULL)
{
wsprintf(szBuf, szEGetProcAddress, "XPI_Init");
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
if(((FARPROC)pfnXpiInstall = GetProcAddress(hXPIStubInst, "XPI_Install")) == NULL)
{
wsprintf(szBuf, szEGetProcAddress, "XPI_Install");
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
if(((FARPROC)pfnXpiExit = GetProcAddress(hXPIStubInst, "XPI_Exit")) == NULL)
{
wsprintf(szBuf, szEGetProcAddress, "XPI_Exit");
PrintError(szBuf, ERROR_CODE_SHOW);
return(1);
}
return(0);
}
HRESULT DeInitializeXPIStub()
{
pfnXpiInit = NULL;
pfnXpiInstall = NULL;
pfnXpiExit = NULL;
if(hXPIStubInst)
FreeLibrary(hXPIStubInst);
chdir(szSetupDir);
return(0);
}
void GetTotalArchivesToInstall(void)
{
DWORD dwIndex0;
siC *siCObject = NULL;
dwIndex0 = 0;
dwTotalArchives = 0;
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
while(siCObject)
{
if((siCObject->dwAttributes & SIC_SELECTED) && !(siCObject->dwAttributes & SIC_LAUNCHAPP))
++dwTotalArchives;
++dwIndex0;
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
}
}
HRESULT SmartUpdateJars()
{
DWORD dwIndex0;
siC *siCObject = NULL;
HRESULT hrResult;
char szBuf[MAX_BUF];
char szArchive[MAX_BUF];
char szMsgSmartUpdateStart[MAX_BUF];
if(NS_LoadString(hSetupRscInst, IDS_MSG_SMARTUPDATE_START, szMsgSmartUpdateStart, MAX_BUF) != WIZ_OK)
return(1);
ShowMessage(szMsgSmartUpdateStart, TRUE);
if(InitializeXPIStub() == WIZ_OK)
{
hrResult = pfnXpiInit(sgProduct.szPath, cbXPIStart, cbXPIProgress, cbXPIFinal);
ShowMessage(szMsgSmartUpdateStart, FALSE);
InitProgressDlg();
GetTotalArchivesToInstall();
dwIndex0 = 0;
dwCurrentArchive = 0;
dwTotalArchives *= 2;
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
while(siCObject)
{
/* launch smartupdate engine for earch jar to be installed */
if((siCObject->dwAttributes & SIC_SELECTED) && !(siCObject->dwAttributes & SIC_LAUNCHAPP))
{
lFileCounter = 0;
dlgInfo.nFileBars = 0;
UpdateGaugeFileProgressBar(0);
lstrcpy(szArchive, sgProduct.szAlternateArchiveSearchPath);
AppendBackSlash(szArchive, sizeof(szArchive));
lstrcat(szArchive, siCObject->szArchiveName);
if(!FileExists(szArchive))
{
lstrcpy(szArchive, szSetupDir);
AppendBackSlash(szArchive, sizeof(szArchive));
lstrcat(szArchive, siCObject->szArchiveName);
if(!FileExists(szArchive))
{
lstrcpy(szArchive, szTempDir);
AppendBackSlash(szArchive, sizeof(szArchive));
lstrcat(szArchive, siCObject->szArchiveName);
if(!FileExists(szArchive))
{
char szEFileNotFound[MAX_BUF];
if(NS_LoadString(hSetupRscInst, IDS_ERROR_FILE_NOT_FOUND, szEFileNotFound, MAX_BUF) == WIZ_OK)
{
wsprintf(szBuf, szEFileNotFound, szArchive);
PrintError(szBuf, ERROR_CODE_HIDE);
}
return(1);
}
}
}
hrResult = pfnXpiInstall(szArchive, "", 0xFFFF);
++dwCurrentArchive;
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
ProcessWindowsMessages();
}
++dwIndex0;
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
}
pfnXpiExit();
DeInitProgressDlg();
}
else
{
ShowMessage(szMsgSmartUpdateStart, FALSE);
}
DeInitializeXPIStub();
return(0);
}
void cbXPIStart(const char *URL, const char *UIName)
{
// MessageBox(NULL, UIName, "XpiStub is running", MB_ICONEXCLAMATION);
}
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max)
{
if(max == 0)
{
UpdateFileStatus(msg);
}
else
{
UpdateGaugeFileProgressBar((unsigned)(((double)(val+1)/(double)max)*(double)100));
if((dwCurrentArchive % 2) == 0)
{
++dwCurrentArchive;
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
}
}
ProcessWindowsMessages();
}
void cbXPIFinal(const char *URL, PRInt32 finalStatus)
{
}
/////////////////////////////////////////////////////////////////////////////
// Progress bar
// Centers the specified window over the desktop. Assumes the window is
// smaller both horizontally and vertically than the desktop
static void
CenterWindow(HWND hWndDlg)
{
RECT rect;
int iLeft, iTop;
GetWindowRect(hWndDlg, &rect);
iLeft = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
iTop = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
SetWindowPos(hWndDlg, NULL, iLeft, iTop, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
// Window proc for dialog
LRESULT CALLBACK
ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
char szStrFileNumber[MAX_BUF];
char szStrFilename[MAX_BUF];
switch (msg)
{
case WM_INITDIALOG:
if(NS_LoadString(hSetupRscInst, IDS_STR_FILE_NUMBER, szStrFileNumber, MAX_BUF) != WIZ_OK)
exit(1);
if(NS_LoadString(hSetupRscInst, IDS_STR_FILENAME, szStrFilename, MAX_BUF) != WIZ_OK)
exit(1);
// Center the dialog over the desktop
CenterWindow(hWndDlg);
SetDlgItemText(hWndDlg, IDC_STATUS0, szStrFileNumber);
SetDlgItemText(hWndDlg, IDC_STATUS3, szStrFilename);
return FALSE;
case WM_COMMAND:
// DestroyWindow(hWndDlg);
return TRUE;
}
return FALSE; // didn't handle the message
}
static void
UpdateFileStatus(const char *szFullFilename)
{
char szFileCounter[MAX_BUF];
char szFilename[MAX_BUF];
ParsePath((char *)szFullFilename, szFilename, sizeof(szFilename), PP_FILENAME_ONLY);
++lFileCounter;
ltoa(lFileCounter, szFileCounter, 10);
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS1, szFileCounter);
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS2, szFilename);
}
// This routine will update the File Gauge progress bar to the specified percentage
// (value between 0 and 100)
static void
UpdateGaugeFileProgressBar(unsigned value)
{
int nBars;
// Figure out how many bars should be displayed
nBars = dlgInfo.nMaxFileBars * value / 100;
// Only paint if we need to display more bars
if((nBars > dlgInfo.nFileBars) || (dlgInfo.nFileBars == 0))
{
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
RECT rect;
// Update the gauge state before painting
dlgInfo.nFileBars = nBars;
// Only invalidate the part that needs updating
GetClientRect(hWndGauge, &rect);
InvalidateRect(hWndGauge, &rect, FALSE);
// Update the whole extracting dialog. We do this because we don't
// have a message loop to process WM_PAINT messages in case the
// extracting dialog was exposed
UpdateWindow(dlgInfo.hWndDlg);
}
}
// This routine will update the Archive Gauge progress bar to the specified percentage
// (value between 0 and 100)
static void
UpdateGaugeArchiveProgressBar(unsigned value)
{
int nBars;
// Figure out how many bars should be displayed
nBars = dlgInfo.nMaxArchiveBars * value / 100;
// Only paint if we need to display more bars
if (nBars > dlgInfo.nArchiveBars)
{
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_ARCHIVE);
RECT rect;
// Update the gauge state before painting
dlgInfo.nArchiveBars = nBars;
// Only invalidate the part that needs updating
GetClientRect(hWndGauge, &rect);
InvalidateRect(hWndGauge, &rect, FALSE);
// Update the whole extracting dialog. We do this because we don't
// have a message loop to process WM_PAINT messages in case the
// extracting dialog was exposed
UpdateWindow(dlgInfo.hWndDlg);
}
}
// Draws a recessed border around the gauge
static void
DrawGaugeBorder(HWND hWnd)
{
HDC hDC = GetWindowDC(hWnd);
RECT rect;
int cx, cy;
HPEN hShadowPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
HGDIOBJ hOldPen;
GetWindowRect(hWnd, &rect);
cx = rect.right - rect.left;
cy = rect.bottom - rect.top;
// Draw a dark gray line segment
hOldPen = SelectObject(hDC, (HGDIOBJ)hShadowPen);
MoveToEx(hDC, 0, cy - 1, NULL);
LineTo(hDC, 0, 0);
LineTo(hDC, cx - 1, 0);
// Draw a white line segment
SelectObject(hDC, GetStockObject(WHITE_PEN));
MoveToEx(hDC, 0, cy - 1, NULL);
LineTo(hDC, cx - 1, cy - 1);
LineTo(hDC, cx - 1, 0);
SelectObject(hDC, hOldPen);
DeleteObject(hShadowPen);
ReleaseDC(hWnd, hDC);
}
// Draws the blue progress bar
static void
DrawProgressBar(HWND hWnd, int nBars)
{
int i;
PAINTSTRUCT ps;
HDC hDC;
RECT rect;
HBRUSH hBrush;
hDC = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rect);
if(nBars <= 0)
{
/* clear the bars */
hBrush = CreateSolidBrush(GetSysColor(COLOR_MENU));
FillRect(hDC, &rect, hBrush);
}
else
{
// Draw the bars
hBrush = CreateSolidBrush(RGB(0, 0, 128));
rect.left = rect.top = BAR_MARGIN;
rect.bottom -= BAR_MARGIN;
rect.right = rect.left + BAR_WIDTH;
for(i = 0; i < nBars; i++)
{
RECT dest;
if(IntersectRect(&dest, &ps.rcPaint, &rect))
FillRect(hDC, &rect, hBrush);
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
}
}
DeleteObject(hBrush);
EndPaint(hWnd, &ps);
}
// Adjusts the width of the gauge based on the maximum number of bars
static void
SizeToFitGauge(HWND hWnd, int nMaxBars)
{
RECT rect;
int cx;
// Get the window size in pixels
GetWindowRect(hWnd, &rect);
// Size the width to fit
cx = 2 * GetSystemMetrics(SM_CXBORDER) + 2 * BAR_MARGIN +
nMaxBars * BAR_WIDTH + (nMaxBars - 1) * BAR_SPACING;
SetWindowPos(hWnd, NULL, -1, -1, cx, rect.bottom - rect.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
// Window proc for file gauge
LRESULT CALLBACK
GaugeFileWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
DWORD dwStyle;
RECT rect;
switch(msg)
{
case WM_NCCREATE:
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
return(TRUE);
case WM_CREATE:
// Figure out the maximum number of bars that can be displayed
GetClientRect(hWnd, &rect);
dlgInfo.nFileBars = 0;
dlgInfo.nMaxFileBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
// Size the gauge to exactly fit the maximum number of bars
SizeToFitGauge(hWnd, dlgInfo.nMaxFileBars);
return(FALSE);
case WM_NCPAINT:
DrawGaugeBorder(hWnd);
return(FALSE);
case WM_PAINT:
DrawProgressBar(hWnd, dlgInfo.nFileBars);
return(FALSE);
}
return(DefWindowProc(hWnd, msg, wParam, lParam));
}
// Window proc for file gauge
LRESULT CALLBACK
GaugeArchiveWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
DWORD dwStyle;
RECT rect;
switch(msg)
{
case WM_NCCREATE:
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
return(TRUE);
case WM_CREATE:
// Figure out the maximum number of bars that can be displayed
GetClientRect(hWnd, &rect);
dlgInfo.nArchiveBars = 0;
dlgInfo.nMaxArchiveBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
// Size the gauge to exactly fit the maximum number of bars
SizeToFitGauge(hWnd, dlgInfo.nMaxArchiveBars);
return(FALSE);
case WM_NCPAINT:
DrawGaugeBorder(hWnd);
return(FALSE);
case WM_PAINT:
DrawProgressBar(hWnd, dlgInfo.nArchiveBars);
return(FALSE);
}
return(DefWindowProc(hWnd, msg, wParam, lParam));
}
void InitProgressDlg()
{
WNDCLASS wc;
memset(&wc, 0, sizeof(wc));
wc.style = CS_GLOBALCLASS;
wc.hInstance = hInst;
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wc.lpfnWndProc = (WNDPROC)GaugeFileWndProc;
wc.lpszClassName = "GaugeFile";
RegisterClass(&wc);
wc.lpfnWndProc = (WNDPROC)GaugeArchiveWndProc;
wc.lpszClassName = "GaugeArchive";
RegisterClass(&wc);
// Display the dialog box
dlgInfo.hWndDlg = CreateDialog(hSetupRscInst, MAKEINTRESOURCE(DLG_EXTRACTING), hWndMain, (WNDPROC)ProgressDlgProc);
UpdateWindow(dlgInfo.hWndDlg);
}
void DeInitProgressDlg()
{
DestroyWindow(dlgInfo.hWndDlg);
UnregisterClass("GaugeFile", hInst);
UnregisterClass("GaugeArchive", hInst);
}

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

@ -0,0 +1,46 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#ifndef _XPI_H_
#define _XPI_H_
#define BAR_MARGIN 1
#define BAR_SPACING 2
#define BAR_WIDTH 6
typedef HRESULT (_cdecl *XpiInit)(const char *, pfnXPIStart, pfnXPIProgress, pfnXPIFinal);
typedef HRESULT (_cdecl *XpiInstall)(const char *, const char *, long);
typedef void (_cdecl *XpiExit)(void);
HRESULT InitializeXPIStub(void);
HRESULT DeInitializeXPIStub(void);
HRESULT SmartUpdateJars(void);
void cbXPIStart(const char *, const char *UIName);
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max);
void cbXPIFinal(const char *, PRInt32 finalStatus);
void InitProgressDlg(void);
void DeInitProgressDlg(void);
void GetTotalArchivesToInstall(void);
#endif

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

@ -0,0 +1,116 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
* Sean Su <ssu@netscape.com>
*/
//#include "nsError.h"
//#include "prtypes.h"
#define nsresult long
#ifdef XP_MAC
#include <Files.h>
#endif
PR_BEGIN_EXTERN_C
/** pfnXPIStart -- script start callback
*
* When an install script gets to StartInstall() this function
* will be called to tell the observer the pretty-name of the
* install package. You are not guaranteed this will be called
* for all scripts--there might be a fatal error before it gets
* to StartInstall(), either in the script itself or in the
* engine trying to set up for it.
*/
typedef void (*pfnXPIStart) (const char* URL, const char* UIName);
/** pfnXPIProgress -- individual install item callback
*
* This callback will be called twice for each installed item,
* First when it is scheduled (val and max will both be 0) and
* then during the finalize step.
*/
typedef void (*pfnXPIProgress)(const char* msg, PRInt32 val, PRInt32 max);
/** pfnXPIFinal -- script end callback
*
* This function will be called when the script calls either
* AbortInstall() or FinalizeInstall() and will return the
* last error code.
*/
typedef void (*pfnXPIFinal) (const char* URL, PRInt32 finalStatus);
/** XPI_Init
*
* call XPI_Init() to initialize XPCOM and the XPInstall
* engine, and to pass in your callback functions.
*
* @param aDir directory to use as "program" directory. If NULL default
* will be used -- the location of the calling executable.
* Must be native filename format.
* @param startCB Called when script started
* @param progressCB Called for each installed file
* @param finalCB Called with status code at end
*
* @returns XPCOM status code indicating success or failure
*/
PR_EXTERN(nsresult) XPI_Init(
#ifdef XP_MAC
const FSSpec& aDir,
#else
const char* aDir,
#endif
pfnXPIStart startCB,
pfnXPIProgress progressCB,
pfnXPIFinal finalCB );
/** XPI_Install
*
* Install an XPI package from a local file
*
* @param file Native filename of XPI archive
* @param args Install.arguments, if any
* @param flags the old SmartUpdate trigger flags. This may go away
*/
PR_EXTERN(nsresult) XPI_Install(
#ifdef XP_MAC
const FSSpec& file,
#else
const char* file,
#endif
const char* args,
long flags );
/** XPI_Exit
*
* call when done to shut down the XPInstall and XPCOM engines
* and free allocated memory
*/
PR_EXTERN(void) XPI_Exit();
PR_END_EXTERN_C

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

@ -0,0 +1,86 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Daniel Veditz <dveditz@netscape.com>
*/
#ifndef _zipfile_h
#define _zipfile_h
/*
* This module implements a simple archive extractor for the PKZIP format.
*
* All functions return a status/error code, and have an opaque hZip argument
* that represents an open archive.
*
* Currently only compression mode 8 (or none) is supported.
*/
#define ZIP_OK 0
#define ZIP_ERR_GENERAL -1
#define ZIP_ERR_MEMORY -2
#define ZIP_ERR_DISK -3
#define ZIP_ERR_CORRUPT -4
#define ZIP_ERR_PARAM -5
#define ZIP_ERR_FNF -6
#define ZIP_ERR_UNSUPPORTED -7
#define ZIP_ERR_SMALLBUF -8
PR_BEGIN_EXTERN_C
/* Open and close the archive
*
* If successful OpenArchive returns a handle in the hZip parameter
* that must be passed to all subsequent operations on the archive
*/
extern _declspec(dllexport)int ZIP_OpenArchive( const char * zipname, void** hZip );
extern _declspec(dllexport)int ZIP_CloseArchive( void** hZip );
/* Extract the named file in the archive to disk.
* This function will happily overwrite an existing Outfile if it can.
* It's up to the caller to detect or move it out of the way if it's important.
*/
extern _declspec(dllexport)int ZIP_ExtractFile( void* hZip, const char * filename, const char * outname );
/* Functions to list the files contained in the archive
*
* FindInit() initializes the search with the pattern and returns a find token,
* or NULL on an error. Then FindNext() is called with the token to get the
* matching filenames if any. When done you must call FindFree() with the
* token to release memory.
*
* a NULL pattern will find all the files in the archive, otherwise the
* pattern must be a shell regexp type pattern.
*
* if a matching filename is too small for the passed buffer FindNext()
* will return ZIP_ERR_SMALLBUF. When no more matches can be found in
* the archive it will return ZIP_ERR_FNF
*/
extern _declspec(dllexport)void* ZIP_FindInit( void* hZip, const char * pattern );
extern _declspec(dllexport)int ZIP_FindNext( void* hFind, char * outbuf, int bufsize );
extern _declspec(dllexport)int ZIP_FindFree( void* hFind );
PR_END_EXTERN_C
#endif /* _zipfile_h */

Двоичные данные
xpinstall/wizard/windows/setuprsc/bitmap1.bmp Normal file

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

После

Ширина:  |  Высота:  |  Размер: 16 KiB

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

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

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

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

@ -0,0 +1,30 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
#include <windows.h>
int FAR PASCAL LibMain(HINSTANCE hInstance, WORD wDataSeg, WORD cbHeapSize, LPSTR lpCmdLine)
{
return(1);
}

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

@ -0,0 +1,129 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by setuprsc.rc
//
#define IDS_ERROR_DIALOG_CREATE 1
#define IDS_ERROR_FAILED 2
#define IDS_ERROR_FILE_NOT_FOUND 3
#define IDS_ERROR_GET_SYSTEM_DIRECTORY_FAILED 4
#define IDS_ERROR_GET_WINDOWS_DIRECTORY_FAILED 5
#define IDS_DLGQUITTITLE 6
#define IDS_DLGQUITMSG 7
#define IDS_DLG_REBOOT_TITLE 8
#define IDS_ERROR_GETPROCADDRESS 9
#define IDS_ERROR_WRITEPRIVATEPROFILESTRING 10
#define IDS_MSG_RETRIEVE_CONFIGINI 11
#define IDS_ERROR_CREATE_TEMP_DIR 12
#define IDS_DLGBROWSETITLE 13
#define IDS_ERROR_DETERMINING_DISK_SPACE 14
#define IDS_DLG_DISK_SPACE_CHECK_TITLE 15
#define IDS_DLG_DISK_SPACE_CHECK_SYS_MSG 16
#define IDS_DLG_DISK_SPACE_CHECK_MSG 17
#define IDS_ERROR_CREATE_DIRECTORY 18
#define IDS_STR_FILE_NUMBER 19
#define IDS_STR_FILENAME 20
#define IDS_MSG_SMARTUPDATE_START 21
#define IDI_ICON1 105
#define IDI_SETUP 105
#define IDB_BITMAP_WELCOME 108
#define DLG_MESSAGE 110
#define DLG_BROWSE_DIR 503
#define IDC_STATUS 1001
#define IDC_STATUS1 1001
#define IDC_GAUGE 1002
#define IDC_GAUGE_FILE 1002
#define IDC_STATUS2 1003
#define IDC_STATUS0 1004
#define IDC_STATUS3 1005
#define IDC_GAUGE_ARCHIVE 1006
#define IDC_EDIT_DESTINATION 1009
#define IDC_BUTTON_BROWSE 1010
#define IDC_EDIT_COMPONENT1 1013
#define IDC_EDIT_SUBCOMPONENT 1014
#define IDC_STATIC_SUBCOMPONENT 1016
#define IDC_CHECK1 1017
#define IDC_STATIC_DESCRIPTION 1018
#define IDC_EDIT_PROGRAM_FOLDER 1019
#define IDC_CHECK2 1023
#define IDC_LIST2 1023
#define IDC_LIST 1023
#define IDC_CHECK3 1024
#define IDC_EDIT_LICENSE 1024
#define IDC_CHECK0 1025
#define IDC_EDIT_CURRENT_SETTINGS 1026
#define IDC_LIST_COMPONENTS 1027
#define IDC_LIST_SUBCOMPONENTS 1029
#define IDC_STATIC_DRIVE_SPACE_REQUIRED 1030
#define IDC_STATIC_DRIVE_SPACE_AVAILABLE 1031
#define IDC_STATIC_DESTINATION 1032
#define IDC_STATIC0 1033
#define IDC_STATIC1 1034
#define IDC_STATIC2 1035
#define IDC_MESSAGE1 1040
#define IDC_PICT0 1041
#define IDC_MESSAGE0 1042
#define IDC_STATIC_ST0_DESCRIPTION 1042
#define IDC_STATIC_ST1_DESCRIPTION 1043
#define IDC_STATIC_ST2_DESCRIPTION 1044
#define IDC_STATIC_ST3_DESCRIPTION 1045
#define IDC_STATIC_MSG0 1046
#define IDC_MESSAGE 1049
#define IDC_LIST1 1053
#define DLG_WELCOME 2001
#define DLG_LICENSE 2002
#define DLG_SETUP_TYPE 2003
#define DLG_SELECT_COMPONENTS_SINGLE 2004
#define DLG_SELECT_COMPONENTS 2004
#define DLG_SELECT_COMPONENTS_MULTI 2005
#define DLG_WINDOWS_INTEGRATION 2006
#define DLG_PROGRAM_FOLDER 2007
#define DLG_START_INSTALL 2008
#define DLG_EXTRACTING 2009
#define DLG_RESTART 10206
#define IDB_BOX_CHECKED 10304
#define IDB_BOX_UNCHECKED 10306
#define IDC_RADIO_TYPICAL 11007
#define IDC_RADIO_ST0 11007
#define IDC_RADIO_CUSTOM 11008
#define IDC_RADIO_ST2 11008
#define IDC_RADIO_COMPACT 11009
#define IDC_RADIO_ST1 11009
#define IDC_RADIO_ST3 11010
#define IDC_RADIO_YES 11011
#define IDC_RADIO_NO 11012
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 111
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1055
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

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

@ -0,0 +1,371 @@
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code,
* released March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*
* Contributors:
* Sean Su <ssu@netscape.com>
*/
//Microsoft Developer Studio generated resource script.
//
#include "setuprsc.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"setuprsc.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
DLG_WELCOME DIALOGEX 51, 56, 315, 205
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "&Next >",ID_WIZNEXT,188,186,53,12
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
LTEXT "",IDC_STATIC0,127,11,176,37,NOT WS_GROUP
LTEXT "",IDC_STATIC1,127,53,176,37,NOT WS_GROUP
LTEXT "",IDC_STATIC2,127,96,176,37,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_SETUP_TYPE DIALOGEX 51, 56, 315, 205
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "",IDC_RADIO_ST0,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,102,31,65,8
CONTROL "",IDC_RADIO_ST1,"Button",BS_AUTORADIOBUTTON,102,59,65,8
CONTROL "",IDC_RADIO_ST2,"Button",BS_AUTORADIOBUTTON,102,86,64,8
CONTROL "",IDC_RADIO_ST3,"Button",BS_AUTORADIOBUTTON,102,114,64,
8
LTEXT "",IDC_STATIC_ST0_DESCRIPTION,175,31,126,24
LTEXT "",IDC_STATIC_ST3_DESCRIPTION,175,114,126,25
LTEXT "",IDC_STATIC_ST1_DESCRIPTION,175,59,126,24
LTEXT "",IDC_STATIC_ST2_DESCRIPTION,175,86,126,24
GROUPBOX "&Destination Directory",IDC_STATIC,101,147,204,27
EDITTEXT IDC_EDIT_DESTINATION,106,157,144,12,ES_AUTOHSCROLL
PUSHBUTTON "B&rowse...",IDC_BUTTON_BROWSE,255,157,46,12
PUSHBUTTON "< &Back",ID_WIZBACK,134,186,53,12
DEFPUSHBUTTON "&Next >",ID_WIZNEXT,188,186,53,12
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
LTEXT "",IDC_STATIC_MSG0,101,11,204,17,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_SELECT_COMPONENTS DIALOGEX 51, 56, 315, 205
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "< &Back",ID_WIZBACK,134,186,53,12
DEFPUSHBUTTON "&Next >",ID_WIZNEXT,188,186,53,12
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
LTEXT "Select the components you want to install, clear the components you do not want to install. ",
IDC_STATIC,101,10,204,19,NOT WS_GROUP
LTEXT "C&omponents",IDC_STATIC,101,32,204,8
GROUPBOX "Description",IDC_STATIC,101,112,204,22
LTEXT "Component Description",IDC_STATIC_DESCRIPTION,106,121,
195,8
GROUPBOX "&Disk space information",IDC_STATIC,101,140,204,33
LTEXT "Space Required on",IDC_STATIC,106,150,94,8,NOT WS_GROUP
LTEXT "DRIVE",IDC_STATIC_DRIVE_SPACE_REQUIRED,106,160,94,8,NOT
WS_GROUP
LTEXT "Space Available on",IDC_STATIC,207,150,94,8,NOT
WS_GROUP
LTEXT "DRIVE",IDC_STATIC_DRIVE_SPACE_AVAILABLE,207,160,94,8,
NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
LISTBOX IDC_LIST_COMPONENTS,101,42,204,64,LBS_OWNERDRAWFIXED |
LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_GROUP | WS_TABSTOP
END
DLG_WINDOWS_INTEGRATION DIALOGEX 51, 56, 315, 205
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "Check0",IDC_CHECK0,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,32,205,17
CONTROL "Check1",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,53,205,17
CONTROL "Check2",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,73,205,17
CONTROL "Check3",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,101,94,205,17
LTEXT "",IDC_MESSAGE1,101,117,205,54,NOT WS_GROUP
PUSHBUTTON "< &Back",ID_WIZBACK,134,186,53,12
DEFPUSHBUTTON "&Next >",ID_WIZNEXT,188,186,53,12
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
LTEXT "",IDC_MESSAGE0,101,11,204,17,NOT WS_GROUP
CONTROL 108,IDC_PICT0,"Static",SS_BITMAP,11,11,80,160,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC0,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_PROGRAM_FOLDER DIALOGEX 51, 56, 315, 205
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
EDITTEXT IDC_EDIT_PROGRAM_FOLDER,101,64,204,12,ES_AUTOHSCROLL
LISTBOX IDC_LIST,101,94,204,77,LBS_SORT | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "< &Back",ID_WIZBACK,134,186,53,12
DEFPUSHBUTTON "&Next >",ID_WIZNEXT,188,186,53,12
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
LTEXT "Click the type of Setup you prefer, then click Next.",
IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP
LTEXT "&Program Folder:",IDC_STATIC,101,54,105,8
LTEXT "E&xisting Folders:",IDC_STATIC,101,84,163,8
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_LICENSE DIALOGEX 51, 56, 315, 205
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "&Next >",ID_WIZNEXT,188,186,53,12
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
EDITTEXT IDC_EDIT_LICENSE,11,29,295,119,ES_MULTILINE |
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_GROUP
PUSHBUTTON "< &Back",ID_WIZBACK,134,186,53,12
LTEXT "Click the type of Setup you prefer, then click Next.",
-1,11,8,295,17,NOT WS_GROUP
LTEXT "Static",IDC_STATIC_DESCRIPTION,11,152,295,19,NOT
WS_GROUP
CONTROL "",-1,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_START_INSTALL DIALOGEX 51, 56, 315, 205
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
EDITTEXT IDC_EDIT_CURRENT_SETTINGS,101,67,204,104,ES_MULTILINE |
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "< &Back",ID_WIZBACK,134,186,53,12
DEFPUSHBUTTON "&Install",ID_WIZNEXT,188,186,53,12
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
LTEXT "Click the type of Setup you prefer, then click Next.",
IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP
LTEXT "Current Settings:",IDC_STATIC,101,57,163,8,NOT WS_GROUP
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
WS_EX_CLIENTEDGE
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
WS_EX_STATICEDGE
END
DLG_BROWSE_DIR DIALOGEX 147, 23, 190, 143
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Select a directory"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
EDITTEXT IDC_EDIT_DESTINATION,8,16,177,12,ES_AUTOHSCROLL |
ES_OEMCONVERT | NOT WS_BORDER,WS_EX_CLIENTEDGE
LISTBOX 1121,8,37,120,68,LBS_SORT | LBS_OWNERDRAWFIXED |
LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL |
WS_HSCROLL | WS_TABSTOP
COMBOBOX 1137,8,118,121,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",1,135,43,50,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,135,63,50,14,WS_GROUP
LTEXT "&Directories:",-1,8,6,92,9
LTEXT "Dri&ves:",1091,8,108,92,9
END
DLG_RESTART DIALOG FIXED IMPURE 133, 69, 226, 110
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Setup has finished copying files to your computer. Before you can use the program, you must restart Windows or your computer.\n\n Choose one of the following options and click OK to finish setup.",
202,10,10,209,36,SS_NOPREFIX
CONTROL "Yes, I want to restart my computer now.",IDC_RADIO_YES,
"Button",BS_AUTORADIOBUTTON,26,52,191,12
CONTROL "No, I will restart my computer later.",IDC_RADIO_NO,
"Button",BS_AUTORADIOBUTTON,26,68,191,12
DEFPUSHBUTTON "OK",IDOK,169,88,50,14,WS_GROUP
END
DLG_MESSAGE DIALOG DISCARDABLE 0, 0, 236, 34
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
CTEXT "",IDC_MESSAGE,0,0,236,34,SS_CENTERIMAGE
END
DLG_EXTRACTING DIALOG DISCARDABLE 0, 0, 193, 73
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Extracting..."
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "",IDC_STATUS1,34,10,25,8
CONTROL "",IDC_GAUGE_FILE,"GaugeFile",0x0,9,37,175,11
LTEXT "",IDC_STATUS2,45,22,139,8
LTEXT "",IDC_STATUS0,9,10,21,8
LTEXT "",IDC_STATUS3,9,22,31,8
CONTROL "",IDC_GAUGE_ARCHIVE,"GaugeArchive",0x0,9,55,175,11
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_SETUP ICON DISCARDABLE "setup.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BOX_UNCHECKED BITMAP FIXED IMPURE "box_unch.bmp"
IDB_BOX_CHECKED BITMAP FIXED IMPURE "box_chec.bmp"
IDB_BITMAP_WELCOME BITMAP DISCARDABLE "bitmap1.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
DLG_EXTRACTING, DIALOG
BEGIN
BOTTOMMARGIN, 61
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ERROR_DIALOG_CREATE "Could not create %s dialog."
IDS_ERROR_FAILED "%s failed."
IDS_ERROR_FILE_NOT_FOUND "File not found: %s"
IDS_ERROR_GET_SYSTEM_DIRECTORY_FAILED "GetSystemDirectory() failed."
IDS_ERROR_GET_WINDOWS_DIRECTORY_FAILED "GetWindowsDirectory() failed."
IDS_DLGQUITTITLE "Question"
IDS_DLGQUITMSG "Are you sure you want to cancel Setup?"
IDS_DLG_REBOOT_TITLE "Restarting Windows"
IDS_ERROR_GETPROCADDRESS "GetProcAddress() of %s failed."
IDS_ERROR_WRITEPRIVATEPROFILESTRING
"WritePrivateProfileString() failed for file %s"
IDS_MSG_RETRIEVE_CONFIGINI
"Please wait while Setup is attempting to retrieve Config.ini, required by Setup, from the Web..."
IDS_ERROR_CREATE_TEMP_DIR
"Setup was unable to create the TEMP directory: %s"
IDS_DLGBROWSETITLE "Select a directory"
IDS_ERROR_DETERMINING_DISK_SPACE
"Could not determine available disk space for: %s"
IDS_DLG_DISK_SPACE_CHECK_TITLE "Disk space check"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_DLG_DISK_SPACE_CHECK_SYS_MSG
"Setup has detected insufficient disk space on: %s Required: %s Available: %sThis folder is where some Windows related files need to be installed to. You will need to make available more disk space by uninstalling some software. You if have already done so, you can click Retry, or if you would like to cancel the setup, click Cancel."
IDS_DLG_DISK_SPACE_CHECK_MSG
"Setup has detected insufficient disk space on: %s Required: %s Available: %sfor the selection[s] chosen. Would you like to go back and make changes to either the destination folder or other selection[s]?"
IDS_ERROR_CREATE_DIRECTORY
"Could not create folder: %sMake sure you have access to create the folder."
IDS_STR_FILE_NUMBER "File #:"
IDS_STR_FILENAME "Filename:"
IDS_MSG_SMARTUPDATE_START "Initializing SmartUpdate, please wait..."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED