Bug 344236 - Remove xpinstall-based installer code for the toolkit, r=robstrong
git-svn-id: svn://10.0.0.236/trunk@208899 18797224-902f-48f8-a5cc-f745e15eee43
@ -853,7 +853,6 @@ MAKEFILES_inspector="
|
||||
extensions/inspector/Makefile
|
||||
extensions/inspector/base/Makefile
|
||||
extensions/inspector/build/Makefile
|
||||
extensions/inspector/build/src/Makefile
|
||||
extensions/inspector/resources/Makefile
|
||||
extensions/inspector/resources/locale/Makefile
|
||||
"
|
||||
@ -916,7 +915,6 @@ browser/components/shell/public/Makefile
|
||||
browser/components/shell/src/Makefile
|
||||
browser/extensions/Makefile
|
||||
browser/extensions/layout-debug/Makefile
|
||||
browser/extensions/package-fixup/Makefile
|
||||
browser/installer/Makefile
|
||||
browser/installer/unix/Makefile
|
||||
browser/installer/windows/Makefile
|
||||
@ -1005,14 +1003,6 @@ toolkit/mozapps/downloads/src/Makefile
|
||||
toolkit/mozapps/extensions/Makefile
|
||||
toolkit/mozapps/extensions/public/Makefile
|
||||
toolkit/mozapps/extensions/src/Makefile
|
||||
toolkit/mozapps/installer/unix/wizard/Makefile
|
||||
toolkit/mozapps/installer/unix/Makefile
|
||||
toolkit/mozapps/installer/Makefile
|
||||
toolkit/mozapps/installer/windows/Makefile
|
||||
toolkit/mozapps/installer/windows/wizard/Makefile
|
||||
toolkit/mozapps/installer/windows/wizard/setup/Makefile
|
||||
toolkit/mozapps/installer/windows/wizard/setuprsc/Makefile
|
||||
toolkit/mozapps/installer/windows/wizard/uninstall/Makefile
|
||||
toolkit/mozapps/update/Makefile
|
||||
toolkit/mozapps/update/public/Makefile
|
||||
toolkit/mozapps/update/src/Makefile
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
DIRS = windows
|
||||
endif
|
||||
ifdef MOZ_ENABLE_GTK2
|
||||
DIRS = unix
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = wizard
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
|
||||
# Unix implementation of platform-specific installer functions:
|
||||
#
|
||||
# BuildPlatformInstaller()
|
||||
#
|
||||
|
||||
# Define file lists and locations for makeall.pl:
|
||||
|
||||
$exe_suffix = '';
|
||||
@wizard_files = (
|
||||
"mozilla-installer",
|
||||
"mozilla-installer-bin",
|
||||
"watermark.png",
|
||||
"header.png"
|
||||
);
|
||||
|
||||
sub BuildPlatformInstaller
|
||||
{
|
||||
print "Creating sea installer:\n";
|
||||
print " $gDirDistInstall/$seiFileNameSpecific.tar.gz\n\n";
|
||||
|
||||
my $mainExe = $ENV{WIZ_fileMainExe};
|
||||
my $instRoot = "$gDirDistInstall/sea/$mainExe-installer";
|
||||
|
||||
system ("rm -rf $gDirDistInstall/sea");
|
||||
mkdir ("$gDirDistInstall/sea", 0775);
|
||||
mkdir ($instRoot, 0775);
|
||||
mkdir ("$instRoot/xpi", 0775);
|
||||
|
||||
system ("cp -a $gDirDistInstall/setup/* $instRoot/");
|
||||
system ("cp -a $gDirDistInstall/xpi/* $instRoot/xpi/");
|
||||
|
||||
system ("chmod +x $instRoot/mozilla-installer $instRoot/mozilla-installer-bin");
|
||||
|
||||
rename ("$instRoot/mozilla-installer", "$instRoot/$mainExe-installer");
|
||||
rename ("$instRoot/mozilla-installer-bin", "$instRoot/$mainExe-installer-bin");
|
||||
|
||||
system ("cd $gDirDistInstall/sea && tar -jcv --owner=0 --group=0 --numeric-owner --mode='go-w' -f $seiFileNameSpecific.tar.bz2 $mainExe-installer");
|
||||
return 0;
|
||||
}
|
||||
|
||||
1;
|
||||
@ -1,105 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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 the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Samir Gehani <sgehani@netscape.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
PROGRAM = mozilla-installer-bin
|
||||
REQUIRES = xpcom \
|
||||
jar \
|
||||
xpnet \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
nsINIParser.cpp \
|
||||
nsXInstallerDlg.cpp \
|
||||
nsComponent.cpp \
|
||||
nsSetupType.cpp \
|
||||
nsComponentList.cpp \
|
||||
nsRunApp.cpp \
|
||||
nsLicenseDlg.cpp \
|
||||
nsWelcomeDlg.cpp \
|
||||
nsSetupTypeDlg.cpp \
|
||||
nsComponentsDlg.cpp \
|
||||
nsInstallDlg.cpp \
|
||||
nsZipExtractor.cpp \
|
||||
nsXIOptions.cpp \
|
||||
nsXIContext.cpp \
|
||||
nsXInstaller.cpp \
|
||||
nsXIEngine.cpp \
|
||||
$(NULL)
|
||||
|
||||
LIBS = \
|
||||
$(TK_LIBS) \
|
||||
$(DEPTH)/modules/libjar/standalone/$(LIB_PREFIX)jar50_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/xpinstall/wizard/libxpnet/src/$(LIB_PREFIX)xpnet_s.$(LIB_SUFFIX) \
|
||||
-lpthread \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),SunOS)
|
||||
LIBS += -lnsl
|
||||
endif
|
||||
|
||||
EXTRA_DEPS = \
|
||||
$(DEPTH)/modules/libjar/standalone/$(LIB_PREFIX)jar50_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/xpinstall/wizard/libxpnet/src/$(LIB_PREFIX)xpnet_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
NO_DIST_INSTALL = 1
|
||||
NO_INSTALL = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
CXXFLAGS += $(TK_CFLAGS)
|
||||
LOCAL_INCLUDES = -I$(topsrcdir)/xpinstall/stub
|
||||
|
||||
WIZARD_FILES = \
|
||||
mozilla-installer \
|
||||
$(PROGRAM) \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(WIZARD_FILES)
|
||||
$(INSTALL) $^ $(DIST)/install
|
||||
|
||||
install:: $(WIZARD_FILES)
|
||||
$(INSTALL) $^ $(DESTDIR)$(mozappdir)/install
|
||||
@ -1,197 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _XIDEFINES_H_
|
||||
#define _XIDEFINES_H_
|
||||
|
||||
#include "XIErrors.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Limits
|
||||
*--------------------------------------------------------------------*/
|
||||
#define MAX_COMPONENTS 64
|
||||
#define MAX_SETUP_TYPES 4
|
||||
#define MAX_URLS 32
|
||||
#define MAX_URL_LEN 1024
|
||||
#define MAX_DEPENDEE_KEY_LEN 16
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Widget Dims
|
||||
*--------------------------------------------------------------------*/
|
||||
#define XI_WIN_HEIGHT 320
|
||||
#define XI_WIN_WIDTH 550
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Parse Keys
|
||||
*--------------------------------------------------------------------*/
|
||||
#define GENERAL "General"
|
||||
#define DEFAULT_LOCATION "Default Location"
|
||||
#define PROGRAM_NAME "Program Name"
|
||||
|
||||
#define DLG_WELCOME "Dialog Welcome"
|
||||
#define SHOW_DLG "Show Dialog"
|
||||
#define WATERMARK "Watermark"
|
||||
#define TITLE "Title"
|
||||
#define SUBTITLE "Sub Title"
|
||||
|
||||
#define MSGWELCOME "MessageWelcome"
|
||||
#define PRODUCT_NAME "Product Name"
|
||||
#define README "Readme File"
|
||||
#define HEADER_IMAGE "Header Image"
|
||||
|
||||
#define DLG_LICENSE "Dialog License"
|
||||
#define LICENSE "License File"
|
||||
|
||||
#define DLG_SETUP_TYPE "Dialog Setup Type"
|
||||
#define MSG0 "Message0"
|
||||
#define MSG1 "Message1"
|
||||
#define MSG2 "Message2"
|
||||
#define SETUP_TYPE "Setup Type"
|
||||
#define SETUP_TYPEd "Setup Type%d"
|
||||
#define DESC_SHORT "Description Short"
|
||||
#define DESC_LONG "Description Long"
|
||||
#define MSGEXISTING "MessageExistingInstall"
|
||||
|
||||
#define DLG_COMPONENTS "Dialog Select Components"
|
||||
#define COMPONENT "Component"
|
||||
#define COMPONENTd "Component%d"
|
||||
#define Cd "C%d"
|
||||
#define ARCHIVE "Archive"
|
||||
#define URLd "URL%d"
|
||||
#define INSTALL_SIZE "Install Size"
|
||||
#define ARCHIVE_SIZE "Install Size Archive"
|
||||
#define DEPENDENCYd "Dependency%d"
|
||||
#define DEPENDEEd "Dependee%d"
|
||||
#define ATTRIBUTES "Attributes"
|
||||
#define SELECTED_ATTR "SELECTED"
|
||||
#define INVISIBLE_ATTR "INVISIBLE"
|
||||
#define LAUNCHAPP_ATTR "LAUNCHAPP"
|
||||
#define DOWNLOAD_ONLY_ATTR "DOWNLOAD_ONLY"
|
||||
#define MAIN_COMPONENT_ATTR "MAIN_COMPONENT"
|
||||
|
||||
#define RUNAPPd "RunApp%d"
|
||||
#define TARGET "Target"
|
||||
#define ARGS "Arguments"
|
||||
|
||||
#define DLG_START_INSTALL "Dialog Start Install"
|
||||
#define XPINSTALL_ENGINE "XPInstall Engine"
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Macros
|
||||
*--------------------------------------------------------------------*/
|
||||
#define TMP_EXTRACT_SUBDIR "bin"
|
||||
#define XPI_DIR "./xpi"
|
||||
|
||||
#define XPISTUB "libxpistub.so"
|
||||
#define FN_INIT "XPI_Init"
|
||||
#define FN_INSTALL "XPI_Install"
|
||||
#define FN_EXIT "XPI_Exit"
|
||||
|
||||
#define XI_IF_DELETE(_object) \
|
||||
do { \
|
||||
if (_object) \
|
||||
delete _object; \
|
||||
_object = NULL; \
|
||||
} while(0);
|
||||
|
||||
#define XI_IF_FREE(_ptr) \
|
||||
do { \
|
||||
if (_ptr) \
|
||||
free(_ptr); \
|
||||
_ptr = NULL; \
|
||||
} while(0);
|
||||
|
||||
#define XI_GTK_IF_FREE(_gtkWidgetPtr) \
|
||||
do { \
|
||||
if (_gtkWidgetPtr && GTK_IS_WIDGET(_gtkWidgetPtr)) \
|
||||
gtk_widget_destroy(_gtkWidgetPtr); \
|
||||
_gtkWidgetPtr = NULL; \
|
||||
} while(0);
|
||||
|
||||
#define XI_ERR_BAIL(_function) \
|
||||
do { \
|
||||
err = _function; \
|
||||
if (err != OK) \
|
||||
{ \
|
||||
ErrorHandler(err); \
|
||||
goto BAIL; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define XI_VERIFY(_ptr) \
|
||||
do { \
|
||||
if (!_ptr) \
|
||||
return ErrorHandler(E_INVALID_PTR); \
|
||||
} while (0);
|
||||
|
||||
#if defined(DEBUG_sgehani) || defined(DEBUG_druidd) || defined(DEBUG_root)
|
||||
#define XI_ASSERT(_expr, _msg) \
|
||||
do { \
|
||||
if (!(_expr)) \
|
||||
printf("%s %d: ASSERTION FAILED! %s \n", __FILE__, __LINE__, _msg); \
|
||||
} while(0);
|
||||
#else
|
||||
#define XI_ASSERT(_expr, _msg)
|
||||
#endif
|
||||
|
||||
#define XI_GTK_UPDATE_UI() \
|
||||
do { \
|
||||
while (gtk_events_pending()) \
|
||||
gtk_main_iteration(); \
|
||||
} while (0);
|
||||
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#endif /* _XIDEFINES_H_ */
|
||||
@ -1,87 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _XI_ERRORS_H_
|
||||
#define _XI_ERRORS_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/*------------------------------------------------------------------*
|
||||
* X Installer Errors
|
||||
*------------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
OK = 0,
|
||||
E_MEM = -601, /* out of memory */
|
||||
E_PARAM = -602, /* invalid param */
|
||||
E_NO_MEMBER = -603, /* invalid member variable */
|
||||
E_INVALID_PTR = -604, /* invalid pointer */
|
||||
E_INVALID_KEY = -605, /* parse key has no value */
|
||||
E_EMPTY_README = -606, /* failed to read readme */
|
||||
E_EMPTY_LICENSE = -607, /* failed to read license */
|
||||
E_OUT_OF_BOUNDS = -608, /* out of bounds of comp/st list */
|
||||
E_REF_COUNT = -609, /* mismatched ref counts: mem leak */
|
||||
E_NO_COMPONENTS = -610, /* no components in the INI file */
|
||||
E_NO_SETUPTYPES = -611, /* no setup types in the INI file */
|
||||
E_URL_ALREADY = -612, /* URL at this index already exists */
|
||||
E_DIR_CREATE = -613, /* couldn't create the directory (tmp) */
|
||||
E_BAD_FTP_URL = -614, /* ftp url malformed */
|
||||
E_NO_DOWNLOAD = -615, /* download failed */
|
||||
E_EXTRACTION = -616, /* extraction of xpcom failed */
|
||||
E_FORK_FAILED = -617, /* failed to fork a process */
|
||||
E_LIB_OPEN = -618, /* couldn't open stub lib */
|
||||
E_LIB_SYM = -619, /* couldn't get symbol in lib */
|
||||
E_XPI_FAIL = -620, /* a xpistub call failed */
|
||||
E_INSTALL = -621, /* a .xpi failed to install */
|
||||
E_CP_FAIL = -622, /* copy of a xpi failed */
|
||||
E_NO_DEST = -623, /* destination dir doesn't exist */
|
||||
E_MKDIR_FAIL = -624, /* can't make destination dir */
|
||||
E_OLD_INST = -625, /* old instllation exists */
|
||||
E_NO_PERMS = -626, /* don't have rwx perms on selected dir */
|
||||
E_NO_DISK_SPACE = -627, /* not eough disk space to install */
|
||||
E_CRC_FAILED = -628, /* CRC failed */
|
||||
E_USAGE_SHOWN = -629 /* showed the usage message */
|
||||
};
|
||||
|
||||
#endif /* _XI_ERRORS_H_ */
|
||||
@ -1,22 +0,0 @@
|
||||
/* XPM */
|
||||
static char * check_off_xpm[] = {
|
||||
"15 15 4 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FFFFFF",
|
||||
"@ c #FEFEFE",
|
||||
"...............",
|
||||
"...............",
|
||||
"..+@+++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"..+++++++++++..",
|
||||
"...............",
|
||||
"..............."};
|
||||
@ -1,23 +0,0 @@
|
||||
/* XPM */
|
||||
static char * check_on_xpm[] = {
|
||||
"15 15 5 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FFFFFF",
|
||||
"@ c #FEFEFE",
|
||||
"# c #FDFDFD",
|
||||
"...............",
|
||||
"...............",
|
||||
"..+@+++++++++..",
|
||||
"..+.+++++++.+..",
|
||||
"..++.+++++.@+..",
|
||||
"..+++.+++.@++..",
|
||||
"..++++.+.++++..",
|
||||
"..+++++.+++++..",
|
||||
"..++++.@.++++..",
|
||||
"..+++.+++.+++..",
|
||||
"..+#.++++@.++..",
|
||||
"..+.@++++++.+..",
|
||||
"..+++++++++++..",
|
||||
"...............",
|
||||
"..............."};
|
||||
@ -1,73 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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 the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Samir Gehani <sgehani@netscape.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
#=====================================================================
|
||||
#
|
||||
# Mozilla Installer
|
||||
#
|
||||
# Shell script to set up environment before running the
|
||||
# mozilla-installer-bin GTK based binary installer.
|
||||
#
|
||||
# The mozilla-installer-bin binary is an install wizard that
|
||||
# collects user preferences about modules to install and where to
|
||||
# install them. The program then proceeds to install Mozilla.
|
||||
#
|
||||
#=====================================================================
|
||||
|
||||
|
||||
LD_LIBRARY_PATH=.${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}
|
||||
LIBPATH=.${LIBPATH+":$LIBPATH"}
|
||||
export LD_LIBRARY_PATH LIBPATH
|
||||
unset MOZILLA_FIVE_HOME
|
||||
|
||||
PATH=.${PATH+":$PATH"}
|
||||
export PATH
|
||||
|
||||
BASEDIR=`dirname "$0"`
|
||||
BINNAME=`basename "$0"`
|
||||
|
||||
if [ "$BASEDIR" = "" ]; then
|
||||
echo "dirname is not in your PATH"
|
||||
"./${BINNAME}-bin" ${1+"$@"}
|
||||
else
|
||||
cd "${BASEDIR:-.}"
|
||||
"./${BINNAME}-bin" ${1+"$@"}
|
||||
fi
|
||||
|
||||
@ -1,516 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsComponent.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
nsComponent::nsComponent() :
|
||||
mDescShort(NULL),
|
||||
mDescLong(NULL),
|
||||
mArchive(NULL),
|
||||
mInstallSize(0),
|
||||
mArchiveSize(0),
|
||||
mNextDependeeIdx(0),
|
||||
mAttributes(NO_ATTR),
|
||||
mNext(NULL),
|
||||
mIndex(-1),
|
||||
mRefCount(0),
|
||||
mDepRefCount(0),
|
||||
mResPos(0),
|
||||
mDownloaded(FALSE)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_URLS; i++)
|
||||
mURL[i] = NULL;
|
||||
for (i = 0; i < MAX_COMPONENTS; i++)
|
||||
mDependees[i] = NULL;
|
||||
}
|
||||
|
||||
nsComponent::~nsComponent()
|
||||
{
|
||||
int i;
|
||||
|
||||
XI_IF_FREE(mDescShort);
|
||||
XI_IF_FREE(mDescLong);
|
||||
XI_IF_FREE(mArchive);
|
||||
for (i = 0; i < MAX_URLS; i++)
|
||||
XI_IF_FREE(mURL[i]);
|
||||
for (i = 0; i < MAX_COMPONENTS; i++)
|
||||
XI_IF_FREE(mDependees[i]);
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponent::Duplicate()
|
||||
{
|
||||
nsComponent *zdup = new nsComponent();
|
||||
*zdup = *this;
|
||||
zdup->InitRefCount();
|
||||
zdup->InitNext();
|
||||
|
||||
return zdup;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetDescShort(char *aDescShort)
|
||||
{
|
||||
if (!aDescShort)
|
||||
return E_PARAM;
|
||||
|
||||
mDescShort = aDescShort;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsComponent::GetDescShort()
|
||||
{
|
||||
if (mDescShort)
|
||||
return mDescShort;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetDescLong(char *aDescLong)
|
||||
{
|
||||
if (!aDescLong)
|
||||
return E_PARAM;
|
||||
|
||||
mDescLong = aDescLong;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsComponent::GetDescLong()
|
||||
{
|
||||
if (mDescLong)
|
||||
return mDescLong;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetArchive(char *aArchive)
|
||||
{
|
||||
if (!aArchive)
|
||||
return E_PARAM;
|
||||
|
||||
mArchive = aArchive;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsComponent::GetArchive()
|
||||
{
|
||||
if (mArchive)
|
||||
return mArchive;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetInstallSize(int aInstallSize)
|
||||
{
|
||||
mInstallSize = aInstallSize;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::GetInstallSize()
|
||||
{
|
||||
if (mInstallSize >= 0)
|
||||
return mInstallSize;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetArchiveSize(int aArchiveSize)
|
||||
{
|
||||
mArchiveSize = aArchiveSize;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::GetArchiveSize()
|
||||
{
|
||||
if (mArchiveSize >= 0)
|
||||
return mArchiveSize;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::GetCurrentSize()
|
||||
{
|
||||
// assumes cwd is the same as the installer binary location
|
||||
|
||||
char path[MAXPATHLEN];
|
||||
struct stat stbuf;
|
||||
|
||||
if (!mArchive)
|
||||
return 0;
|
||||
|
||||
sprintf(path, "./xpi/%s", mArchive);
|
||||
if (0 != stat(path, &stbuf))
|
||||
return 0;
|
||||
|
||||
return (stbuf.st_size/1024); // return size in KB
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetURL(char *aURL, int aIndex)
|
||||
{
|
||||
if (!aURL)
|
||||
return E_PARAM;
|
||||
if (mURL[aIndex])
|
||||
return E_URL_ALREADY;
|
||||
|
||||
mURL[aIndex] = aURL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsComponent::GetURL(int aIndex)
|
||||
{
|
||||
if (aIndex < 0 || aIndex >= MAX_URLS)
|
||||
return NULL;
|
||||
|
||||
return mURL[aIndex];
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::AddDependee(char *aDependee)
|
||||
{
|
||||
if (!aDependee)
|
||||
return E_PARAM;
|
||||
|
||||
mDependees[mNextDependeeIdx] = aDependee;
|
||||
mDependees[++mNextDependeeIdx] = NULL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::ResolveDependees(int aBeingSelected, nsComponentList *aComps)
|
||||
{
|
||||
int i;
|
||||
nsComponent *currComp = NULL;
|
||||
|
||||
// param check
|
||||
if (!aComps)
|
||||
return E_PARAM;
|
||||
|
||||
// loop over all dependees
|
||||
for (i = 0; i < mNextDependeeIdx; i++)
|
||||
{
|
||||
if (!mDependees[i])
|
||||
break;
|
||||
|
||||
currComp = aComps->GetCompByShortDesc(mDependees[i]);
|
||||
if (!currComp)
|
||||
continue;
|
||||
|
||||
if (aBeingSelected)
|
||||
currComp->DepAddRef();
|
||||
else
|
||||
currComp->DepRelease();
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetSelected()
|
||||
{
|
||||
mAttributes |= nsComponent::SELECTED;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetUnselected()
|
||||
{
|
||||
if (IsSelected())
|
||||
mAttributes &= ~nsComponent::SELECTED;
|
||||
mDepRefCount = 0;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::IsSelected()
|
||||
{
|
||||
if (mAttributes & nsComponent::SELECTED)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetInvisible()
|
||||
{
|
||||
mAttributes |= nsComponent::INVISIBLE;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetVisible()
|
||||
{
|
||||
if (IsInvisible())
|
||||
mAttributes &= ~nsComponent::INVISIBLE;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::IsInvisible()
|
||||
{
|
||||
if (mAttributes & nsComponent::INVISIBLE)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetLaunchApp()
|
||||
{
|
||||
mAttributes |= nsComponent::LAUNCHAPP;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetDontLaunchApp()
|
||||
{
|
||||
if (IsLaunchApp())
|
||||
mAttributes &= ~nsComponent::LAUNCHAPP;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::IsLaunchApp()
|
||||
{
|
||||
if (mAttributes & nsComponent::LAUNCHAPP)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetDownloadOnly()
|
||||
{
|
||||
mAttributes |= nsComponent::DOWNLOAD_ONLY;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::IsDownloadOnly()
|
||||
{
|
||||
if (mAttributes & nsComponent::DOWNLOAD_ONLY)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetMainComponent()
|
||||
{
|
||||
mAttributes |= nsComponent::MAIN_COMPONENT;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::IsMainComponent()
|
||||
{
|
||||
if (mAttributes & nsComponent::MAIN_COMPONENT)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetNext(nsComponent *aComponent)
|
||||
{
|
||||
if (!aComponent)
|
||||
return E_PARAM;
|
||||
|
||||
mNext = aComponent;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::InitNext()
|
||||
{
|
||||
mNext = NULL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponent::GetNext()
|
||||
{
|
||||
if (mNext)
|
||||
return mNext;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetIndex(int aIndex)
|
||||
{
|
||||
if (aIndex < 0 || aIndex > MAX_COMPONENTS)
|
||||
return E_OUT_OF_BOUNDS;
|
||||
|
||||
mIndex = aIndex;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::GetIndex()
|
||||
{
|
||||
if (mIndex < 0 || mIndex > MAX_COMPONENTS)
|
||||
return E_OUT_OF_BOUNDS;
|
||||
|
||||
return mIndex;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::AddRef()
|
||||
{
|
||||
mRefCount++;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::Release()
|
||||
{
|
||||
mRefCount--;
|
||||
|
||||
if (mRefCount < 0)
|
||||
return E_REF_COUNT;
|
||||
|
||||
if (mRefCount == 0)
|
||||
delete this;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::InitRefCount()
|
||||
{
|
||||
mRefCount = 1;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::DepAddRef()
|
||||
{
|
||||
if (mDepRefCount == 0)
|
||||
SetSelected();
|
||||
|
||||
mDepRefCount++;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::DepRelease()
|
||||
{
|
||||
mDepRefCount--;
|
||||
|
||||
if (mDepRefCount < 0)
|
||||
mDepRefCount = 0;
|
||||
|
||||
if (mDepRefCount == 0)
|
||||
SetUnselected();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::DepGetRefCount()
|
||||
{
|
||||
return mDepRefCount;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetResumePos(int aResPos)
|
||||
{
|
||||
mResPos = aResPos;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::GetResumePos()
|
||||
{
|
||||
if (mResPos > 0)
|
||||
return mResPos;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::SetDownloaded( int which )
|
||||
{
|
||||
mDownloaded = which;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponent::IsDownloaded()
|
||||
{
|
||||
return mDownloaded;
|
||||
}
|
||||
@ -1,138 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_COMPONENT_H_
|
||||
#define _NS_COMPONENT_H_
|
||||
|
||||
#include "XIDefines.h"
|
||||
#include "XIErrors.h"
|
||||
#include <malloc.h>
|
||||
|
||||
#include "nsComponentList.h"
|
||||
|
||||
class nsComponent
|
||||
{
|
||||
public:
|
||||
nsComponent();
|
||||
~nsComponent();
|
||||
|
||||
nsComponent * Duplicate();
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Accessors/Mutators
|
||||
*--------------------------------------------------------------*/
|
||||
int SetDescShort(char *aDescShort);
|
||||
char * GetDescShort();
|
||||
int SetDescLong(char *aDescLong);
|
||||
char * GetDescLong();
|
||||
int SetArchive(char *aAcrhive);
|
||||
char * GetArchive();
|
||||
int SetInstallSize(int aInstallSize);
|
||||
int GetInstallSize();
|
||||
int SetArchiveSize(int aArchiveSize);
|
||||
int GetArchiveSize();
|
||||
int GetCurrentSize();
|
||||
int SetURL(char *aURL, int aIndex);
|
||||
char * GetURL(int aIndex);
|
||||
int AddDependee(char *aDependee);
|
||||
int ResolveDependees(int aBeingSelected,
|
||||
nsComponentList *aComps);
|
||||
int SetSelected();
|
||||
int SetUnselected();
|
||||
int IsSelected();
|
||||
int SetInvisible();
|
||||
int SetVisible();
|
||||
int IsInvisible();
|
||||
int SetLaunchApp();
|
||||
int SetDontLaunchApp();
|
||||
int IsLaunchApp();
|
||||
int SetDownloadOnly();
|
||||
int IsDownloadOnly();
|
||||
int SetMainComponent();
|
||||
int IsMainComponent();
|
||||
int SetNext(nsComponent *aComponent);
|
||||
int InitNext();
|
||||
nsComponent *GetNext();
|
||||
int SetIndex(int aIndex);
|
||||
int GetIndex();
|
||||
int AddRef();
|
||||
int Release();
|
||||
int InitRefCount();
|
||||
|
||||
// used for `dependee' tracking
|
||||
int DepAddRef();
|
||||
int DepRelease();
|
||||
int DepGetRefCount();
|
||||
int SetResumePos(int aResPos);
|
||||
int GetResumePos();
|
||||
int SetDownloaded(int which);
|
||||
int IsDownloaded();
|
||||
|
||||
/*---------------------------------------------------------------*
|
||||
* Attributes
|
||||
*---------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
NO_ATTR = 0x00000000,
|
||||
SELECTED = 0x00000001,
|
||||
INVISIBLE = 0x00000010,
|
||||
LAUNCHAPP = 0x00000100,
|
||||
DOWNLOAD_ONLY = 0x00001000,
|
||||
MAIN_COMPONENT = 0x00010000
|
||||
};
|
||||
|
||||
private:
|
||||
char *mDescShort;
|
||||
char *mDescLong;
|
||||
char *mArchive;
|
||||
int mInstallSize;
|
||||
int mArchiveSize;
|
||||
char *mURL[MAX_URLS];
|
||||
char *mDependees[MAX_COMPONENTS];
|
||||
int mNextDependeeIdx;
|
||||
int mAttributes;
|
||||
nsComponent *mNext;
|
||||
int mIndex;
|
||||
int mRefCount;
|
||||
int mDepRefCount;
|
||||
int mResPos;
|
||||
int mDownloaded;
|
||||
};
|
||||
|
||||
#endif /* _NS_COMPONENT_H_ */
|
||||
@ -1,310 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsComponentList.h"
|
||||
#include "nsComponent.h"
|
||||
|
||||
nsComponentList::nsComponentList() :
|
||||
mHead(NULL),
|
||||
mTail(NULL),
|
||||
mNext(NULL),
|
||||
mLength(0)
|
||||
{
|
||||
}
|
||||
|
||||
nsComponentList::~nsComponentList()
|
||||
{
|
||||
nsComponent *curr = mHead;
|
||||
nsComponent *next = NULL;
|
||||
|
||||
while (curr)
|
||||
{
|
||||
next = NULL;
|
||||
next = curr->GetNext();
|
||||
curr->Release();
|
||||
curr = next;
|
||||
}
|
||||
|
||||
mHead = NULL;
|
||||
mTail = NULL;
|
||||
mLength = 0;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponentList::GetHead()
|
||||
{
|
||||
if (mHead)
|
||||
{
|
||||
mNext = mHead->GetNext();
|
||||
return mHead;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponentList::GetNext()
|
||||
{
|
||||
nsComponent *curr = mNext;
|
||||
|
||||
if (mNext)
|
||||
{
|
||||
mNext = mNext->GetNext();
|
||||
return curr;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponentList::GetTail()
|
||||
{
|
||||
if (mTail)
|
||||
return mTail;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentList::GetLength()
|
||||
{
|
||||
return mLength;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentList::GetLengthVisible()
|
||||
{
|
||||
int numVisible = 0;
|
||||
nsComponent *curr;
|
||||
|
||||
curr = mHead;
|
||||
if (!curr) return 0;
|
||||
|
||||
while (curr)
|
||||
{
|
||||
if (!curr->IsInvisible())
|
||||
numVisible++;
|
||||
curr = curr->GetNext();
|
||||
}
|
||||
|
||||
return numVisible;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentList::GetLengthSelected()
|
||||
{
|
||||
int numSelected = 0;
|
||||
nsComponent *curr;
|
||||
|
||||
/* NOTE:
|
||||
* ----
|
||||
* If copies of components are help by this list rather than pointers
|
||||
* then this method will return an inaccurate number. Due to
|
||||
* architecture be very careful when using this method.
|
||||
*/
|
||||
|
||||
curr = mHead;
|
||||
if (!curr) return 0;
|
||||
|
||||
while (curr)
|
||||
{
|
||||
if (!curr->IsSelected())
|
||||
numSelected++;
|
||||
curr = curr->GetNext();
|
||||
}
|
||||
|
||||
return numSelected;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentList::AddComponent(nsComponent *aComponent)
|
||||
{
|
||||
if (!aComponent)
|
||||
return E_PARAM;
|
||||
|
||||
// empty list: head and tail are the same -- the new comp
|
||||
if (!mHead)
|
||||
{
|
||||
mHead = aComponent;
|
||||
mHead->InitNext();
|
||||
mTail = mHead;
|
||||
aComponent->AddRef();
|
||||
mLength = 1;
|
||||
mHead->SetIndex(0);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
// non-empty list: the new comp is tacked on and tail is updated
|
||||
mTail->SetNext(aComponent);
|
||||
mTail = aComponent;
|
||||
mTail->InitNext();
|
||||
aComponent->AddRef();
|
||||
mLength++;
|
||||
mTail->SetIndex(mLength - 1);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentList::RemoveComponent(nsComponent *aComponent)
|
||||
{
|
||||
int err = OK;
|
||||
nsComponent *curr = GetHead();
|
||||
nsComponent *last = NULL;
|
||||
|
||||
if (!aComponent)
|
||||
return E_PARAM;
|
||||
|
||||
while (curr)
|
||||
{
|
||||
if (aComponent == curr)
|
||||
{
|
||||
// remove and link last to next while deleting current
|
||||
if (last)
|
||||
{
|
||||
last->SetNext(curr->GetNext());
|
||||
}
|
||||
else
|
||||
{
|
||||
mHead = curr->GetNext();
|
||||
if (mTail == curr)
|
||||
mTail = NULL;
|
||||
}
|
||||
|
||||
aComponent->Release();
|
||||
mLength--;
|
||||
|
||||
return OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
// move on to next
|
||||
last = curr;
|
||||
curr = GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponentList::GetCompByIndex(int aIndex)
|
||||
{
|
||||
nsComponent *comp = GetHead();
|
||||
int i;
|
||||
|
||||
// param check
|
||||
if (!comp || mLength == 0) return NULL;
|
||||
|
||||
for (i=0; i<mLength; i++)
|
||||
{
|
||||
if (aIndex == comp->GetIndex())
|
||||
return comp;
|
||||
|
||||
comp = GetNext();
|
||||
if (!comp) break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponentList::GetCompByArchive(char *aArchive)
|
||||
{
|
||||
nsComponent *comp = GetHead();
|
||||
int i;
|
||||
|
||||
// param check
|
||||
if (!comp || mLength == 0 || !aArchive) return NULL;
|
||||
|
||||
for (i=0; i<mLength; i++)
|
||||
{
|
||||
if (0==strncmp(aArchive, comp->GetArchive(), strlen(aArchive)))
|
||||
return comp;
|
||||
|
||||
comp = GetNext();
|
||||
if (!comp) break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponentList::GetCompByShortDesc(char *aShortDesc)
|
||||
{
|
||||
nsComponent *comp = GetHead();
|
||||
int i;
|
||||
|
||||
// param check
|
||||
if (!comp || mLength == 0 || !aShortDesc) return NULL;
|
||||
|
||||
for (i=0; i<mLength; i++)
|
||||
{
|
||||
if (0==strncmp(aShortDesc, comp->GetDescShort(),
|
||||
strlen(aShortDesc)))
|
||||
return comp;
|
||||
|
||||
comp = GetNext();
|
||||
if (!comp) break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nsComponent *
|
||||
nsComponentList::GetFirstVisible()
|
||||
{
|
||||
int i;
|
||||
nsComponent *comp = GetHead();
|
||||
|
||||
// param check
|
||||
if (mLength == 0) return NULL;
|
||||
|
||||
for (i=0; i<mLength; i++)
|
||||
{
|
||||
if (!comp->IsInvisible())
|
||||
return comp;
|
||||
|
||||
comp = GetNext();
|
||||
if (!comp) break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -1,181 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_COMPONENTLIST_H_
|
||||
#define _NS_COMPONENTLIST_H_
|
||||
|
||||
#include "XIErrors.h"
|
||||
|
||||
class nsComponent;
|
||||
|
||||
class nsComponentList
|
||||
{
|
||||
public:
|
||||
nsComponentList();
|
||||
~nsComponentList();
|
||||
|
||||
/**
|
||||
* GetHead
|
||||
*
|
||||
* Initializes the next ptr to the second item and
|
||||
* returns the head item.
|
||||
*
|
||||
* @return mHead the head of the singly-linked list
|
||||
*/
|
||||
nsComponent * GetHead();
|
||||
|
||||
/**
|
||||
* GetNext
|
||||
*
|
||||
* Returns the next available item. GetHead() has to have
|
||||
* been called prior calling this and after the last time
|
||||
* the entire list was iterated over.
|
||||
*
|
||||
* @return mNext the next available component
|
||||
*/
|
||||
nsComponent * GetNext();
|
||||
|
||||
/**
|
||||
* GetTail
|
||||
*
|
||||
* Returns the tail item of the list.
|
||||
*
|
||||
* @return mTail the tail item of the list
|
||||
*/
|
||||
nsComponent * GetTail();
|
||||
|
||||
/**
|
||||
* GetLength
|
||||
*
|
||||
* Returns the number of components held by this list.
|
||||
*
|
||||
* @return mLength the size of this list
|
||||
*/
|
||||
int GetLength();
|
||||
|
||||
/**
|
||||
* GetLengthVisible
|
||||
*
|
||||
* Returns the number of visible components held by this list.
|
||||
*
|
||||
* @return numVisible the number of visible components
|
||||
*/
|
||||
int GetLengthVisible();
|
||||
|
||||
/**
|
||||
* GetLengthSelected
|
||||
*
|
||||
* Returns the number of selected components held by this list.
|
||||
*
|
||||
* @return numSleected the number of selected components
|
||||
*/
|
||||
int GetLengthSelected();
|
||||
|
||||
/**
|
||||
* AddComponent
|
||||
*
|
||||
* Adds the supplied component to the list's tail.
|
||||
*
|
||||
* @param aComponent the component to add
|
||||
* @return err integer err code (zero means OK)
|
||||
*/
|
||||
int AddComponent(nsComponent *aComponent);
|
||||
|
||||
/**
|
||||
* RemoveComponent
|
||||
*
|
||||
* Searches the list and removes the first component that
|
||||
* matches the supplied component.
|
||||
*
|
||||
* @param aComponent the component to remove
|
||||
* @return err integer error code (zero means OK)
|
||||
*/
|
||||
int RemoveComponent(nsComponent *aComponent);
|
||||
|
||||
/**
|
||||
* GetCompByIndex
|
||||
*
|
||||
* Searches the list and returns the first component that
|
||||
* matches the supplied index.
|
||||
*
|
||||
* @param aIndex the index of the component being sought
|
||||
* @return comp the component matching the index
|
||||
*/
|
||||
nsComponent *GetCompByIndex(int aIndex);
|
||||
|
||||
/**
|
||||
* GetCompByArchive
|
||||
*
|
||||
* Searches the list and returns the first component that matches
|
||||
* the archive name supplied.
|
||||
*
|
||||
* @param aArchive the archive name of the component
|
||||
* @return comp the component matching the archive
|
||||
*/
|
||||
nsComponent *GetCompByArchive(char *aArchive);
|
||||
|
||||
/**
|
||||
* GetCompByShortDesc
|
||||
*
|
||||
* Searches the list and returns the first component that matches
|
||||
* the short description supplied.
|
||||
*
|
||||
* @param aShortDesc the short description of the component
|
||||
* @return comp the component matching the short description
|
||||
*/
|
||||
nsComponent *GetCompByShortDesc(char *aShortDesc);
|
||||
|
||||
/**
|
||||
* GetFirstVisible
|
||||
*
|
||||
* Returns the first component that doesn't have the invisible
|
||||
* attribute set.
|
||||
*
|
||||
* @return comp the first visible component in this list
|
||||
*/
|
||||
nsComponent *GetFirstVisible();
|
||||
|
||||
private:
|
||||
nsComponent *mHead;
|
||||
nsComponent *mTail;
|
||||
nsComponent *mNext;
|
||||
int mLength;
|
||||
};
|
||||
|
||||
#endif /* _NS_COMPONENTLIST_H_ */
|
||||
@ -1,437 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsComponentsDlg.h"
|
||||
#include "nsXInstaller.h"
|
||||
#include "check_on.xpm"
|
||||
#include "check_off.xpm"
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
static nsSetupType *sCustomST; // cache a pointer to the custom setup type
|
||||
static GtkWidget *sDescLong;
|
||||
static gint sCurrRowSelected;
|
||||
|
||||
nsComponentsDlg::nsComponentsDlg() :
|
||||
mMsg0(NULL),
|
||||
mCompList(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsComponentsDlg::~nsComponentsDlg()
|
||||
{
|
||||
XI_IF_FREE(mMsg0);
|
||||
XI_IF_DELETE(mCompList);
|
||||
}
|
||||
|
||||
void
|
||||
nsComponentsDlg::Back(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Back");
|
||||
if (aData != gCtx->cdlg) return;
|
||||
|
||||
// hide this notebook page
|
||||
gCtx->cdlg->Hide(nsXInstallerDlg::BACKWARD_MOVE);
|
||||
|
||||
// disconnect this dlg's nav btn signal handlers
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->back), gCtx->backID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->next), gCtx->nextID);
|
||||
|
||||
gCtx->sdlg->Show(nsXInstallerDlg::BACKWARD_MOVE);
|
||||
}
|
||||
|
||||
void
|
||||
nsComponentsDlg::Next(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Next");
|
||||
if (aData != gCtx->cdlg) return;
|
||||
|
||||
if (OK != nsSetupTypeDlg::VerifyDiskSpace())
|
||||
return;
|
||||
|
||||
// hide this notebook page
|
||||
gCtx->cdlg->Hide(nsXInstallerDlg::FORWARD_MOVE);
|
||||
|
||||
// disconnect this dlg's nav btn signal handlers
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->back), gCtx->backID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->next), gCtx->nextID);
|
||||
|
||||
// show the next dlg
|
||||
gCtx->idlg->Show(nsXInstallerDlg::FORWARD_MOVE);
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentsDlg::Parse(nsINIParser *aParser)
|
||||
{
|
||||
int err = OK;
|
||||
char *showDlg = NULL;
|
||||
int bufsize = 0;
|
||||
|
||||
char *currSec = (char *) malloc(strlen(COMPONENT) + 3);
|
||||
if (!currSec) return E_MEM;
|
||||
XI_VERIFY(gCtx);
|
||||
|
||||
/* optional keys */
|
||||
err = aParser->GetStringAlloc(DLG_COMPONENTS, MSG0, &mMsg0, &bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) goto BAIL; else err = OK;
|
||||
|
||||
bufsize = 5;
|
||||
err = aParser->GetStringAlloc(DLG_COMPONENTS, SHOW_DLG, &showDlg, &bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) goto BAIL; else err = OK;
|
||||
if (bufsize != 0 && showDlg)
|
||||
{
|
||||
if (0 == strncmp(showDlg, "TRUE", 4))
|
||||
mShowDlg = nsXInstallerDlg::SHOW_DIALOG;
|
||||
else if (0 == strncmp(showDlg, "FALSE", 5))
|
||||
mShowDlg = nsXInstallerDlg::SKIP_DIALOG;
|
||||
}
|
||||
|
||||
bufsize = 0;
|
||||
err = aParser->GetStringAlloc(DLG_COMPONENTS, TITLE, &mTitle, &bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) goto BAIL; else err = OK;
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mTitle);
|
||||
|
||||
BAIL:
|
||||
XI_IF_FREE(currSec);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentsDlg::Show(int aDirection)
|
||||
{
|
||||
int err = OK;
|
||||
int customSTIndex = 0, i;
|
||||
int numRows = 0;
|
||||
int currRow = 0;
|
||||
GtkWidget *hbox = NULL;
|
||||
|
||||
XI_VERIFY(gCtx);
|
||||
XI_VERIFY(gCtx->notebook);
|
||||
|
||||
if (mWidgetsInit == FALSE)
|
||||
{
|
||||
customSTIndex = gCtx->sdlg->GetNumSetupTypes();
|
||||
sCustomST = gCtx->sdlg->GetSetupTypeList();
|
||||
for (i=1; i<customSTIndex; i++)
|
||||
sCustomST = sCustomST->GetNext();
|
||||
DUMP(sCustomST->GetDescShort());
|
||||
|
||||
// create a new table and add it as a page of the notebook
|
||||
mTable = gtk_table_new(5, 1, FALSE);
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(gCtx->notebook), mTable, NULL);
|
||||
mPageNum = gtk_notebook_get_current_page(GTK_NOTEBOOK(gCtx->notebook));
|
||||
gtk_widget_show(mTable);
|
||||
|
||||
// 1st row: a label (msg0)
|
||||
// insert a static text widget in the first row
|
||||
GtkWidget *msg0 = gtk_label_new(mMsg0);
|
||||
hbox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), msg0, FALSE, FALSE, 0);
|
||||
gtk_widget_show(hbox);
|
||||
gtk_table_attach(GTK_TABLE(mTable), hbox, 0, 1, 1, 2,
|
||||
static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
|
||||
GTK_FILL, 20, 20);
|
||||
gtk_widget_show(msg0);
|
||||
|
||||
// 2nd row: a CList with a check box for each row (short desc)
|
||||
GtkWidget *list = NULL;
|
||||
GtkWidget *scrollwin = NULL;
|
||||
GtkStyle *style = NULL;
|
||||
GdkBitmap *ch_mask = NULL;
|
||||
GdkPixmap *checked = NULL;
|
||||
GdkBitmap *un_mask = NULL;
|
||||
GdkPixmap *unchecked = NULL;
|
||||
gchar *dummy[2] = { " ", " " };
|
||||
nsComponent *currComp = sCustomST->GetComponents()->GetHead();
|
||||
GtkWidget *descLongTable = NULL;
|
||||
GtkWidget *frame = NULL;
|
||||
|
||||
scrollwin = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
|
||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
|
||||
list = gtk_clist_new(2);
|
||||
gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_BROWSE);
|
||||
gtk_clist_column_titles_hide(GTK_CLIST(list));
|
||||
gtk_clist_set_column_auto_resize(GTK_CLIST(list), 0, TRUE);
|
||||
gtk_clist_set_column_auto_resize(GTK_CLIST(list), 1, TRUE);
|
||||
|
||||
// determine number of rows we'll need
|
||||
numRows = sCustomST->GetComponents()->GetLengthVisible();
|
||||
for (i = 0; i < numRows; i++)
|
||||
gtk_clist_append(GTK_CLIST(list), dummy);
|
||||
|
||||
style = gtk_widget_get_style(gCtx->window);
|
||||
checked = gdk_pixmap_create_from_xpm_d(gCtx->window->window, &ch_mask,
|
||||
&style->bg[GTK_STATE_NORMAL], (gchar **)check_on_xpm);
|
||||
unchecked = gdk_pixmap_create_from_xpm_d(gCtx->window->window, &un_mask,
|
||||
&style->bg[GTK_STATE_NORMAL], (gchar **)check_off_xpm);
|
||||
|
||||
while ((currRow < numRows) && currComp) // paranoia!
|
||||
{
|
||||
if (!currComp->IsInvisible())
|
||||
{
|
||||
if (currComp->IsSelected())
|
||||
gtk_clist_set_pixmap(GTK_CLIST(list), currRow, 0,
|
||||
checked, ch_mask);
|
||||
else
|
||||
gtk_clist_set_pixmap(GTK_CLIST(list), currRow, 0,
|
||||
unchecked, un_mask);
|
||||
|
||||
gtk_clist_set_text(GTK_CLIST(list), currRow, 1,
|
||||
currComp->GetDescShort());
|
||||
currRow++;
|
||||
}
|
||||
|
||||
currComp = currComp->GetNext();
|
||||
}
|
||||
|
||||
// by default, first row selected upon Show()
|
||||
sCurrRowSelected = 0;
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(list), "select_row",
|
||||
GTK_SIGNAL_FUNC(RowSelected), NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(list), "key_press_event",
|
||||
GTK_SIGNAL_FUNC(KeyPressed), NULL);
|
||||
gtk_container_add(GTK_CONTAINER(scrollwin), list);
|
||||
gtk_widget_show(list);
|
||||
gtk_widget_show(scrollwin);
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), scrollwin, TRUE, TRUE, 0);
|
||||
gtk_widget_show(hbox);
|
||||
gtk_table_attach(GTK_TABLE(mTable), hbox, 0, 1, 2, 3,
|
||||
static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
|
||||
static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL),
|
||||
20, 0);
|
||||
|
||||
// XXX 3rd row: labels for ds avail and ds reqd
|
||||
|
||||
// 4th row: a frame with a label (long desc)
|
||||
descLongTable = gtk_table_new(1, 1, FALSE);
|
||||
gtk_widget_show(descLongTable);
|
||||
|
||||
gtk_table_attach(GTK_TABLE(mTable), descLongTable, 0, 1, 4, 5,
|
||||
static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL),
|
||||
static_cast<GtkAttachOptions>(GTK_EXPAND | GTK_FILL),
|
||||
20, 20);
|
||||
frame = gtk_frame_new(gCtx->Res("DESCRIPTION"));
|
||||
gtk_table_attach_defaults(GTK_TABLE(descLongTable), frame, 0, 1, 0, 1);
|
||||
gtk_widget_show(frame);
|
||||
|
||||
sDescLong = gtk_label_new(
|
||||
sCustomST->GetComponents()->GetFirstVisible()->GetDescLong());
|
||||
gtk_label_set_line_wrap(GTK_LABEL(sDescLong), TRUE);
|
||||
hbox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), sDescLong, FALSE, FALSE, 20);
|
||||
gtk_widget_show(hbox);
|
||||
|
||||
gtk_table_attach_defaults(GTK_TABLE(descLongTable), hbox, 0, 1, 0, 1);
|
||||
gtk_widget_show(sDescLong);
|
||||
|
||||
mWidgetsInit = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_notebook_set_page(GTK_NOTEBOOK(gCtx->notebook), mPageNum);
|
||||
gtk_widget_show(mTable);
|
||||
}
|
||||
|
||||
// signal connect the buttons
|
||||
gCtx->backID = gtk_signal_connect(GTK_OBJECT(gCtx->back), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsComponentsDlg::Back), gCtx->cdlg);
|
||||
gCtx->nextID = gtk_signal_connect(GTK_OBJECT(gCtx->next), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsComponentsDlg::Next), gCtx->cdlg);
|
||||
|
||||
// show back btn again after setup type dlg where we couldn't go back
|
||||
gtk_widget_set_sensitive(gCtx->back, TRUE);
|
||||
|
||||
if (aDirection == nsXInstallerDlg::BACKWARD_MOVE) // from install dlg
|
||||
gtk_button_set_label(GTK_BUTTON(gCtx->next), GTK_STOCK_GO_FORWARD);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentsDlg::Hide(int aDirection)
|
||||
{
|
||||
gtk_widget_hide(mTable);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentsDlg::SetMsg0(char *aMsg)
|
||||
{
|
||||
if (!aMsg)
|
||||
return E_PARAM;
|
||||
|
||||
mMsg0 = aMsg;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsComponentsDlg::GetMsg0()
|
||||
{
|
||||
if (mMsg0)
|
||||
return mMsg0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsComponentsDlg::SetCompList(nsComponentList *aCompList)
|
||||
{
|
||||
if (!aCompList)
|
||||
return E_PARAM;
|
||||
|
||||
mCompList = aCompList;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
nsComponentList *
|
||||
nsComponentsDlg::GetCompList()
|
||||
{
|
||||
if (mCompList)
|
||||
return mCompList;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
nsComponentsDlg::RowSelected(GtkWidget *aWidget, gint aRow, gint aColumn,
|
||||
GdkEventButton *aEvent, gpointer aData)
|
||||
{
|
||||
DUMP("RowSelected");
|
||||
|
||||
sCurrRowSelected = aRow;
|
||||
|
||||
// only toggle row selection state for clicks on the row
|
||||
if (aColumn == -1 && !aEvent)
|
||||
return;
|
||||
|
||||
ToggleRowSelection(aWidget, aRow,
|
||||
(aColumn == 0 && aEvent->button == 1));
|
||||
}
|
||||
|
||||
gboolean
|
||||
nsComponentsDlg::KeyPressed(GtkWidget *aWidget, GdkEventKey *aEvent,
|
||||
gpointer aData)
|
||||
{
|
||||
DUMP("KeyPressed");
|
||||
|
||||
if (aEvent->keyval == GDK_space)
|
||||
ToggleRowSelection(aWidget, sCurrRowSelected, TRUE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nsComponentsDlg::ToggleRowSelection(GtkWidget *aWidget, gint aRow,
|
||||
gboolean aToggleState)
|
||||
{
|
||||
int numRows = 0, currRow = 0;
|
||||
GtkStyle *style = NULL;
|
||||
GdkBitmap *ch_mask = NULL;
|
||||
GdkPixmap *checked = NULL;
|
||||
GdkBitmap *un_mask = NULL;
|
||||
GdkPixmap *unchecked = NULL;
|
||||
nsComponent *currComp = sCustomST->GetComponents()->GetHead();
|
||||
|
||||
style = gtk_widget_get_style(gCtx->window);
|
||||
checked = gdk_pixmap_create_from_xpm_d(gCtx->window->window, &ch_mask,
|
||||
&style->bg[GTK_STATE_NORMAL], (gchar **)check_on_xpm);
|
||||
unchecked = gdk_pixmap_create_from_xpm_d(gCtx->window->window, &un_mask,
|
||||
&style->bg[GTK_STATE_NORMAL], (gchar **)check_off_xpm);
|
||||
|
||||
numRows = sCustomST->GetComponents()->GetLengthVisible();
|
||||
while ((currRow < numRows) && currComp) // paranoia!
|
||||
{
|
||||
if (!currComp->IsInvisible())
|
||||
{
|
||||
if (aRow == currRow)
|
||||
{
|
||||
// update long desc
|
||||
gtk_label_set_text(GTK_LABEL(sDescLong),
|
||||
currComp->GetDescLong());
|
||||
gtk_widget_show(sDescLong);
|
||||
|
||||
if (aToggleState) {
|
||||
if (currComp->IsSelected()) {
|
||||
DUMP("Toggling off...");
|
||||
currComp->SetUnselected();
|
||||
} else {
|
||||
DUMP("Toggling on...");
|
||||
currComp->SetSelected();
|
||||
}
|
||||
}
|
||||
currComp->ResolveDependees(currComp->IsSelected(),
|
||||
sCustomST->GetComponents());
|
||||
break;
|
||||
}
|
||||
currRow++;
|
||||
}
|
||||
currComp = currComp->GetNext();
|
||||
}
|
||||
|
||||
// after resolving dependees redraw all checkboxes in one fell swoop
|
||||
currRow = 0;
|
||||
currComp = sCustomST->GetComponents()->GetHead();
|
||||
while ((currRow < numRows) && currComp) // paranoia!
|
||||
{
|
||||
if (!currComp->IsInvisible())
|
||||
{
|
||||
if (currComp->IsSelected())
|
||||
{
|
||||
gtk_clist_set_pixmap(GTK_CLIST(aWidget), currRow, 0,
|
||||
checked, ch_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_clist_set_pixmap(GTK_CLIST(aWidget), currRow, 0,
|
||||
unchecked, un_mask);
|
||||
}
|
||||
currRow++;
|
||||
}
|
||||
currComp = currComp->GetNext();
|
||||
}
|
||||
}
|
||||
@ -1,89 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_COMPONENTSDLG_H_
|
||||
#define _NS_COMPONENTSDLG_H_
|
||||
|
||||
#include "XIErrors.h"
|
||||
|
||||
#include "nsXInstallerDlg.h"
|
||||
#include "nsComponentList.h"
|
||||
#include "nsSetupType.h"
|
||||
|
||||
class nsComponentsDlg : public nsXInstallerDlg
|
||||
{
|
||||
public:
|
||||
nsComponentsDlg();
|
||||
~nsComponentsDlg();
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Navigation
|
||||
*--------------------------------------------------------------------*/
|
||||
static void Back(GtkWidget *aWidget, gpointer aData);
|
||||
static void Next(GtkWidget *aWidget, gpointer aData);
|
||||
|
||||
int Parse(nsINIParser* aParser);
|
||||
|
||||
int Show(int aDirection);
|
||||
int Hide(int aDirection);
|
||||
|
||||
static void RowSelected(GtkWidget *aWidget, gint aRow, gint aColumn,
|
||||
GdkEventButton *aEvent, gpointer aData);
|
||||
static gboolean KeyPressed(GtkWidget *aWidget, GdkEventKey *aEvent,
|
||||
gpointer aData);
|
||||
static void ToggleRowSelection(GtkWidget *aEvent, gint aRow,
|
||||
gboolean aToggleState);
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* INI Properties
|
||||
*--------------------------------------------------------------------*/
|
||||
int SetMsg0(char *aMsg);
|
||||
char *GetMsg0();
|
||||
|
||||
int SetCompList(nsComponentList *aCompList);
|
||||
nsComponentList *GetCompList();
|
||||
|
||||
private:
|
||||
int ParseDependees(char *aCurrSec, nsComponent *aCurrComp,
|
||||
nsINIParser *aParser);
|
||||
char *mMsg0;
|
||||
nsComponentList *mCompList;
|
||||
};
|
||||
|
||||
#endif /* _NS_COMPONENTSDLG_H_ */
|
||||
@ -1,334 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
#include "nsINIParser.h"
|
||||
|
||||
nsINIParser::nsINIParser(char *aFilename)
|
||||
{
|
||||
FILE *fd = NULL;
|
||||
long eofpos = 0;
|
||||
int rd = 0;
|
||||
|
||||
mFileBuf = NULL;
|
||||
mFileBufSize = 0;
|
||||
mError = OK;
|
||||
DUMP("nsINIParser");
|
||||
|
||||
/* param check */
|
||||
if (!aFilename)
|
||||
{
|
||||
mError = E_PARAM;
|
||||
return;
|
||||
}
|
||||
|
||||
/* open the file */
|
||||
fd = fopen(aFilename, "r");
|
||||
if (!fd)
|
||||
goto bail;
|
||||
|
||||
/* get file size */
|
||||
if (fseek(fd, 0, SEEK_END) != 0)
|
||||
goto bail;
|
||||
eofpos = ftell(fd);
|
||||
if (eofpos == 0)
|
||||
goto bail;
|
||||
|
||||
/* malloc an internal buf the size of the file */
|
||||
mFileBuf = (char *) malloc(eofpos + 1);
|
||||
if (!mFileBuf)
|
||||
{
|
||||
mError = E_MEM;
|
||||
return;
|
||||
}
|
||||
mFileBufSize = eofpos;
|
||||
|
||||
/* read the file in one swoop */
|
||||
if (fseek(fd, 0, SEEK_SET) != 0)
|
||||
goto bail;
|
||||
rd = fread((void *)mFileBuf, 1, eofpos, fd);
|
||||
if (!rd)
|
||||
goto bail;
|
||||
mFileBuf[mFileBufSize] = '\0';
|
||||
|
||||
/* close file */
|
||||
fclose(fd);
|
||||
|
||||
/* Make sure the buffer is null-terminated. */
|
||||
mFileBuf[eofpos] = '\0';
|
||||
|
||||
return;
|
||||
|
||||
bail:
|
||||
mError = E_READ;
|
||||
return;
|
||||
}
|
||||
|
||||
nsINIParser::~nsINIParser()
|
||||
{
|
||||
DUMP("~nsINIParser");
|
||||
}
|
||||
|
||||
int
|
||||
nsINIParser::GetString( char *aSection, char *aKey,
|
||||
char *aValBuf, int *aIOValBufSize )
|
||||
{
|
||||
char *secPtr = NULL;
|
||||
mError = OK;
|
||||
DUMP("GetString");
|
||||
|
||||
/* param check */
|
||||
if ( !aSection || !aKey || !aValBuf ||
|
||||
!aIOValBufSize || (*aIOValBufSize <= 0) )
|
||||
return E_PARAM;
|
||||
|
||||
/* find the section if it exists */
|
||||
mError = FindSection(aSection, &secPtr);
|
||||
if (mError != OK)
|
||||
return mError;
|
||||
|
||||
/* find the key if it exists in the valid section we found */
|
||||
mError = FindKey(secPtr, aKey, aValBuf, aIOValBufSize);
|
||||
|
||||
return mError;
|
||||
}
|
||||
|
||||
int
|
||||
nsINIParser::GetStringAlloc( char *aSection, char *aKey,
|
||||
char **aOutBuf, int *aOutBufSize )
|
||||
{
|
||||
char buf[MAX_VAL_SIZE];
|
||||
int bufsize = MAX_VAL_SIZE;
|
||||
mError = OK;
|
||||
DUMP("GetStringAlloc");
|
||||
|
||||
mError = GetString(aSection, aKey, buf, &bufsize);
|
||||
if (mError != OK)
|
||||
return mError;
|
||||
|
||||
*aOutBuf = (char *) malloc(bufsize + 1);
|
||||
strncpy(*aOutBuf, buf, bufsize);
|
||||
*(*aOutBuf + bufsize) = 0;
|
||||
*aOutBufSize = bufsize + 1;
|
||||
|
||||
return mError;
|
||||
}
|
||||
|
||||
int
|
||||
nsINIParser::GetError()
|
||||
{
|
||||
DUMP("GetError");
|
||||
return mError;
|
||||
}
|
||||
|
||||
char *
|
||||
nsINIParser::ResolveName(char *aINIRoot)
|
||||
{
|
||||
char *resolved = NULL;
|
||||
char *locale = NULL;
|
||||
struct stat st_exists;
|
||||
|
||||
/* param check */
|
||||
if (!aINIRoot)
|
||||
return NULL;
|
||||
|
||||
locale = setlocale(LC_CTYPE, NULL);
|
||||
if (!locale)
|
||||
return NULL;
|
||||
|
||||
/* resolved string: "<root>.ini.<locale>\0" */
|
||||
resolved = (char *) malloc(strlen(aINIRoot) + 5 + strlen(locale) + 1);
|
||||
if (!resolved)
|
||||
return NULL;
|
||||
|
||||
/* locale specific ini file name */
|
||||
sprintf(resolved, "%s.ini.%s", aINIRoot, locale);
|
||||
if (0 == stat(resolved, &st_exists))
|
||||
return resolved;
|
||||
|
||||
/* fallback to general ini file name */
|
||||
sprintf(resolved, "%s.ini", aINIRoot);
|
||||
if (0 == stat(resolved, &st_exists))
|
||||
return resolved;
|
||||
|
||||
/* neither existed so error returned */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsINIParser::FindSection(char *aSection, char **aOutSecPtr)
|
||||
{
|
||||
char *currChar = mFileBuf;
|
||||
char *nextSec = NULL;
|
||||
char *secClose = NULL;
|
||||
char *nextNL = NULL;
|
||||
int aSectionLen = strlen(aSection);
|
||||
mError = E_NO_SEC;
|
||||
DUMP("FindSection");
|
||||
|
||||
// param check
|
||||
if (!aSection || !aOutSecPtr)
|
||||
{
|
||||
mError = E_PARAM;
|
||||
return mError;
|
||||
}
|
||||
|
||||
while (currChar < (mFileBuf + mFileBufSize))
|
||||
{
|
||||
// look for first '['
|
||||
nextSec = NULL;
|
||||
nextSec = strchr(currChar, '[');
|
||||
if (!nextSec)
|
||||
break;
|
||||
|
||||
currChar = nextSec + 1;
|
||||
|
||||
// extract section name till first ']'
|
||||
secClose = NULL; nextNL = NULL;
|
||||
secClose = strchr(currChar, ']');
|
||||
nextNL = strchr(currChar, NL);
|
||||
if ((!nextNL) || (nextNL < secClose))
|
||||
{
|
||||
currChar = nextNL;
|
||||
continue;
|
||||
}
|
||||
|
||||
// if section name matches we succeeded
|
||||
if (strncmp(aSection, currChar, aSectionLen) == 0
|
||||
&& secClose-currChar == aSectionLen)
|
||||
{
|
||||
*aOutSecPtr = secClose + 1;
|
||||
mError = OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return mError;
|
||||
}
|
||||
|
||||
int
|
||||
nsINIParser::FindKey(char *aSecPtr, char *aKey, char *aVal, int *aIOValSize)
|
||||
{
|
||||
char *nextNL = NULL;
|
||||
char *secEnd = NULL;
|
||||
char *currLine = aSecPtr;
|
||||
char *nextEq = NULL;
|
||||
int aKeyLen = strlen(aKey);
|
||||
mError = E_NO_KEY;
|
||||
DUMP("FindKey");
|
||||
|
||||
// param check
|
||||
if (!aSecPtr || !aKey || !aVal || !aIOValSize || (*aIOValSize <= 0))
|
||||
{
|
||||
mError = E_PARAM;
|
||||
return mError;
|
||||
}
|
||||
|
||||
// determine the section end
|
||||
secEnd = aSecPtr;
|
||||
find_end:
|
||||
if (secEnd)
|
||||
secEnd = strchr(secEnd, '['); // search for next sec start
|
||||
if (!secEnd)
|
||||
{
|
||||
secEnd = strchr(aSecPtr, '\0'); // else search for file end
|
||||
if (!secEnd)
|
||||
{
|
||||
mError = E_SEC_CORRUPT; // else this data is corrupt
|
||||
return mError;
|
||||
}
|
||||
}
|
||||
|
||||
// handle start section token ('[') in values for i18n
|
||||
if (*secEnd == '[' && !(secEnd == aSecPtr || *(secEnd-1) == NL))
|
||||
{
|
||||
secEnd++;
|
||||
goto find_end;
|
||||
}
|
||||
|
||||
while (currLine < secEnd)
|
||||
{
|
||||
nextNL = NULL;
|
||||
nextNL = strchr(currLine, NL);
|
||||
if (!nextNL)
|
||||
nextNL = mFileBuf + mFileBufSize;
|
||||
|
||||
// ignore commented lines (starting with ;)
|
||||
if (currLine == strchr(currLine, ';'))
|
||||
{
|
||||
currLine = nextNL + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// extract key before '='
|
||||
nextEq = NULL;
|
||||
nextEq = strchr(currLine, '=');
|
||||
if (!nextEq || nextEq > nextNL)
|
||||
{
|
||||
currLine = nextNL + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// if key matches we succeeded
|
||||
if (strncmp(currLine, aKey, aKeyLen) == 0
|
||||
&& nextEq-currLine == aKeyLen)
|
||||
{
|
||||
// extract the value and return
|
||||
if (*aIOValSize < nextNL - nextEq)
|
||||
{
|
||||
mError = E_SMALL_BUF;
|
||||
*aVal = '\0';
|
||||
*aIOValSize = 0;
|
||||
return mError;
|
||||
}
|
||||
|
||||
*aIOValSize = nextNL - (nextEq + 1);
|
||||
strncpy(aVal, (nextEq + 1), *aIOValSize);
|
||||
*(aVal + *aIOValSize) = 0; // null terminate
|
||||
mError = OK;
|
||||
return mError;
|
||||
}
|
||||
else
|
||||
{
|
||||
currLine = nextNL + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return mError;
|
||||
}
|
||||
@ -1,163 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_INIPARSER_H_
|
||||
#define _NS_INIPARSER_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <locale.h>
|
||||
|
||||
class nsINIParser
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* nsINIParser
|
||||
*
|
||||
* Construct a new INI parser for the file specified.
|
||||
*
|
||||
* @param aFilename path to INI file
|
||||
*/
|
||||
nsINIParser(char *aFilename);
|
||||
~nsINIParser();
|
||||
|
||||
/**
|
||||
* GetString
|
||||
*
|
||||
* Gets the value of the specified key in the specified section
|
||||
* of the INI file represented by this instance. The value is stored
|
||||
* in the supplied buffer. The buffer size is provided as input and
|
||||
* the actual bytes used by the value is set in the in/out size param.
|
||||
*
|
||||
* @param aSection section name
|
||||
* @param aKey key name
|
||||
* @param aValBuf user supplied buffer
|
||||
* @param aIOValBufSize buf size on input; actual buf used on output
|
||||
*
|
||||
* @return mError operation success code
|
||||
*/
|
||||
int GetString( char *aSection, char *aKey,
|
||||
char *aValBuf, int *aIOValBufSize );
|
||||
|
||||
/**
|
||||
* GetStringAlloc
|
||||
*
|
||||
* Same as GetString() except the buffer is allocated to the exact
|
||||
* size of the value. Useful when the buffer is allocated everytime
|
||||
* rather than reusing the same buffer when calling this function
|
||||
* multiple times.
|
||||
*
|
||||
* @param aSection section name
|
||||
* @param aKey key name
|
||||
* @param aOutBuf buffer to be allocated
|
||||
* @param aOutBufSize size of newly allocated buffer
|
||||
*
|
||||
* @return mError operation success code
|
||||
*/
|
||||
int GetStringAlloc( char *aSection, char *aKey,
|
||||
char **aOutBuf, int *aOutBufSize );
|
||||
|
||||
/**
|
||||
* GetError
|
||||
*
|
||||
* Exposes the last error on this instance. Useful for checking
|
||||
* the state of the object after construction since the INI file
|
||||
* is parsed once at object-allocation time.
|
||||
*
|
||||
* @return mError last error on ops on this object
|
||||
*/
|
||||
int GetError();
|
||||
|
||||
/**
|
||||
* ResolveName
|
||||
*
|
||||
* Given a "root" name we append the runtime locale of the
|
||||
* current system to the <root>.ini. If such a file exists we
|
||||
* return this as the name else simply return <root>.ini.
|
||||
*
|
||||
* NOTE: Returned string is allocated and caller is responsible
|
||||
* ---- for its deallocation.
|
||||
*
|
||||
* @param aINIRoot the "root" of the INI file name
|
||||
* @return resolved the resolved INI file name
|
||||
* (NULL if neither exist)
|
||||
*/
|
||||
static char *ResolveName(char *aINIRoot);
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Errors
|
||||
*--------------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
OK = 0,
|
||||
E_READ = -701,
|
||||
E_MEM = -702,
|
||||
E_PARAM = -703,
|
||||
E_NO_SEC = -704,
|
||||
E_NO_KEY = -705,
|
||||
E_SEC_CORRUPT = -706,
|
||||
E_SMALL_BUF = -707
|
||||
};
|
||||
|
||||
private:
|
||||
int FindSection(char *aSection, char **aOutSecPtr);
|
||||
int FindKey(char *aSecPtr, char *aKey, char *aVal, int *aIOValSize);
|
||||
|
||||
char *mFileBuf;
|
||||
int mFileBufSize;
|
||||
int mError;
|
||||
};
|
||||
|
||||
#define NL '\n'
|
||||
#define MAX_VAL_SIZE 4096
|
||||
|
||||
#if defined(DUMP)
|
||||
#undef DUMP
|
||||
#endif
|
||||
#if defined(DEBUG_sgehani) || defined(DEBUG_druidd) || defined(DEBUG_root)
|
||||
#define DUMP(_msg) printf("%s %d: %s \n", __FILE__, __LINE__, _msg);
|
||||
#else
|
||||
#define DUMP(_msg)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*_NS_INIPARSER_H_ */
|
||||
@ -1,128 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_INSTALLDLG_H_
|
||||
#define _NS_INSTALLDLG_H_
|
||||
|
||||
#include "nsXInstallerDlg.h"
|
||||
#include "XIErrors.h"
|
||||
#include "nsRunApp.h"
|
||||
|
||||
class nsComponent;
|
||||
|
||||
class nsInstallDlg : public nsXInstallerDlg
|
||||
{
|
||||
public:
|
||||
nsInstallDlg();
|
||||
~nsInstallDlg();
|
||||
|
||||
/*------------------------------------------------------------------*
|
||||
* Navigation
|
||||
*------------------------------------------------------------------*/
|
||||
static void Back(GtkWidget *aWidget, gpointer aData);
|
||||
static void Next(GtkWidget *aWidget, gpointer aData);
|
||||
|
||||
int Parse(nsINIParser* aParser);
|
||||
|
||||
int Show(int aDirection);
|
||||
int Hide(int aDirection);
|
||||
int ShowTable();
|
||||
int HideTable();
|
||||
|
||||
static void XPIProgressCB(const char *aMsg, int aVal, int aMax);
|
||||
static void MajorProgressCB(char *aName, int aNum, int aTotal,
|
||||
int aActivity);
|
||||
static int DownloadCB(int aBytesRd, int aTotal);
|
||||
static void SetDownloadComp(nsComponent *aComp, int aURLIndex,
|
||||
int aNum, int aTotal);
|
||||
static void ClearRateLabel();
|
||||
static int CancelOrPause();
|
||||
|
||||
void ReInitUI();
|
||||
void ShowCRCDlg();
|
||||
void DestroyCRCDlg();
|
||||
|
||||
enum
|
||||
{
|
||||
ACT_DOWNLOAD,
|
||||
ACT_EXTRACT,
|
||||
ACT_INSTALL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
E_DL_PAUSE = -1101,
|
||||
E_DL_CANCEL = -1102,
|
||||
E_DL_DROP_CXN = -1103
|
||||
};
|
||||
|
||||
/*------------------------------------------------------------------*
|
||||
* INI Properties
|
||||
*------------------------------------------------------------------*/
|
||||
int SetMsg0(char *aMsg);
|
||||
char *GetMsg0();
|
||||
|
||||
private:
|
||||
static int PerformInstall(void); // install start
|
||||
static void SaveModulesToggled(GtkWidget *aWidget, gpointer aData);
|
||||
static void ShowProxySettings(GtkWidget *aWidget, gpointer aData);
|
||||
static void PSDlgOK (GtkWidget *aWidget, gpointer aData);
|
||||
static void PSDlgCancel(GtkWidget *aWidget, gpointer aData);
|
||||
static void RunApps();
|
||||
static void FreeRunAppList();
|
||||
int AppendRunApp(nsRunApp *aNewRunApp);
|
||||
static void DLPause(GtkWidget *aWidget, gpointer aData);
|
||||
static void DLResume(GtkWidget *aWidget, gpointer aData);
|
||||
static void DLCancel(GtkWidget *aWidget, gpointer aData);
|
||||
static int ShowCRCFailedDlg();
|
||||
static int ShowCxnDroppedDlg();
|
||||
static void CRCFailedOK(GtkWidget *aWidget, gpointer aData);
|
||||
static void CxnDroppedOK(GtkWidget *aWidget, gpointer aData);
|
||||
static void CRCOKCb(GtkWidget *aWidget, gpointer aData);
|
||||
static void HideNavButtons();
|
||||
static void InitInstallProgress();
|
||||
static int TotalDLSize();
|
||||
static void CompressToFit(char *aOrigStr, char *aOutStr,
|
||||
int aOutStrLen);
|
||||
static void InitDLProgress(int IsFirst);
|
||||
|
||||
char *mMsg0;
|
||||
};
|
||||
|
||||
#endif /* _NS_INSTALLDLG_H_ */
|
||||
@ -1,322 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsLicenseDlg.h"
|
||||
#include "nsXInstaller.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
nsLicenseDlg::nsLicenseDlg() :
|
||||
mLicenseFile(NULL),
|
||||
mMsg0(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsLicenseDlg::~nsLicenseDlg()
|
||||
{
|
||||
XI_IF_FREE(mLicenseFile);
|
||||
}
|
||||
|
||||
void
|
||||
nsLicenseDlg::Back(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Back");
|
||||
if (aData != gCtx->ldlg) return;
|
||||
|
||||
// XXX call gCtx->me->Shutdown() ?
|
||||
gtk_main_quit();
|
||||
return;
|
||||
|
||||
#if 0
|
||||
// hide this notebook page
|
||||
gCtx->ldlg->Hide(nsXInstallerDlg::BACKWARD_MOVE);
|
||||
|
||||
// disconnect this dlg's nav btn signal handlers
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->back), gCtx->backID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->next), gCtx->nextID);
|
||||
|
||||
// show the prev dlg
|
||||
gCtx->wdlg->Show(nsXInstallerDlg::BACKWARD_MOVE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
nsLicenseDlg::Next(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Next");
|
||||
if (aData != gCtx->ldlg) return;
|
||||
|
||||
// hide this notebook page
|
||||
gCtx->ldlg->Hide(nsXInstallerDlg::FORWARD_MOVE);
|
||||
|
||||
// disconnect this dlg's nav btn signal handlers
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->back), gCtx->backID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->next), gCtx->nextID);
|
||||
|
||||
// show the next dlg
|
||||
gCtx->sdlg->Show(nsXInstallerDlg::FORWARD_MOVE);
|
||||
}
|
||||
|
||||
int
|
||||
nsLicenseDlg::Parse(nsINIParser *aParser)
|
||||
{
|
||||
int err = OK;
|
||||
int bufsize = 0;
|
||||
char *showDlg = NULL;
|
||||
|
||||
/* compulsory keys*/
|
||||
XI_ERR_BAIL(aParser->GetStringAlloc(DLG_LICENSE, LICENSE,
|
||||
&mLicenseFile, &bufsize));
|
||||
if (bufsize == 0 || !mLicenseFile)
|
||||
return E_INVALID_KEY;
|
||||
|
||||
bufsize = 5;
|
||||
XI_ERR_BAIL(aParser->GetStringAlloc(DLG_LICENSE, SHOW_DLG, &showDlg,
|
||||
&bufsize));
|
||||
if (bufsize != 0 && showDlg)
|
||||
{
|
||||
if (0 == strncmp(showDlg, "TRUE", 4))
|
||||
mShowDlg = nsXInstallerDlg::SHOW_DIALOG;
|
||||
else if (0 == strncmp(showDlg, "FALSE", 5))
|
||||
mShowDlg = nsXInstallerDlg::SKIP_DIALOG;
|
||||
}
|
||||
|
||||
bufsize = 0;
|
||||
XI_ERR_BAIL(aParser->GetStringAlloc(DLG_LICENSE, TITLE, &mTitle,
|
||||
&bufsize));
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mTitle);
|
||||
|
||||
aParser->GetStringAlloc(DLG_LICENSE, SUBTITLE, &mSubTitle, &bufsize);
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mSubTitle);
|
||||
|
||||
aParser->GetStringAlloc(DLG_LICENSE, MSG0, &mMsg0, &bufsize);
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mMsg0);
|
||||
|
||||
BAIL:
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsLicenseDlg::Show(int aDirection)
|
||||
{
|
||||
int err = OK;
|
||||
char *licenseContents = NULL;
|
||||
char *titleBuf;
|
||||
|
||||
XI_VERIFY(gCtx);
|
||||
XI_VERIFY(gCtx->notebook);
|
||||
|
||||
if (!mWidgetsInit) {
|
||||
// static widget init
|
||||
|
||||
// Create a vbox with the message and scrolled window, and append it
|
||||
// as a page of the notebook.
|
||||
|
||||
mBox = gtk_vbox_new(FALSE, 6);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(mBox), 12);
|
||||
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(gCtx->notebook), mBox, NULL);
|
||||
mPageNum = gtk_notebook_get_current_page(GTK_NOTEBOOK(gCtx->notebook));
|
||||
|
||||
// Change "\n" in the label to a space and a literal newline character.
|
||||
char *newline = strstr(mMsg0, "\\n");
|
||||
if (newline) {
|
||||
newline[0] = ' ';
|
||||
newline[1] = '\n';
|
||||
}
|
||||
|
||||
GtkWidget *msg0 = gtk_label_new(NULL);
|
||||
gtk_label_set_markup(GTK_LABEL(msg0), mMsg0);
|
||||
gtk_label_set_line_wrap(GTK_LABEL(msg0), TRUE);
|
||||
gtk_misc_set_alignment(GTK_MISC(msg0), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(mBox), msg0, FALSE, FALSE, 0);
|
||||
|
||||
GtkWidget *frame = gtk_frame_new(NULL);
|
||||
// gtk_container_set_border_width(GTK_CONTAINER(frame), 10);
|
||||
gtk_box_pack_start(GTK_BOX(mBox), frame, TRUE, TRUE, 0);
|
||||
|
||||
GtkWidget *scrollWindow = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_container_add(GTK_CONTAINER(frame), scrollWindow);
|
||||
|
||||
// read the license file contents into memory
|
||||
licenseContents = GetLicenseContents();
|
||||
if (!licenseContents) {
|
||||
err = ErrorHandler(E_EMPTY_LICENSE);
|
||||
goto BAIL;
|
||||
}
|
||||
|
||||
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL);
|
||||
|
||||
GtkTextIter start_iter;
|
||||
gtk_text_buffer_get_start_iter(buffer, &start_iter);
|
||||
gtk_text_buffer_insert_with_tags(buffer, &start_iter, licenseContents,
|
||||
-1, /* monoTag, */ NULL);
|
||||
|
||||
GtkWidget *text = gtk_text_view_new_with_buffer(buffer);
|
||||
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
|
||||
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
|
||||
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 2);
|
||||
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 2);
|
||||
// gtk_text_view_set_top_margin(GTK_TEXT_VIEW(text), 2);
|
||||
// gtk_text_view_set_bottom_margin(GTK_TEXT_VIEW(text), 2);
|
||||
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollWindow),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(scrollWindow), text);
|
||||
|
||||
mWidgetsInit = TRUE;
|
||||
} else {
|
||||
gtk_notebook_set_page(GTK_NOTEBOOK(gCtx->notebook), mPageNum);
|
||||
}
|
||||
|
||||
gtk_widget_show_all(mBox);
|
||||
|
||||
// <b>title</b>\0
|
||||
titleBuf = new char[strlen(mTitle) + 9];
|
||||
sprintf(titleBuf, "<b>%s</b>", mTitle);
|
||||
|
||||
gtk_label_set_markup(GTK_LABEL(gCtx->header_title), titleBuf);
|
||||
gtk_label_set_text(GTK_LABEL(gCtx->header_subtitle), mSubTitle);
|
||||
|
||||
delete[] titleBuf;
|
||||
|
||||
// Set up the header if we're moving forward.
|
||||
if (aDirection == nsXInstallerDlg::FORWARD_MOVE) {
|
||||
GtkStyle *style = gtk_widget_get_style(gCtx->header);
|
||||
if (style->bg_pixmap[GTK_STATE_NORMAL]) {
|
||||
gint width, height;
|
||||
gdk_drawable_get_size(style->bg_pixmap[GTK_STATE_NORMAL],
|
||||
&width, &height);
|
||||
gtk_widget_set_size_request(gCtx->header, -1, height);
|
||||
}
|
||||
}
|
||||
|
||||
// signal connect the buttons
|
||||
gCtx->backID = gtk_signal_connect(GTK_OBJECT(gCtx->back), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsLicenseDlg::Back), gCtx->ldlg);
|
||||
gCtx->nextID = gtk_signal_connect(GTK_OBJECT(gCtx->next), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsLicenseDlg::Next), gCtx->ldlg);
|
||||
|
||||
// enable back button if we came from the welcome dlg
|
||||
if (aDirection == nsXInstallerDlg::FORWARD_MOVE)
|
||||
if (gCtx->back)
|
||||
gtk_widget_set_sensitive(gCtx->back, TRUE);
|
||||
|
||||
// always change the button titles to Accept/Decline
|
||||
gtk_button_set_label(GTK_BUTTON(gCtx->next), gCtx->Res("ACCEPT"));
|
||||
gtk_button_set_label(GTK_BUTTON(gCtx->back), gCtx->Res("DECLINE"));
|
||||
|
||||
BAIL:
|
||||
XI_IF_FREE(licenseContents);
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsLicenseDlg::Hide(int aDirection)
|
||||
{
|
||||
// hide all this dlg's widgets
|
||||
gtk_widget_hide(mBox);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsLicenseDlg::SetLicenseFile(char *aLicenseFile)
|
||||
{
|
||||
if (!aLicenseFile)
|
||||
return E_PARAM;
|
||||
|
||||
mLicenseFile = aLicenseFile;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsLicenseDlg::GetLicenseFile()
|
||||
{
|
||||
if (mLicenseFile)
|
||||
return mLicenseFile;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
nsLicenseDlg::GetLicenseContents()
|
||||
{
|
||||
char *buf = NULL;
|
||||
FILE *fd = NULL;
|
||||
struct stat attr;
|
||||
int buflen;
|
||||
|
||||
DUMP(mLicenseFile);
|
||||
if (!mLicenseFile)
|
||||
return NULL;
|
||||
|
||||
// open file
|
||||
fd = fopen(mLicenseFile, "r");
|
||||
if (!fd) return NULL;
|
||||
DUMP("license fopen");
|
||||
|
||||
// get file length
|
||||
if (0 != stat(mLicenseFile, &attr)) return NULL;
|
||||
if (attr.st_size == 0) return NULL;
|
||||
DUMP("license fstat");
|
||||
|
||||
// allocate buffer of file length
|
||||
buflen = sizeof(char) * (attr.st_size + 1);
|
||||
buf = (char *) malloc(buflen);
|
||||
if (!buf) return NULL;
|
||||
memset(buf, 0, buflen);
|
||||
DUMP("license buf malloc");
|
||||
|
||||
// read entire file into buffer
|
||||
if (attr.st_size != ((int) fread(buf, sizeof(char), attr.st_size, fd)))
|
||||
XI_IF_FREE(buf);
|
||||
DUMP("license fread");
|
||||
|
||||
// close file
|
||||
fclose(fd);
|
||||
DUMP("license close");
|
||||
|
||||
return buf;
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_LICENSEDLG_H_
|
||||
#define _NS_LICENSEDLG_H_
|
||||
|
||||
#include "nsXInstallerDlg.h"
|
||||
#include "XIErrors.h"
|
||||
|
||||
class nsLicenseDlg : public nsXInstallerDlg
|
||||
{
|
||||
public:
|
||||
nsLicenseDlg();
|
||||
~nsLicenseDlg();
|
||||
|
||||
/*-------------------------------------------------------------------*
|
||||
* Navigation
|
||||
*-------------------------------------------------------------------*/
|
||||
static void Back(GtkWidget *aWidget, gpointer aData);
|
||||
static void Next(GtkWidget *aWidget, gpointer aData);
|
||||
|
||||
int Parse(nsINIParser *aParser);
|
||||
|
||||
int Show(int aDirection);
|
||||
int Hide(int aDirection);
|
||||
|
||||
/*-------------------------------------------------------------------*
|
||||
* INI Properties
|
||||
*-------------------------------------------------------------------*/
|
||||
int SetLicenseFile(char *aLicenseFile);
|
||||
char *GetLicenseFile();
|
||||
char *GetLicenseContents();
|
||||
|
||||
private:
|
||||
char *mLicenseFile;
|
||||
char *mMsg0;
|
||||
char *mMsg1;
|
||||
GtkWidget *mBox;
|
||||
};
|
||||
|
||||
#endif /* _NS_LICENSEDLG_H_ */
|
||||
@ -1,78 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsRunApp.h"
|
||||
|
||||
nsRunApp::nsRunApp(char *aApp, char *aArgs) :
|
||||
mApp(aApp),
|
||||
mArgs(aArgs),
|
||||
mNext(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsRunApp::~nsRunApp()
|
||||
{
|
||||
XI_IF_FREE(mApp);
|
||||
XI_IF_FREE(mArgs);
|
||||
}
|
||||
|
||||
char *
|
||||
nsRunApp::GetApp()
|
||||
{
|
||||
return mApp;
|
||||
}
|
||||
|
||||
char *
|
||||
nsRunApp::GetArgs()
|
||||
{
|
||||
return mArgs;
|
||||
}
|
||||
|
||||
void
|
||||
nsRunApp::SetNext(nsRunApp *aNext)
|
||||
{
|
||||
mNext = aNext;
|
||||
}
|
||||
|
||||
nsRunApp *
|
||||
nsRunApp::GetNext()
|
||||
{
|
||||
return mNext;
|
||||
}
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_RUNAPP_H_
|
||||
#define _NS_RUNAPP_H_
|
||||
|
||||
#include "XIDefines.h"
|
||||
|
||||
class nsRunApp
|
||||
{
|
||||
public:
|
||||
nsRunApp(char *aApp, char *aArgs);
|
||||
~nsRunApp();
|
||||
|
||||
char *GetApp();
|
||||
char *GetArgs();
|
||||
void SetNext(nsRunApp *aNext);
|
||||
nsRunApp *GetNext();
|
||||
|
||||
private:
|
||||
char *mApp;
|
||||
char *mArgs;
|
||||
nsRunApp *mNext;
|
||||
};
|
||||
|
||||
#endif /* _NS_RUNAPP_H_ */
|
||||
@ -1,154 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsSetupType.h"
|
||||
|
||||
nsSetupType::nsSetupType() :
|
||||
mDescShort(NULL),
|
||||
mDescLong(NULL),
|
||||
mComponents(NULL),
|
||||
mNext(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsSetupType::~nsSetupType()
|
||||
{
|
||||
if (mDescShort)
|
||||
free (mDescShort);
|
||||
if (mDescLong)
|
||||
free (mDescLong);
|
||||
if (mComponents)
|
||||
delete mComponents;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupType::SetDescShort(char *aDescShort)
|
||||
{
|
||||
if (!aDescShort)
|
||||
return E_PARAM;
|
||||
|
||||
mDescShort = aDescShort;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsSetupType::GetDescShort()
|
||||
{
|
||||
if (mDescShort)
|
||||
return mDescShort;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupType::SetDescLong(char *aDescLong)
|
||||
{
|
||||
if (!aDescLong)
|
||||
return E_PARAM;
|
||||
|
||||
mDescLong = aDescLong;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsSetupType::GetDescLong()
|
||||
{
|
||||
if (mDescLong)
|
||||
return mDescLong;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupType::SetComponent(nsComponent *aComponent)
|
||||
{
|
||||
if (!aComponent)
|
||||
return E_PARAM;
|
||||
|
||||
if (!mComponents)
|
||||
mComponents = new nsComponentList();
|
||||
|
||||
if (!mComponents)
|
||||
return E_MEM;
|
||||
|
||||
return mComponents->AddComponent(aComponent);
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupType::UnsetComponent(nsComponent *aComponent)
|
||||
{
|
||||
if (!aComponent)
|
||||
return E_PARAM;
|
||||
|
||||
if (!mComponents)
|
||||
return OK;
|
||||
|
||||
return mComponents->RemoveComponent(aComponent);
|
||||
}
|
||||
|
||||
nsComponentList *
|
||||
nsSetupType::GetComponents()
|
||||
{
|
||||
if (mComponents)
|
||||
return mComponents;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupType::SetNext(nsSetupType *aSetupType)
|
||||
{
|
||||
if (!aSetupType)
|
||||
return E_PARAM;
|
||||
|
||||
mNext = aSetupType;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
nsSetupType *
|
||||
nsSetupType::GetNext()
|
||||
{
|
||||
if (mNext)
|
||||
return mNext;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_SETUPTYPE_H_
|
||||
#define _NS_SETUPTYPE_H_
|
||||
|
||||
#include "XIDefines.h"
|
||||
#include "XIErrors.h"
|
||||
|
||||
#include "nsComponent.h"
|
||||
|
||||
class nsComponentList;
|
||||
|
||||
class nsSetupType
|
||||
{
|
||||
public:
|
||||
nsSetupType();
|
||||
~nsSetupType();
|
||||
|
||||
/*--------------------------------------------------------------*
|
||||
* Accessors/Mutators
|
||||
*--------------------------------------------------------------*/
|
||||
int SetDescShort(char *aDescShort);
|
||||
char * GetDescShort();
|
||||
int SetDescLong(char *aDescLong);
|
||||
char * GetDescLong();
|
||||
int SetComponent(nsComponent *aComponent);
|
||||
int UnsetComponent(nsComponent *aComponent);
|
||||
nsComponentList *GetComponents();
|
||||
int SetNext(nsSetupType *aSetupType);
|
||||
nsSetupType * GetNext();
|
||||
|
||||
private:
|
||||
char *mDescShort;
|
||||
char *mDescLong;
|
||||
nsComponentList *mComponents;
|
||||
nsSetupType *mNext;
|
||||
};
|
||||
|
||||
#endif /* _NS_SETUPTYPE_H_ */
|
||||
@ -1,953 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsSetupTypeDlg.h"
|
||||
#include "nsXInstaller.h"
|
||||
|
||||
|
||||
// need these for statfs
|
||||
|
||||
#ifdef HAVE_SYS_STATVFS_H
|
||||
#include <sys/statvfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STATFS_H
|
||||
#include <sys/statfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STATVFS
|
||||
#define STATFS statvfs
|
||||
#else
|
||||
#define STATFS statfs
|
||||
#endif
|
||||
|
||||
|
||||
static GtkWidget *sBrowseBtn;
|
||||
static gint sBrowseBtnID;
|
||||
static GtkWidget *sFolder;
|
||||
static int sFilePickerUp = FALSE;
|
||||
|
||||
nsSetupTypeDlg::nsSetupTypeDlg() :
|
||||
mBox(NULL),
|
||||
mExistingMsg(NULL),
|
||||
mMsg0(NULL),
|
||||
mSetupTypeList(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsSetupTypeDlg::~nsSetupTypeDlg()
|
||||
{
|
||||
FreeSetupTypeList();
|
||||
|
||||
XI_IF_FREE(mMsg0);
|
||||
XI_IF_FREE(mExistingMsg);
|
||||
}
|
||||
|
||||
void
|
||||
nsSetupTypeDlg::Back(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Back");
|
||||
if (aData != gCtx->sdlg) return;
|
||||
|
||||
// hide this notebook page
|
||||
gCtx->sdlg->Hide(nsXInstallerDlg::BACKWARD_MOVE);
|
||||
|
||||
// disconnect this dlg's nav btn signal handlers
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->back), gCtx->backID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->next), gCtx->nextID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(sBrowseBtn), sBrowseBtnID);
|
||||
|
||||
// show the next dlg
|
||||
gCtx->ldlg->Show(nsXInstallerDlg::BACKWARD_MOVE);
|
||||
}
|
||||
|
||||
void
|
||||
nsSetupTypeDlg::Next(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Next");
|
||||
if (aData != gCtx->sdlg) return;
|
||||
|
||||
GSList *s = gCtx->sdlg->mRadioGroup;
|
||||
gCtx->opt->mSetupType = 0;
|
||||
while (s) {
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(s->data)))
|
||||
break;
|
||||
|
||||
++gCtx->opt->mSetupType;
|
||||
s = s->next;
|
||||
}
|
||||
|
||||
// verify selected destination directory exists
|
||||
if (OK != nsSetupTypeDlg::VerifyDestination())
|
||||
return;
|
||||
|
||||
// old installation may exist: delete it
|
||||
if (OK != nsSetupTypeDlg::DeleteOldInst())
|
||||
return;
|
||||
|
||||
// if not custom setup type verify disk space
|
||||
if (gCtx->opt->mSetupType != (gCtx->sdlg->GetNumSetupTypes() - 1))
|
||||
{
|
||||
if (OK != nsSetupTypeDlg::VerifyDiskSpace())
|
||||
return;
|
||||
}
|
||||
|
||||
// hide this notebook page
|
||||
gCtx->sdlg->Hide(nsXInstallerDlg::FORWARD_MOVE);
|
||||
|
||||
// disconnect this dlg's nav btn signal handlers
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->back), gCtx->backID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->next), gCtx->nextID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(sBrowseBtn), sBrowseBtnID);
|
||||
|
||||
// show the last dlg
|
||||
if (gCtx->opt->mSetupType == (gCtx->sdlg->GetNumSetupTypes() - 1))
|
||||
gCtx->cdlg->Show(nsXInstallerDlg::FORWARD_MOVE);
|
||||
else
|
||||
gCtx->idlg->Show(nsXInstallerDlg::FORWARD_MOVE);
|
||||
}
|
||||
|
||||
nsComponent*
|
||||
nsSetupTypeDlg::ParseComponent(nsINIParser *aParser, char *aCompName)
|
||||
{
|
||||
char *descShort = NULL, *descLong = NULL, *archive = NULL,
|
||||
*installSize = NULL, *archiveSize = NULL, *attr = NULL;
|
||||
int bufsize = 0, err;
|
||||
nsComponent *comp = NULL;
|
||||
|
||||
err = aParser->GetStringAlloc(aCompName, DESC_SHORT, &descShort, &bufsize);
|
||||
if (err != OK)
|
||||
goto bail;
|
||||
|
||||
err = aParser->GetStringAlloc(aCompName, DESC_LONG, &descLong, &bufsize);
|
||||
if (err != OK)
|
||||
goto bail;
|
||||
|
||||
err = aParser->GetStringAlloc(aCompName, ARCHIVE, &archive, &bufsize);
|
||||
if (err != OK)
|
||||
goto bail;
|
||||
|
||||
err = aParser->GetStringAlloc(aCompName, INSTALL_SIZE,
|
||||
&installSize, &bufsize);
|
||||
if (err != OK)
|
||||
goto bail;
|
||||
|
||||
err = aParser->GetStringAlloc(aCompName, ARCHIVE_SIZE,
|
||||
&archiveSize, &bufsize);
|
||||
if (err != OK)
|
||||
goto bail;
|
||||
|
||||
err = aParser->GetStringAlloc(aCompName, ATTRIBUTES, &attr, &bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) // this is optional
|
||||
goto bail;
|
||||
|
||||
comp = new nsComponent();
|
||||
if (!comp)
|
||||
goto bail;
|
||||
|
||||
comp->SetDescShort(descShort);
|
||||
comp->SetDescLong(descLong);
|
||||
comp->SetArchive(archive);
|
||||
comp->SetInstallSize(atoi(installSize));
|
||||
comp->SetArchiveSize(atoi(archiveSize));
|
||||
|
||||
if (strstr(attr, SELECTED_ATTR)) {
|
||||
comp->SetSelected();
|
||||
comp->DepAddRef();
|
||||
}
|
||||
else {
|
||||
comp->SetUnselected();
|
||||
}
|
||||
|
||||
if (strstr(attr, INVISIBLE_ATTR))
|
||||
comp->SetInvisible();
|
||||
else
|
||||
comp->SetVisible();
|
||||
|
||||
if (strstr(attr, LAUNCHAPP_ATTR))
|
||||
comp->SetLaunchApp();
|
||||
else
|
||||
comp->SetDontLaunchApp();
|
||||
|
||||
if (strstr(attr, DOWNLOAD_ONLY_ATTR))
|
||||
comp->SetDownloadOnly();
|
||||
|
||||
if (strstr(attr, MAIN_COMPONENT_ATTR))
|
||||
comp->SetMainComponent();
|
||||
|
||||
for (int i = 0; i < MAX_URLS; ++i) {
|
||||
char urlKey[MAX_URL_LEN], *currURL;
|
||||
sprintf(urlKey, URLd, i);
|
||||
err = aParser->GetStringAlloc(aCompName, urlKey, &currURL, &bufsize);
|
||||
if (err != OK)
|
||||
break;
|
||||
|
||||
comp->SetURL(currURL, i);
|
||||
}
|
||||
|
||||
for (int j = 0; j < MAX_COMPONENTS; ++j) {
|
||||
char *currDep = NULL;
|
||||
char key[MAX_DEPENDEE_KEY_LEN];
|
||||
|
||||
sprintf(key, DEPENDEEd, j);
|
||||
|
||||
err = aParser->GetStringAlloc(aCompName, key, &currDep, &bufsize);
|
||||
if (bufsize == 0 || err != OK)
|
||||
break; // no more dependees
|
||||
|
||||
comp->AddDependee(currDep); // we will scan for invalid dependencies later
|
||||
}
|
||||
|
||||
return comp;
|
||||
bail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::Parse(nsINIParser *aParser)
|
||||
{
|
||||
int err = OK;
|
||||
int bufsize = 0;
|
||||
char *showDlg = NULL;
|
||||
int i, j;
|
||||
char *currSec = (char *) malloc(strlen(SETUP_TYPE) + 3); // e.g. SetupType12
|
||||
if (!currSec) return E_MEM;
|
||||
char *currKey = (char *) malloc(1 + 3); // e.g. C0, C1, C12
|
||||
if (!currKey) return E_MEM;
|
||||
char *currVal = NULL;
|
||||
nsComponent *currComp = NULL;
|
||||
int currNumComps = 0;
|
||||
nsSetupType *currST = NULL;
|
||||
char *currDescShort = NULL;
|
||||
char *currDescLong = NULL;
|
||||
|
||||
XI_VERIFY(gCtx);
|
||||
|
||||
XI_ERR_BAIL(aParser->GetStringAlloc(DLG_SETUP_TYPE, MSGEXISTING,
|
||||
&mExistingMsg, &bufsize));
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mExistingMsg);
|
||||
|
||||
/* optional keys */
|
||||
err = aParser->GetStringAlloc(DLG_SETUP_TYPE, MSG0, &mMsg0, &bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) goto BAIL; else err = OK;
|
||||
|
||||
bufsize = 5;
|
||||
err = aParser->GetStringAlloc(DLG_SETUP_TYPE, SHOW_DLG, &showDlg, &bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) goto BAIL; else err = OK;
|
||||
if (bufsize != 0 && showDlg)
|
||||
{
|
||||
if (0 == strncmp(showDlg, "TRUE", 4))
|
||||
mShowDlg = nsXInstallerDlg::SHOW_DIALOG;
|
||||
else if (0 == strncmp(showDlg, "FALSE", 5))
|
||||
mShowDlg = nsXInstallerDlg::SKIP_DIALOG;
|
||||
}
|
||||
|
||||
bufsize = 0;
|
||||
err = aParser->GetStringAlloc(DLG_SETUP_TYPE, TITLE, &mTitle, &bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) goto BAIL; else err = OK;
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mTitle);
|
||||
|
||||
aParser->GetStringAlloc(DLG_SETUP_TYPE, SUBTITLE, &mSubTitle, &bufsize);
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mSubTitle);
|
||||
|
||||
/* setup types */
|
||||
for (i=0; i<MAX_SETUP_TYPES; i++)
|
||||
{
|
||||
sprintf(currSec, SETUP_TYPEd, i);
|
||||
|
||||
bufsize = 0;
|
||||
err = aParser->GetStringAlloc(currSec, DESC_SHORT, &currDescShort,
|
||||
&bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_SEC) goto fin_iter;
|
||||
if (bufsize == 0 || err == nsINIParser::E_NO_SEC) // no more setup types
|
||||
{
|
||||
err = OK;
|
||||
break;
|
||||
}
|
||||
|
||||
bufsize = 0;
|
||||
err = aParser->GetStringAlloc(currSec, DESC_LONG, &currDescLong,
|
||||
&bufsize);
|
||||
if (err != OK || bufsize == 0) goto fin_iter;
|
||||
|
||||
currST = new nsSetupType();
|
||||
if (!currST) goto fin_iter;
|
||||
|
||||
// The short description may contain mnemonics by prefixing
|
||||
// characters with "&". We need to change these to "_" for GTK.
|
||||
for (char *c = currDescShort; *c != '\0'; ++c) {
|
||||
if (*c == '&') // XXX this doesn't quite handle "&&"
|
||||
*c = '_';
|
||||
}
|
||||
|
||||
currST->SetDescShort(currDescShort);
|
||||
currST->SetDescLong(currDescLong);
|
||||
|
||||
currNumComps = 0;
|
||||
for (j=0; j<MAX_COMPONENTS; j++)
|
||||
{
|
||||
sprintf(currKey, Cd, j);
|
||||
|
||||
bufsize = 0;
|
||||
err = aParser->GetStringAlloc(currSec, currKey, &currVal,
|
||||
&bufsize);
|
||||
if (err != OK && err != nsINIParser::E_NO_KEY) continue;
|
||||
if (bufsize == 0 || err == nsINIParser::E_NO_KEY)
|
||||
{
|
||||
err = OK;
|
||||
break;
|
||||
}
|
||||
|
||||
currComp = ParseComponent(aParser, currVal);
|
||||
if (currComp) {
|
||||
currST->SetComponent(currComp);
|
||||
++currNumComps;
|
||||
}
|
||||
}
|
||||
|
||||
if (currNumComps > 0)
|
||||
{
|
||||
AddSetupType(currST);
|
||||
currST = NULL;
|
||||
}
|
||||
|
||||
fin_iter:
|
||||
XI_IF_DELETE(currST);
|
||||
}
|
||||
|
||||
err = OK;
|
||||
|
||||
BAIL:
|
||||
XI_IF_FREE(currSec);
|
||||
XI_IF_FREE(currKey);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::Show(int aDirection)
|
||||
{
|
||||
int err = OK;
|
||||
int numSetupTypes = 0;
|
||||
GtkWidget *radbtn;
|
||||
nsSetupType *currST = NULL;
|
||||
GtkWidget *frame = NULL;
|
||||
|
||||
XI_VERIFY(gCtx);
|
||||
XI_VERIFY(gCtx->notebook);
|
||||
|
||||
if (mWidgetsInit == FALSE)
|
||||
{
|
||||
// add a vbox as a page of the notebook
|
||||
mBox = gtk_vbox_new(FALSE, 0);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(mBox), 12);
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(gCtx->notebook), mBox, NULL);
|
||||
mPageNum = gtk_notebook_get_current_page(GTK_NOTEBOOK(gCtx->notebook));
|
||||
|
||||
// add the top text label
|
||||
GtkWidget *msg0 = gtk_label_new(mMsg0);
|
||||
gtk_misc_set_alignment(GTK_MISC(msg0), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(mBox), msg0, FALSE, FALSE, 12);
|
||||
|
||||
// for each setup type, pack into the vbox:
|
||||
// an hbox containing: (this is to pad the radio button on the right)
|
||||
// the radio button with short description
|
||||
// a label with the long description
|
||||
|
||||
numSetupTypes = GetNumSetupTypes();
|
||||
currST = GetSetupTypeList();
|
||||
|
||||
for (int i = 0; i < numSetupTypes; ++i, currST = currST->GetNext()) {
|
||||
if (i == 0) {
|
||||
radbtn = gtk_radio_button_new_with_mnemonic(NULL,
|
||||
currST->GetDescShort());
|
||||
mRadioGroup = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radbtn));
|
||||
} else {
|
||||
radbtn = gtk_radio_button_new_with_mnemonic(mRadioGroup,
|
||||
currST->GetDescShort());
|
||||
}
|
||||
|
||||
|
||||
GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), radbtn, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(mBox), hbox, FALSE, FALSE, 6);
|
||||
|
||||
GtkWidget *desc = gtk_label_new(currST->GetDescLong());
|
||||
gtk_label_set_line_wrap(GTK_LABEL(desc), TRUE);
|
||||
gtk_misc_set_alignment(GTK_MISC(desc), 0.0, 0.5);
|
||||
|
||||
// Pad the labels so that they line up with the radio button text
|
||||
gint ind_size, ind_spacing;
|
||||
gtk_widget_style_get(radbtn,
|
||||
"indicator_size", &ind_size,
|
||||
"indicator_spacing", &ind_spacing,
|
||||
NULL);
|
||||
|
||||
gtk_misc_set_padding(GTK_MISC(desc), ind_size + ind_spacing * 3, 0);
|
||||
gtk_box_pack_start(GTK_BOX(mBox), desc, FALSE, FALSE, 6);
|
||||
}
|
||||
|
||||
|
||||
frame = gtk_frame_new(gCtx->Res("DEST_DIR"));
|
||||
gtk_box_pack_start(GTK_BOX(mBox), frame, FALSE, FALSE, 12);
|
||||
|
||||
GtkWidget *frame_hbox = gtk_hbox_new(FALSE, 6);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(frame_hbox), 6);
|
||||
gtk_container_add(GTK_CONTAINER(frame), frame_hbox);
|
||||
|
||||
if (!gCtx->opt->mDestination) {
|
||||
gCtx->opt->mDestination = (char*)malloc(MAXPATHLEN * sizeof(char));
|
||||
getcwd(gCtx->opt->mDestination, MAXPATHLEN);
|
||||
}
|
||||
|
||||
sFolder = gtk_label_new(gCtx->opt->mDestination);
|
||||
gtk_label_set_line_wrap(GTK_LABEL(sFolder), TRUE);
|
||||
gtk_misc_set_alignment(GTK_MISC(sFolder), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(frame_hbox), sFolder, TRUE, TRUE, 0);
|
||||
|
||||
sBrowseBtn = gtk_button_new_with_label(gCtx->Res("BROWSE"));
|
||||
gtk_box_pack_start(GTK_BOX(frame_hbox), sBrowseBtn, FALSE, FALSE, 0);
|
||||
|
||||
mWidgetsInit = TRUE;
|
||||
} else {
|
||||
gtk_notebook_set_page(GTK_NOTEBOOK(gCtx->notebook), mPageNum);
|
||||
}
|
||||
|
||||
// <b>title</b>\0
|
||||
char *titleBuf = new char[strlen(mTitle) + 9];
|
||||
sprintf(titleBuf, "<b>%s</b>", mTitle);
|
||||
|
||||
gtk_label_set_markup(GTK_LABEL(gCtx->header_title), titleBuf);
|
||||
gtk_label_set_text(GTK_LABEL(gCtx->header_subtitle), mSubTitle);
|
||||
|
||||
delete[] titleBuf;
|
||||
|
||||
gtk_widget_show_all(mBox);
|
||||
|
||||
// signal connect the buttons
|
||||
// NOTE: back button disfunctional in this dlg since user accepted license
|
||||
gCtx->backID = gtk_signal_connect(GTK_OBJECT(gCtx->back), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsSetupTypeDlg::Back), gCtx->sdlg);
|
||||
gCtx->nextID = gtk_signal_connect(GTK_OBJECT(gCtx->next), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsSetupTypeDlg::Next), gCtx->sdlg);
|
||||
sBrowseBtnID = gtk_signal_connect(GTK_OBJECT(sBrowseBtn), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsSetupTypeDlg::SelectFolder), NULL);
|
||||
|
||||
if (aDirection == nsXInstallerDlg::FORWARD_MOVE)
|
||||
{
|
||||
// change the button titles back to Back/Next
|
||||
gtk_button_set_label(GTK_BUTTON(gCtx->next), GTK_STOCK_GO_FORWARD);
|
||||
gtk_button_set_label(GTK_BUTTON(gCtx->back), GTK_STOCK_GO_BACK);
|
||||
}
|
||||
// from install dlg
|
||||
if (aDirection == nsXInstallerDlg::BACKWARD_MOVE &&
|
||||
// not custom setup type
|
||||
gCtx->opt->mSetupType != (gCtx->sdlg->GetNumSetupTypes() - 1))
|
||||
{
|
||||
DUMP("Back from Install to Setup Type");
|
||||
gtk_button_set_label(GTK_BUTTON(gCtx->next), GTK_STOCK_GO_FORWARD);
|
||||
}
|
||||
|
||||
gtk_widget_set_sensitive(gCtx->back, FALSE);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::Hide(int aDirection)
|
||||
{
|
||||
// gtk_widget_hide(mTable);
|
||||
gtk_widget_hide(mBox);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::SetMsg0(char *aMsg)
|
||||
{
|
||||
if (!aMsg)
|
||||
return E_PARAM;
|
||||
|
||||
mMsg0 = aMsg;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsSetupTypeDlg::GetMsg0()
|
||||
{
|
||||
if (mMsg0)
|
||||
return mMsg0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::AddSetupType(nsSetupType *aSetupType)
|
||||
{
|
||||
if (!aSetupType)
|
||||
return E_PARAM;
|
||||
|
||||
if (!mSetupTypeList)
|
||||
{
|
||||
mSetupTypeList = aSetupType;
|
||||
return OK;
|
||||
}
|
||||
|
||||
nsSetupType *curr = mSetupTypeList;
|
||||
nsSetupType *next;
|
||||
while (curr)
|
||||
{
|
||||
next = NULL;
|
||||
next = curr->GetNext();
|
||||
|
||||
if (!next)
|
||||
{
|
||||
return curr->SetNext(aSetupType);
|
||||
}
|
||||
|
||||
curr = next;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
nsSetupType *
|
||||
nsSetupTypeDlg::GetSetupTypeList()
|
||||
{
|
||||
if (mSetupTypeList)
|
||||
return mSetupTypeList;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::GetNumSetupTypes()
|
||||
{
|
||||
int num = 0;
|
||||
nsSetupType *curr = NULL;
|
||||
|
||||
if (!mSetupTypeList)
|
||||
return 0;
|
||||
|
||||
curr = mSetupTypeList;
|
||||
while(curr)
|
||||
{
|
||||
num++;
|
||||
curr = curr->GetNext();
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
nsSetupType *
|
||||
nsSetupTypeDlg::GetSelectedSetupType()
|
||||
{
|
||||
nsSetupType *curr = NULL;
|
||||
int numSetupTypes = GetNumSetupTypes();
|
||||
int setupTypeCount = 0;
|
||||
|
||||
curr = GetSetupTypeList();
|
||||
while (curr && setupTypeCount < numSetupTypes) // paranoia!
|
||||
{
|
||||
if (setupTypeCount == gCtx->opt->mSetupType)
|
||||
return curr;
|
||||
|
||||
setupTypeCount++;
|
||||
curr = curr->GetNext();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
nsSetupTypeDlg::FreeSetupTypeList()
|
||||
{
|
||||
nsSetupType *curr = mSetupTypeList;
|
||||
nsSetupType *prev;
|
||||
|
||||
while (curr)
|
||||
{
|
||||
prev = curr;
|
||||
curr = curr->GetNext();
|
||||
|
||||
XI_IF_DELETE(prev);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsSetupTypeDlg::SelectFolder(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("SelectFolder");
|
||||
|
||||
if (sFilePickerUp)
|
||||
return;
|
||||
|
||||
GtkWidget *fileSel = NULL;
|
||||
char *selDir = gCtx->opt->mDestination;
|
||||
|
||||
fileSel = gtk_file_selection_new(gCtx->Res("SELECT_DIR"));
|
||||
gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileSel), selDir);
|
||||
gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fileSel)->ok_button),
|
||||
"clicked", (GtkSignalFunc) SelectFolderOK, fileSel);
|
||||
gtk_signal_connect_object(GTK_OBJECT(
|
||||
GTK_FILE_SELECTION(fileSel)->cancel_button),
|
||||
"clicked", (GtkSignalFunc) SelectFolderCancel,
|
||||
GTK_OBJECT(fileSel));
|
||||
gtk_widget_show(fileSel);
|
||||
sFilePickerUp = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
nsSetupTypeDlg::SelectFolderOK(GtkWidget *aWidget, GtkFileSelection *aFileSel)
|
||||
{
|
||||
DUMP("SelectFolderOK");
|
||||
|
||||
struct stat destStat;
|
||||
const gchar *selDir =
|
||||
gtk_file_selection_get_filename(GTK_FILE_SELECTION(aFileSel));
|
||||
|
||||
// put the candidate file name in the global variable, then verify it
|
||||
|
||||
strcpy(gCtx->opt->mDestination, selDir);
|
||||
|
||||
if (0 == stat(selDir, &destStat))
|
||||
if (!S_ISDIR(destStat.st_mode) || VerifyDestination() != OK ) /* not a directory, or we don't have access permissions, so don't tear down */
|
||||
return;
|
||||
|
||||
// update folder path displayed
|
||||
gtk_label_set_text(GTK_LABEL(sFolder), gCtx->opt->mDestination);
|
||||
gtk_widget_show(sFolder);
|
||||
|
||||
// tear down file sel dlg
|
||||
gtk_object_destroy(GTK_OBJECT(aFileSel));
|
||||
sFilePickerUp = FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nsSetupTypeDlg::SelectFolderCancel(GtkWidget *aWidget,
|
||||
GtkFileSelection *aFileSel)
|
||||
{
|
||||
// tear down file sel dlg
|
||||
gtk_object_destroy(GTK_OBJECT(aWidget));
|
||||
gtk_object_destroy(GTK_OBJECT(aFileSel));
|
||||
sFilePickerUp = FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::VerifyDestination()
|
||||
{
|
||||
int stat_err = 0;
|
||||
struct stat stbuf;
|
||||
|
||||
stat_err = stat(gCtx->opt->mDestination, &stbuf);
|
||||
if (stat_err == 0)
|
||||
{
|
||||
if (access(gCtx->opt->mDestination, R_OK | W_OK | X_OK ) != 0)
|
||||
{
|
||||
GtkWidget *noPermsDlg =
|
||||
gtk_message_dialog_new(GTK_WINDOW(gCtx->window),
|
||||
GtkDialogFlags(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
gCtx->Res("NO_PERMS"),
|
||||
gCtx->opt->mDestination);
|
||||
|
||||
gtk_dialog_run(GTK_DIALOG(noPermsDlg));
|
||||
gtk_widget_destroy(noPermsDlg);
|
||||
|
||||
return E_NO_PERMS;
|
||||
}
|
||||
else
|
||||
{
|
||||
// perms OK, we can proceed
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
|
||||
// destination doesn't exist so ask user if we should create it
|
||||
GtkWidget *createDestDlg =
|
||||
gtk_message_dialog_new(GTK_WINDOW(gCtx->window),
|
||||
GtkDialogFlags(GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT),
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_YES_NO,
|
||||
gCtx->Res("DOESNT_EXIST"),
|
||||
gCtx->opt->mDestination);
|
||||
|
||||
gint result = gtk_dialog_run(GTK_DIALOG(createDestDlg));
|
||||
gtk_widget_destroy(createDestDlg);
|
||||
|
||||
if (result == GTK_RESPONSE_YES) {
|
||||
// Create the destination directory.
|
||||
char path[PATH_MAX + 1];
|
||||
int pathLen = strlen(gCtx->opt->mDestination);
|
||||
int dirErr = 0;
|
||||
|
||||
if (pathLen > PATH_MAX)
|
||||
pathLen = PATH_MAX;
|
||||
memcpy(path, gCtx->opt->mDestination, pathLen);
|
||||
path[pathLen] = '/'; // for uniform handling
|
||||
|
||||
struct stat buf;
|
||||
mode_t oldPerms = umask(022);
|
||||
|
||||
for (int i = 1; !dirErr && i <= pathLen; i++) {
|
||||
if (path[i] == '/') {
|
||||
path[i] = '\0';
|
||||
if (stat(path, &buf) != 0) {
|
||||
dirErr = mkdir(path, (0777 & ~oldPerms));
|
||||
}
|
||||
path[i] = '/';
|
||||
}
|
||||
}
|
||||
|
||||
umask(oldPerms); // restore original umask
|
||||
if (dirErr != 0)
|
||||
ErrorHandler(E_MKDIR_FAIL);
|
||||
else
|
||||
return OK;
|
||||
}
|
||||
|
||||
return E_NO_DEST;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::DeleteOldInst()
|
||||
{
|
||||
DUMP("DeleteOldInst");
|
||||
|
||||
int err = OK;
|
||||
struct stat dummy;
|
||||
char path[MAXPATHLEN];
|
||||
|
||||
memset(path, 0, MAXPATHLEN);
|
||||
ConstructPath(path, gCtx->opt->mDestination, gCtx->opt->mProgramName);
|
||||
|
||||
DUMP(path);
|
||||
|
||||
// check if old installation exists
|
||||
if (0 == stat(path, &dummy)) {
|
||||
// throw up delete dialog
|
||||
GtkWidget *delInstDlg =
|
||||
gtk_message_dialog_new(GTK_WINDOW(gCtx->window),
|
||||
GtkDialogFlags(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_NONE,
|
||||
gCtx->sdlg->mExistingMsg,
|
||||
gCtx->opt->mDestination);
|
||||
|
||||
gtk_dialog_add_buttons(GTK_DIALOG(delInstDlg),
|
||||
GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
|
||||
|
||||
gint result = gtk_dialog_run(GTK_DIALOG(delInstDlg));
|
||||
if (result == GTK_RESPONSE_ACCEPT) {
|
||||
// Delete the old installation
|
||||
char cwd[MAXPATHLEN];
|
||||
getcwd(cwd, MAXPATHLEN);
|
||||
chdir(gCtx->opt->mDestination);
|
||||
system("rm -rf *");
|
||||
chdir(cwd);
|
||||
err = OK;
|
||||
} else {
|
||||
err = E_OLD_INST;
|
||||
}
|
||||
|
||||
gtk_widget_destroy(delInstDlg);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::ConstructPath(char *aDest, char *aTrunk, char *aLeaf)
|
||||
{
|
||||
int err = OK;
|
||||
int trunkLen;
|
||||
char *lastSlash = NULL;
|
||||
|
||||
if (!aDest || !aTrunk || !aLeaf)
|
||||
return E_PARAM;
|
||||
|
||||
trunkLen = strlen(aTrunk);
|
||||
lastSlash = strrchr(aTrunk, '/');
|
||||
|
||||
strcpy(aDest, aTrunk);
|
||||
if (lastSlash != aTrunk + (trunkLen - 1))
|
||||
{
|
||||
// need to tack on a slash
|
||||
strcat(aDest, "/");
|
||||
}
|
||||
strcat(aDest, aLeaf);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::VerifyDiskSpace(void)
|
||||
{
|
||||
int err = OK;
|
||||
int dsAvail, dsReqd;
|
||||
char dsAvailStr[128], dsReqdStr[128];
|
||||
char message[512];
|
||||
GtkWidget *noDSDlg, *label;
|
||||
|
||||
// find disk space available at destination
|
||||
dsAvail = DSAvailable();
|
||||
if (dsAvail < 0)
|
||||
return OK; // optimistic when statfs failed
|
||||
// or we don't have statfs
|
||||
|
||||
// get disk space required
|
||||
dsReqd = DSRequired();
|
||||
|
||||
if (dsReqd > dsAvail)
|
||||
{
|
||||
// throw up not enough ds dlg
|
||||
sprintf(dsAvailStr, gCtx->Res("DS_AVAIL"), dsAvail);
|
||||
sprintf(dsReqdStr, gCtx->Res("DS_REQD"), dsReqd);
|
||||
sprintf(message, "%s\n%s\n\n%s", dsAvailStr, dsReqdStr,
|
||||
gCtx->Res("NO_DISK_SPACE"));
|
||||
|
||||
noDSDlg = gtk_dialog_new_with_buttons(gCtx->opt->mTitle,
|
||||
NULL, (GtkDialogFlags) 0,
|
||||
GTK_STOCK_OK,
|
||||
GTK_RESPONSE_NONE,
|
||||
NULL);
|
||||
label = gtk_label_new(message);
|
||||
|
||||
g_signal_connect_swapped(GTK_OBJECT(noDSDlg), "response",
|
||||
G_CALLBACK(NoDiskSpaceOK),
|
||||
GTK_OBJECT(noDSDlg));
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(noDSDlg)->vbox), label);
|
||||
gtk_widget_show_all(noDSDlg);
|
||||
err = E_NO_DISK_SPACE;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::DSAvailable(void)
|
||||
{
|
||||
// returns disk space available in kilobytes
|
||||
|
||||
int dsAvail = -1;
|
||||
|
||||
#if defined(HAVE_SYS_STATVFS_H) || defined(HAVE_SYS_STATFS_H)
|
||||
struct STATFS buf;
|
||||
int rv;
|
||||
|
||||
if (gCtx->opt->mDestination)
|
||||
{
|
||||
rv = STATFS(gCtx->opt->mDestination, &buf);
|
||||
if (rv == 0)
|
||||
{
|
||||
if (buf.f_bsize > 1024 && (buf.f_bsize%1024 == 0))
|
||||
{
|
||||
// normally the block size is >= 1024 and a multiple
|
||||
// so we can shave off the last three digits before
|
||||
// finding the product of the block size and num blocks
|
||||
// which is important for large disks
|
||||
|
||||
dsAvail = (buf.f_bsize/1024) * (buf.f_bavail);
|
||||
}
|
||||
else
|
||||
{
|
||||
// attempt to stuff into a 32 bit int even though
|
||||
// we convert from bytes -> kilobytes later
|
||||
// (may fail to compute on very large disks whose
|
||||
// block size is not a multiple of 1024 -- highly
|
||||
// improbable)
|
||||
|
||||
dsAvail = (buf.f_bsize * buf.f_bavail)/1024;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // HAVE_SYS_STATVFS_H -or- HAVE_SYS_STATFS_H
|
||||
|
||||
return dsAvail;
|
||||
}
|
||||
|
||||
int
|
||||
nsSetupTypeDlg::DSRequired(void)
|
||||
{
|
||||
// returns disk space required in kilobytes
|
||||
|
||||
int dsReqd = 0;
|
||||
nsComponentList *comps;
|
||||
int bCus;
|
||||
|
||||
// find setup type's component list
|
||||
bCus = (gCtx->opt->mSetupType == (gCtx->sdlg->GetNumSetupTypes() - 1));
|
||||
comps = gCtx->sdlg->GetSelectedSetupType()->GetComponents();
|
||||
|
||||
// loop through all components
|
||||
nsComponent *currComp = comps->GetHead();
|
||||
while (currComp)
|
||||
{
|
||||
if ( (bCus == TRUE && currComp->IsSelected()) || (bCus == FALSE) )
|
||||
{
|
||||
// add to disk space required
|
||||
dsReqd += currComp->GetInstallSize();
|
||||
dsReqd += currComp->GetArchiveSize();
|
||||
}
|
||||
|
||||
currComp = currComp->GetNext();
|
||||
}
|
||||
|
||||
return dsReqd;
|
||||
}
|
||||
|
||||
void
|
||||
nsSetupTypeDlg::NoDiskSpaceOK(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
GtkWidget *noDSDlg = (GtkWidget *) aData;
|
||||
|
||||
if (!noDSDlg)
|
||||
return;
|
||||
|
||||
gtk_widget_destroy(noDSDlg);
|
||||
}
|
||||
|
||||
@ -1,101 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_SETUPTYPEDLG_H_
|
||||
#define _NS_SETUPTYPEDLG_H_
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include "nsXInstallerDlg.h"
|
||||
#include "nsSetupType.h"
|
||||
|
||||
class nsComponent;
|
||||
|
||||
class nsSetupTypeDlg : public nsXInstallerDlg
|
||||
{
|
||||
public:
|
||||
nsSetupTypeDlg();
|
||||
~nsSetupTypeDlg();
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* Navigation
|
||||
*---------------------------------------------------------------------*/
|
||||
static void Back(GtkWidget *aWidget, gpointer aData);
|
||||
static void Next(GtkWidget *aWidget, gpointer aData);
|
||||
|
||||
int Parse(nsINIParser *aParser);
|
||||
|
||||
int Show(int aDirection);
|
||||
int Hide(int aDirection);
|
||||
|
||||
static void SelectFolder(GtkWidget *aWidget, gpointer aData);
|
||||
static void SelectFolderOK(GtkWidget *aWidget,
|
||||
GtkFileSelection *aFileSel);
|
||||
static void SelectFolderCancel(GtkWidget *aWidget,
|
||||
GtkFileSelection *aFileSel);
|
||||
static int VerifyDestination();
|
||||
static int DeleteOldInst();
|
||||
static int ConstructPath(char *aDest, char *aTrunk, char *aLeaf);
|
||||
static int VerifyDiskSpace();
|
||||
static int DSAvailable();
|
||||
static int DSRequired();
|
||||
static void NoDiskSpaceOK(GtkWidget *aWidget, gpointer aData);
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* INI Properties
|
||||
*---------------------------------------------------------------------*/
|
||||
int SetMsg0(char *aMsg);
|
||||
char *GetMsg0();
|
||||
|
||||
int AddSetupType(nsSetupType *aSetupType);
|
||||
nsSetupType *GetSetupTypeList();
|
||||
int GetNumSetupTypes();
|
||||
nsSetupType *GetSelectedSetupType();
|
||||
|
||||
private:
|
||||
void FreeSetupTypeList();
|
||||
nsComponent* ParseComponent(nsINIParser *aParser, char *aCompName);
|
||||
|
||||
GtkWidget *mBox;
|
||||
char *mExistingMsg;
|
||||
char *mMsg0;
|
||||
nsSetupType *mSetupTypeList;
|
||||
GSList *mRadioGroup;
|
||||
};
|
||||
|
||||
#endif /* _NS_SETUPTYPEDLG_H_ */
|
||||
@ -1,281 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
* Brian Ryner <bryner@brianryner.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsWelcomeDlg.h"
|
||||
#include "nsXInstaller.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
const int nsWelcomeDlg::kMsgCount;
|
||||
|
||||
nsWelcomeDlg::nsWelcomeDlg()
|
||||
: mTitle(NULL), mWelcomeMsg(NULL), mPixmap(NULL), mBox(NULL)
|
||||
{
|
||||
memset(mMsgs, 0, sizeof(mMsgs));
|
||||
}
|
||||
|
||||
nsWelcomeDlg::~nsWelcomeDlg()
|
||||
{
|
||||
XI_IF_FREE(mPixmap);
|
||||
for (int i = 0; i < kMsgCount; ++i)
|
||||
XI_IF_FREE(mMsgs[i]);
|
||||
|
||||
XI_IF_FREE(mWelcomeMsg);
|
||||
XI_IF_FREE(mTitle);
|
||||
}
|
||||
|
||||
void
|
||||
nsWelcomeDlg::Back(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Back");
|
||||
if (aData != gCtx->wdlg) return;
|
||||
}
|
||||
|
||||
void
|
||||
nsWelcomeDlg::Next(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
DUMP("Next");
|
||||
if (aData != gCtx->wdlg) return;
|
||||
|
||||
// hide this notebook page
|
||||
gCtx->wdlg->Hide(nsXInstallerDlg::FORWARD_MOVE);
|
||||
|
||||
// disconnect this dlg's nav btn signal handlers
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->back), gCtx->backID);
|
||||
gtk_signal_disconnect(GTK_OBJECT(gCtx->next), gCtx->nextID);
|
||||
|
||||
// show the next dlg
|
||||
gCtx->ldlg->Show(nsXInstallerDlg::FORWARD_MOVE);
|
||||
}
|
||||
|
||||
int
|
||||
nsWelcomeDlg::Parse(nsINIParser *aParser)
|
||||
{
|
||||
int bufsize = 0;
|
||||
char *showDlg = NULL;
|
||||
char msgName[] = "Message0";
|
||||
char *tmp;
|
||||
|
||||
/* optional keys */
|
||||
bufsize = 5;
|
||||
aParser->GetStringAlloc(DLG_WELCOME, SHOW_DLG, &showDlg, &bufsize);
|
||||
if (bufsize != 0 && showDlg) {
|
||||
if (strncmp(showDlg, "TRUE", 4) == 0)
|
||||
mShowDlg = nsXInstallerDlg::SHOW_DIALOG;
|
||||
else if (strncmp(showDlg, "FALSE", 5) == 0)
|
||||
mShowDlg = nsXInstallerDlg::SKIP_DIALOG;
|
||||
}
|
||||
|
||||
bufsize = 0;
|
||||
aParser->GetStringAlloc(DLG_WELCOME, TITLE, &mTitle, &bufsize);
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mTitle);
|
||||
|
||||
bufsize = 0;
|
||||
aParser->GetStringAlloc(DLG_WELCOME, WATERMARK, &mPixmap, &bufsize);
|
||||
if (bufsize == 0)
|
||||
XI_IF_FREE(mPixmap);
|
||||
|
||||
bufsize = 0;
|
||||
aParser->GetStringAlloc(DLG_WELCOME, MSGWELCOME, &tmp, &bufsize);
|
||||
if (bufsize == 0) {
|
||||
XI_IF_FREE(tmp);
|
||||
} else {
|
||||
mWelcomeMsg = g_strdup_printf(tmp, gCtx->opt->mProductName);
|
||||
}
|
||||
|
||||
for (int i = 0; i < kMsgCount; ++i) {
|
||||
bufsize = 0;
|
||||
msgName[7] = (char)(i + 48); // ASCII 48 == 0
|
||||
aParser->GetStringAlloc(DLG_WELCOME, msgName, &tmp, &bufsize);
|
||||
if (bufsize == 0) {
|
||||
XI_IF_FREE(tmp);
|
||||
} else {
|
||||
mMsgs[i] = g_strdup_printf(tmp, gCtx->opt->mProductName);
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsWelcomeDlg::Show(int aDirection)
|
||||
{
|
||||
int err = 0;
|
||||
int msgLength = 0;
|
||||
char *msgText, *textPos;
|
||||
|
||||
XI_VERIFY(gCtx);
|
||||
XI_VERIFY(gCtx->notebook);
|
||||
|
||||
if (mWidgetsInit == FALSE) {
|
||||
// static widget init
|
||||
|
||||
// Note our page number in the wizard.
|
||||
mPageNum = gtk_notebook_get_current_page(GTK_NOTEBOOK(gCtx->notebook));
|
||||
|
||||
// Set up the window title
|
||||
gtk_window_set_title(GTK_WINDOW(gCtx->window), mTitle);
|
||||
|
||||
mBox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(gCtx->notebook), mBox, NULL);
|
||||
|
||||
GtkWidget *wmbox = gtk_event_box_new();
|
||||
if (mPixmap) {
|
||||
GdkPixbuf *pb = gdk_pixbuf_new_from_file(mPixmap, NULL);
|
||||
if (pb) {
|
||||
GdkPixmap *pm = NULL;
|
||||
gdk_pixbuf_render_pixmap_and_mask(pb, &pm, NULL, 0);
|
||||
if (pm) {
|
||||
GtkStyle *newStyle = gtk_style_copy(gtk_widget_get_style(wmbox));
|
||||
newStyle->bg_pixmap[GTK_STATE_NORMAL] = pm;
|
||||
gtk_widget_set_style(wmbox, newStyle);
|
||||
|
||||
// newStyle now owns the pixmap, so we don't unref it.
|
||||
g_object_unref(newStyle);
|
||||
|
||||
// Make the watermark box the width of the pixmap.
|
||||
gint width, height;
|
||||
gdk_drawable_get_size(pm, &width, &height);
|
||||
gtk_widget_set_size_request(wmbox, width, -1);
|
||||
}
|
||||
|
||||
// We're done with rendering the pixbuf, so we can destroy it.
|
||||
gdk_pixbuf_unref(pb);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(mBox), wmbox, FALSE, FALSE, 0);
|
||||
|
||||
wmbox = gtk_event_box_new();
|
||||
gtk_box_pack_start_defaults(GTK_BOX(mBox), wmbox);
|
||||
|
||||
GtkWidget *inner_hbox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(wmbox), inner_hbox);
|
||||
|
||||
GtkWidget *spacer = gtk_alignment_new(0, 0, 0, 0);
|
||||
gtk_widget_set_size_request(spacer, 5, -1);
|
||||
gtk_box_pack_start(GTK_BOX(inner_hbox), spacer, FALSE, FALSE, 0);
|
||||
|
||||
GtkWidget *vbox = gtk_vbox_new(FALSE, 8);
|
||||
gtk_box_pack_start(GTK_BOX(inner_hbox), vbox, FALSE, FALSE, 0);
|
||||
|
||||
for (int i = 0; i < kMsgCount - 1; ++i)
|
||||
msgLength += strlen(mMsgs[i]);
|
||||
|
||||
#define kSpanBegin "<span weight=\"bold\" size=\"larger\">"
|
||||
#define kSpanEnd "</span>\n\n"
|
||||
|
||||
msgLength += strlen(kSpanBegin) + strlen(mWelcomeMsg) + strlen(kSpanEnd);
|
||||
msgText = (char*) malloc(msgLength + (kMsgCount - 1) * 2 + 1);
|
||||
|
||||
textPos = msgText;
|
||||
|
||||
textPos += sprintf(textPos, kSpanBegin "%s" kSpanEnd, mWelcomeMsg);
|
||||
|
||||
for (int i = 0; i < kMsgCount - 1; ++i)
|
||||
textPos += sprintf(textPos, "%s\n\n", mMsgs[i]);
|
||||
|
||||
GtkWidget *msg = gtk_label_new(NULL);
|
||||
gtk_label_set_markup(GTK_LABEL(msg), msgText);
|
||||
gtk_label_set_line_wrap(GTK_LABEL(msg), TRUE);
|
||||
gtk_misc_set_alignment(GTK_MISC(msg), 0.0, 0.5);
|
||||
|
||||
GdkColor black_col = { 0, 0, 0, 0 };
|
||||
GdkColor white_col = { 0, 65535, 65535, 65535 };
|
||||
|
||||
gtk_widget_modify_text(msg, GTK_STATE_NORMAL, &black_col);
|
||||
gtk_widget_modify_bg(wmbox, GTK_STATE_NORMAL, &white_col);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(vbox), msg, FALSE, FALSE, 0);
|
||||
gtk_container_child_set(GTK_CONTAINER(vbox), msg, "padding", 5, NULL);
|
||||
|
||||
free(msgText);
|
||||
|
||||
// Now add 100px of padding, and then the last message.
|
||||
spacer = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
|
||||
gtk_widget_set_size_request(spacer, -1, 110);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), spacer, FALSE, FALSE, 0);
|
||||
|
||||
msgText = (char*) malloc(strlen(mMsgs[kMsgCount - 1]) + 2);
|
||||
sprintf(msgText, "%s\n", mMsgs[kMsgCount - 1]);
|
||||
|
||||
msg = gtk_label_new(msgText);
|
||||
gtk_widget_modify_text(msg, GTK_STATE_NORMAL, &black_col);
|
||||
gtk_misc_set_alignment(GTK_MISC(msg), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), msg, FALSE, FALSE, 0);
|
||||
gtk_container_child_set(GTK_CONTAINER(vbox), msg, "padding", 5, NULL);
|
||||
|
||||
free(msgText);
|
||||
|
||||
mWidgetsInit = TRUE;
|
||||
} else {
|
||||
gtk_notebook_set_page(GTK_NOTEBOOK(gCtx->notebook), mPageNum);
|
||||
}
|
||||
|
||||
// No header image for the welcome dialog
|
||||
gtk_widget_set_usize(gCtx->header, 0, 0);
|
||||
|
||||
gtk_widget_show_all(mBox);
|
||||
|
||||
// signal connect the buttons
|
||||
gCtx->backID = gtk_signal_connect(GTK_OBJECT(gCtx->back), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsWelcomeDlg::Back),
|
||||
gCtx->wdlg);
|
||||
gCtx->nextID = gtk_signal_connect(GTK_OBJECT(gCtx->next), "clicked",
|
||||
GTK_SIGNAL_FUNC(nsWelcomeDlg::Next),
|
||||
gCtx->wdlg);
|
||||
|
||||
gtk_widget_set_sensitive(gCtx->back, FALSE);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS(gCtx->next, GTK_CAN_DEFAULT);
|
||||
gtk_widget_grab_default(gCtx->next);
|
||||
gtk_widget_grab_focus(gCtx->next);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsWelcomeDlg::Hide(int aDirection)
|
||||
{
|
||||
// hide all this dlg's widgets
|
||||
gtk_widget_hide(mBox);
|
||||
|
||||
return OK;
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_WELCOMEDLG_H_
|
||||
#define _NS_WELCOMEDLG_H_
|
||||
|
||||
#include "nsXInstallerDlg.h"
|
||||
#include "XIErrors.h"
|
||||
|
||||
class nsWelcomeDlg : public nsXInstallerDlg
|
||||
{
|
||||
public:
|
||||
nsWelcomeDlg();
|
||||
~nsWelcomeDlg();
|
||||
|
||||
/*--------------------------------------------------------------------*
|
||||
* Navigation
|
||||
*--------------------------------------------------------------------*/
|
||||
static void Back(GtkWidget *aWidget, gpointer aData);
|
||||
static void Next(GtkWidget *aWidget, gpointer aData);
|
||||
|
||||
int Parse(nsINIParser *aParser);
|
||||
|
||||
int Show(int aDirection);
|
||||
int Hide(int aDirection);
|
||||
|
||||
private:
|
||||
// Number of text messages in the dialog, which must be <= 10.
|
||||
// The last message is displayed at the bottom of the dialog,
|
||||
// next to the navigation buttons.
|
||||
|
||||
static const int kMsgCount = 4;
|
||||
|
||||
char *mTitle;
|
||||
char *mMsgs[kMsgCount];
|
||||
char *mWelcomeMsg;
|
||||
char *mPixmap;
|
||||
|
||||
GtkWidget *mBox;
|
||||
};
|
||||
|
||||
#endif /* _NS_WELCOMEDLG_H_ */
|
||||
@ -1,305 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsXIContext.h"
|
||||
|
||||
#define __EOT__ "EndOfTable"
|
||||
|
||||
nsXIContext::nsXIContext()
|
||||
{
|
||||
me = NULL;
|
||||
|
||||
ldlg = NULL;
|
||||
wdlg = NULL;
|
||||
sdlg = NULL;
|
||||
cdlg = NULL;
|
||||
idlg = NULL;
|
||||
|
||||
opt = new nsXIOptions();
|
||||
|
||||
window = NULL;
|
||||
back = NULL;
|
||||
next = NULL;
|
||||
cancel = NULL;
|
||||
nextLabel = NULL;
|
||||
backLabel = NULL;
|
||||
acceptLabel = NULL;
|
||||
declineLabel = NULL;
|
||||
installLabel = NULL;
|
||||
logo = NULL;
|
||||
notebook = NULL;
|
||||
header = NULL;
|
||||
|
||||
backID = 0;
|
||||
nextID = 0;
|
||||
cancelID = 0;
|
||||
bDone = FALSE;
|
||||
|
||||
reslist = NULL;
|
||||
}
|
||||
|
||||
nsXIContext::~nsXIContext()
|
||||
{
|
||||
// NOTE: don't try to delete "me" cause I control thee
|
||||
|
||||
ReleaseResources();
|
||||
|
||||
XI_IF_DELETE(ldlg);
|
||||
XI_IF_DELETE(wdlg);
|
||||
XI_IF_DELETE(sdlg);
|
||||
XI_IF_DELETE(cdlg);
|
||||
XI_IF_DELETE(idlg);
|
||||
|
||||
XI_IF_DELETE(opt);
|
||||
}
|
||||
|
||||
char *
|
||||
nsXIContext::itoa(int n)
|
||||
{
|
||||
char *s;
|
||||
int i, j, sign, tmp;
|
||||
|
||||
/* check sign and convert to positive to stringify numbers */
|
||||
if ( (sign = n) < 0)
|
||||
n = -n;
|
||||
i = 0;
|
||||
s = (char*) malloc(sizeof(char));
|
||||
|
||||
/* grow string as needed to add numbers from powers of 10
|
||||
* down till none left
|
||||
*/
|
||||
do
|
||||
{
|
||||
s = (char*) realloc(s, (i+1)*sizeof(char));
|
||||
s[i++] = n % 10 + '0'; /* '0' or 30 is where ASCII numbers start */
|
||||
s[i] = '\0';
|
||||
}
|
||||
while( (n /= 10) > 0);
|
||||
|
||||
/* tack on minus sign if we found earlier that this was negative */
|
||||
if (sign < 0)
|
||||
{
|
||||
s = (char*) realloc(s, (i+1)*sizeof(char));
|
||||
s[i++] = '-';
|
||||
}
|
||||
s[i] = '\0';
|
||||
|
||||
/* pop numbers (and sign) off of string to push back into right direction */
|
||||
for (i = 0, j = strlen(s) - 1; i < j; i++, j--)
|
||||
{
|
||||
tmp = s[i];
|
||||
s[i] = s[j];
|
||||
s[j] = tmp;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
#define MAX_KEY_SIZE 64
|
||||
#define FIRST_ERR -601
|
||||
#define LAST_ERR -625
|
||||
int
|
||||
nsXIContext::LoadResources()
|
||||
{
|
||||
int err = OK;
|
||||
nsINIParser *parser = NULL;
|
||||
char *resfile = NULL;
|
||||
kvpair *currkv = NULL;
|
||||
char currkey[MAX_KEY_SIZE];
|
||||
int len, i;
|
||||
|
||||
resfile = nsINIParser::ResolveName(RES_FILE);
|
||||
if (!resfile)
|
||||
return E_INVALID_PTR;
|
||||
|
||||
parser = new nsINIParser(resfile);
|
||||
if (!parser)
|
||||
{
|
||||
XI_IF_FREE(resfile);
|
||||
return E_MEM;
|
||||
}
|
||||
|
||||
char *strkeys[] =
|
||||
{
|
||||
"NEXT",
|
||||
"BACK",
|
||||
"CANCEL",
|
||||
"ACCEPT",
|
||||
"DECLINE",
|
||||
"INSTALL",
|
||||
"PAUSE",
|
||||
"RESUME",
|
||||
"DEFAULT_TITLE",
|
||||
"DEST_DIR",
|
||||
"BROWSE",
|
||||
"SELECT_DIR",
|
||||
"DOESNT_EXIST",
|
||||
"YES_LABEL",
|
||||
"NO_LABEL",
|
||||
"OK_LABEL",
|
||||
"DELETE_LABEL",
|
||||
"CANCEL_LABEL",
|
||||
"ERROR",
|
||||
"FATAL_ERROR",
|
||||
"DESCRIPTION",
|
||||
"WILL_INSTALL",
|
||||
"TO_LOCATION",
|
||||
"PREPARING",
|
||||
"EXTRACTING",
|
||||
"INSTALLING_XPI",
|
||||
"PROCESSING_FILE",
|
||||
"NO_PERMS",
|
||||
"DL_SETTINGS",
|
||||
"SAVE_MODULES",
|
||||
"PROXY_SETTINGS",
|
||||
"PS_LABEL0",
|
||||
"PS_LABEL1",
|
||||
"PS_LABEL2",
|
||||
"PS_LABEL3",
|
||||
"ERROR_TITLE",
|
||||
"DS_AVAIL",
|
||||
"DS_REQD",
|
||||
"NO_DISK_SPACE",
|
||||
"CXN_DROPPED",
|
||||
"DOWNLOADING",
|
||||
"FROM",
|
||||
"TO",
|
||||
"STATUS",
|
||||
"DL_STATUS_STR",
|
||||
"CRC_FAILED",
|
||||
"CRC_CHECK",
|
||||
"USAGE_MSG",
|
||||
"UNKNOWN",
|
||||
|
||||
__EOT__
|
||||
};
|
||||
|
||||
/* read in UI strings */
|
||||
currkv = (kvpair *) malloc(sizeof(kvpair));
|
||||
reslist = currkv;
|
||||
for (i = 0; strcmp(strkeys[i], __EOT__) != 0; i++)
|
||||
{
|
||||
err = parser->GetStringAlloc(RES_SECT, strkeys[i],
|
||||
&(currkv->val), &len);
|
||||
if (err != OK)
|
||||
goto BAIL;
|
||||
|
||||
currkv->key = strdup(strkeys[i]);
|
||||
currkv->next = (kvpair *) malloc(sizeof(kvpair));
|
||||
currkv = currkv->next;
|
||||
|
||||
if (i > 1024) /* inf loop prevention paranoia */
|
||||
break;
|
||||
}
|
||||
currkv->next = NULL; /* seal off list */
|
||||
|
||||
/* read in err strings */
|
||||
for (i = FIRST_ERR; i >= LAST_ERR; i--)
|
||||
{
|
||||
sprintf(currkey, "%d", i);
|
||||
err = parser->GetStringAlloc(RES_SECT, currkey, &(currkv->val), &len);
|
||||
if (err != OK)
|
||||
goto BAIL;
|
||||
|
||||
currkv->key = strdup(currkey);
|
||||
if (i == LAST_ERR)
|
||||
break;
|
||||
currkv->next = (kvpair *) malloc(sizeof(kvpair));
|
||||
currkv = currkv->next;
|
||||
}
|
||||
currkv->next = NULL; /* seal off list */
|
||||
|
||||
BAIL:
|
||||
if (err != OK)
|
||||
{
|
||||
fprintf(stderr, "FATAL ERROR: Failed to load resources!\n");
|
||||
}
|
||||
XI_IF_FREE(resfile);
|
||||
XI_IF_DELETE(parser);
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsXIContext::ReleaseResources()
|
||||
{
|
||||
int err = OK;
|
||||
kvpair *currkv = NULL, *delkv = NULL;
|
||||
|
||||
/* empty list -- should never really happen */
|
||||
if (!reslist)
|
||||
return E_PARAM;
|
||||
|
||||
currkv = reslist;
|
||||
while (currkv)
|
||||
{
|
||||
XI_IF_FREE(currkv->key);
|
||||
XI_IF_FREE(currkv->val);
|
||||
delkv = currkv;
|
||||
currkv = currkv->next;
|
||||
XI_IF_FREE(delkv);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
char *
|
||||
nsXIContext::Res(char *aKey)
|
||||
{
|
||||
char *val = NULL;
|
||||
kvpair *currkv = NULL;
|
||||
|
||||
/* param check */
|
||||
if (!aKey || !reslist)
|
||||
return NULL;
|
||||
|
||||
/* search through linked list */
|
||||
currkv = reslist;
|
||||
while (currkv)
|
||||
{
|
||||
if (strcmp(aKey, currkv->key) == 0)
|
||||
{
|
||||
val = currkv->val;
|
||||
break;
|
||||
}
|
||||
currkv = currkv->next;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -1,120 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_XICONTEXT_H_
|
||||
#define _NS_XICONTEXT_H_
|
||||
|
||||
#include "nsLicenseDlg.h"
|
||||
#include "nsWelcomeDlg.h"
|
||||
#include "nsSetupTypeDlg.h"
|
||||
#include "nsComponentsDlg.h"
|
||||
#include "nsInstallDlg.h"
|
||||
#include "nsXIOptions.h"
|
||||
#include "nsINIParser.h"
|
||||
|
||||
#define RES_FILE "install"
|
||||
#define RES_SECT "String Resources"
|
||||
|
||||
class nsXInstaller;
|
||||
|
||||
typedef struct _kvpair
|
||||
{
|
||||
char *key;
|
||||
char *val;
|
||||
|
||||
struct _kvpair *next;
|
||||
} kvpair;
|
||||
|
||||
class nsXIContext
|
||||
{
|
||||
public:
|
||||
nsXIContext();
|
||||
~nsXIContext();
|
||||
|
||||
nsXInstaller *me;
|
||||
|
||||
/*-------------------------------------------------------------------*
|
||||
* Dialog Contexts
|
||||
*-------------------------------------------------------------------*/
|
||||
nsLicenseDlg *ldlg;
|
||||
nsWelcomeDlg *wdlg;
|
||||
nsSetupTypeDlg *sdlg;
|
||||
nsComponentsDlg *cdlg;
|
||||
nsInstallDlg *idlg;
|
||||
|
||||
nsXIOptions *opt;
|
||||
|
||||
/*-------------------------------------------------------------------*
|
||||
* Global Widgets
|
||||
*-------------------------------------------------------------------*/
|
||||
GtkWidget *window; /* unique canvas for dialogs */
|
||||
GtkWidget *back; /* back button */
|
||||
GtkWidget *next; /* next button */
|
||||
GtkWidget *cancel; /* cancel button */
|
||||
GtkWidget *nextLabel; /* "Next" label */
|
||||
GtkWidget *backLabel; /* "Back" label */
|
||||
GtkWidget *acceptLabel; /* "Accept" label */
|
||||
GtkWidget *declineLabel; /* "Decline" label */
|
||||
GtkWidget *installLabel; /* "Install" label */
|
||||
GtkWidget *logo; /* branding icon: an xpm image */
|
||||
GtkWidget *mainbox; /* vbox holding all except logo */
|
||||
GtkWidget *notebook; /* notebook whose pages are dlgs */
|
||||
GtkWidget *header; /* header area (with bg image) */
|
||||
GtkWidget *header_title; /* title label in header */
|
||||
GtkWidget *header_subtitle; /* subtitle label in header */
|
||||
|
||||
int backID; /* signal handler id for back btn */
|
||||
int nextID; /* signal handler id for next btn */
|
||||
int cancelID; /* signal handler id for cancel btn */
|
||||
int bDone; /* engine thread sets boolean when done
|
||||
so that ui/main thread can exit */
|
||||
|
||||
/*-------------------------------------------------------------------*
|
||||
* Utilities
|
||||
*-------------------------------------------------------------------*/
|
||||
char *itoa(int n);
|
||||
int LoadResources(); /* load string resources */
|
||||
int ReleaseResources(); /* release alloc'd resource strings */
|
||||
char *Res(char *aKey); /* get string resource for key; NULL==err */
|
||||
|
||||
private:
|
||||
kvpair *reslist; /* string resource linked list */
|
||||
};
|
||||
|
||||
#endif /* _NS_XICONTEXT_H_ */
|
||||
@ -1,146 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_XIENGINE_H_
|
||||
#define _NS_XIENGINE_H_
|
||||
|
||||
#include "XIDefines.h"
|
||||
#include "nsXInstaller.h"
|
||||
#include "nsComponent.h"
|
||||
#include "nsComponentList.h"
|
||||
#include "nsInstallDlg.h"
|
||||
#include "nsZipExtractor.h"
|
||||
|
||||
#include "xpistub.h"
|
||||
|
||||
#define STANDALONE 1
|
||||
#include "zipfile.h"
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* XPI Stub Glue
|
||||
*------------------------------------------------------------------------*/
|
||||
typedef nsresult (*pfnXPI_Init)
|
||||
(const char *aProgramDir, const char *aLogName,
|
||||
pfnXPIProgress progressCB);
|
||||
typedef nsresult (*pfnXPI_Install)
|
||||
(const char *file, const char *args, long flags);
|
||||
typedef void (*pfnXPI_Exit)();
|
||||
|
||||
typedef struct _xpistub_t
|
||||
{
|
||||
const char *name;
|
||||
void *handle;
|
||||
pfnXPI_Init fn_init;
|
||||
pfnXPI_Install fn_install;
|
||||
pfnXPI_Exit fn_exit;
|
||||
} xpistub_t;
|
||||
|
||||
#define TYPE_UNDEF 0
|
||||
#define TYPE_PROXY 1
|
||||
#define TYPE_HTTP 2
|
||||
#define TYPE_FTP 3
|
||||
|
||||
typedef struct _conn
|
||||
{
|
||||
unsigned char type; // TYPE_UNDEF, etc.
|
||||
char *URL; // URL this connection is for
|
||||
void *conn; // pointer to open connection
|
||||
} CONN;
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* nsXIEngine
|
||||
*------------------------------------------------------------------------*/
|
||||
class nsXIEngine
|
||||
{
|
||||
public:
|
||||
nsXIEngine();
|
||||
~nsXIEngine();
|
||||
|
||||
int Download(int aCustom, nsComponentList *aComps);
|
||||
int Extract(nsComponent *aXPIEngine);
|
||||
int Install(int aCustom, nsComponentList *aComps, char *aDestination);
|
||||
int DeleteXPIs(int aCustom, nsComponentList *aComps);
|
||||
|
||||
static void ProgressCallback(const char* aMsg, PRInt32 aVal, PRInt32 aMax);
|
||||
static int ExistAllXPIs(int aCustom, nsComponentList *aComps, int *aTotal);
|
||||
|
||||
enum
|
||||
{
|
||||
OK = 0,
|
||||
E_PARAM = -1201,
|
||||
E_MEM = -1202,
|
||||
E_OPEN_MKR = -1203,
|
||||
E_WRITE_MKR = -1204,
|
||||
E_READ_MKR = -1205,
|
||||
E_FIND_COMP = -1206,
|
||||
E_STAT = -1207
|
||||
};
|
||||
|
||||
private:
|
||||
int MakeUniqueTmpDir();
|
||||
int ParseURL(char *aURL, char **aHost, char **aDir);
|
||||
int LoadXPIStub(xpistub_t *aStub, char *aDestionation);
|
||||
int InstallXPI(nsComponent *aComp, xpistub_t *aStub);
|
||||
int UnloadXPIStub(xpistub_t *aStub);
|
||||
int GetFileSize(char *aPath);
|
||||
int SetDLMarker(char *aCompName);
|
||||
int GetDLMarkedComp(nsComponentList *aComps, int aCustom,
|
||||
nsComponent **aOutComp, int *aOutCompNum);
|
||||
int DelDLMarker();
|
||||
int TotalToDownload(int aCustom, nsComponentList *aComps);
|
||||
PRBool CRCCheckDownloadedArchives(char *dlPath, short dlPathLen,
|
||||
nsComponent *currComp, int count, int aCustom);
|
||||
PRBool IsArchiveFile(char *path);
|
||||
int VerifyArchive(char *szArchive);
|
||||
PRBool CheckConn( char *URL, int type, CONN *myConn, PRBool force );
|
||||
char *mTmp;
|
||||
int mTotalComps;
|
||||
char *mOriginalDir;
|
||||
};
|
||||
|
||||
#endif /* _NS_XIENGINE_H_ */
|
||||
@ -1,67 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsXIOptions.h"
|
||||
|
||||
nsXIOptions::nsXIOptions() :
|
||||
mTitle(NULL),
|
||||
mDestination(NULL),
|
||||
mProductName(NULL),
|
||||
mHeaderPixmap(NULL),
|
||||
mProgramName(NULL),
|
||||
mSetupType(0),
|
||||
mMode(MODE_DEFAULT),
|
||||
mShouldRunApps(TRUE),
|
||||
mProxyHost(NULL),
|
||||
mProxyPort(NULL),
|
||||
mProxyUser(NULL),
|
||||
mProxyPswd(NULL),
|
||||
mSaveModules(FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
nsXIOptions::~nsXIOptions()
|
||||
{
|
||||
XI_IF_FREE(mTitle);
|
||||
XI_IF_FREE(mDestination);
|
||||
XI_IF_FREE(mProxyHost);
|
||||
XI_IF_FREE(mProxyPort);
|
||||
XI_IF_FREE(mProxyUser);
|
||||
XI_IF_FREE(mProxyPswd);
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_XIOPTIONS_H_
|
||||
#define _NS_XIOPTIONS_H_
|
||||
|
||||
#include "XIDefines.h"
|
||||
|
||||
class nsXIOptions
|
||||
{
|
||||
public:
|
||||
nsXIOptions();
|
||||
~nsXIOptions();
|
||||
|
||||
char *mTitle;
|
||||
char *mDestination;
|
||||
char *mProductName;
|
||||
char *mHeaderPixmap;
|
||||
char *mProgramName;
|
||||
int mSetupType;
|
||||
int mMode;
|
||||
int mShouldRunApps;
|
||||
|
||||
enum
|
||||
{
|
||||
MODE_DEFAULT = 0,
|
||||
MODE_AUTO,
|
||||
MODE_SILENT
|
||||
};
|
||||
|
||||
char *mProxyHost;
|
||||
char *mProxyPort;
|
||||
char *mProxyUser;
|
||||
char *mProxyPswd;
|
||||
|
||||
int mSaveModules;
|
||||
};
|
||||
|
||||
#endif /* _NS_XIOPTIONS_H_ */
|
||||
@ -1,532 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
* Brian Ryner <bryner@brianryner.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsXInstaller.h"
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
nsXIContext *gCtx = NULL;
|
||||
static GtkWidget *sErrDlg = NULL;
|
||||
|
||||
nsXInstaller::nsXInstaller()
|
||||
{
|
||||
}
|
||||
|
||||
nsXInstaller::~nsXInstaller()
|
||||
{
|
||||
XI_IF_DELETE(gCtx);
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstaller::ParseArgs(int aArgc, char **aArgv)
|
||||
{
|
||||
if (aArgc <= 0 || !aArgv)
|
||||
return E_PARAM;
|
||||
|
||||
for (int argNum = 1; argNum < aArgc; ++argNum) {
|
||||
/* Print usage */
|
||||
if (strcmp(aArgv[argNum], "-h") == 0 ||
|
||||
strcmp(aArgv[argNum], "--help") == 0) {
|
||||
|
||||
if (gCtx->Res("USAGE_MSG"))
|
||||
fprintf (stderr, gCtx->Res("USAGE_MSG"), aArgv[0], "\n",
|
||||
"\n", "\n", "\n", "\n", "\n", "\n", "\n");
|
||||
return E_USAGE_SHOWN;
|
||||
}
|
||||
|
||||
/*
|
||||
* mode: auto (show progress UI but assume defaults
|
||||
* without user intervention)
|
||||
*/
|
||||
else if (strcmp(aArgv[argNum], "-ma") == 0) {
|
||||
gCtx->opt->mMode = nsXIOptions::MODE_AUTO;
|
||||
}
|
||||
|
||||
/*
|
||||
* mode: silent (show no UI and have no user intervention)
|
||||
*/
|
||||
else if (strcmp(aArgv[argNum], "-ms") == 0) {
|
||||
gCtx->opt->mMode = nsXIOptions::MODE_SILENT;
|
||||
}
|
||||
|
||||
/*
|
||||
* ignore [RunAppX] sections
|
||||
*/
|
||||
else if (strcmp(aArgv[argNum], "-ira") == 0) {
|
||||
gCtx->opt->mShouldRunApps = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstaller::ParseConfig()
|
||||
{
|
||||
int err = OK;
|
||||
nsINIParser *parser = NULL;
|
||||
char *cfg = NULL;
|
||||
|
||||
XI_ERR_BAIL(InitContext());
|
||||
err = gCtx->LoadResources();
|
||||
if (err != OK)
|
||||
return err;
|
||||
|
||||
cfg = nsINIParser::ResolveName(CONFIG);
|
||||
if (!cfg)
|
||||
return E_INVALID_PTR;
|
||||
|
||||
parser = new nsINIParser(cfg);
|
||||
if (!parser) {
|
||||
err = E_MEM;
|
||||
goto BAIL;
|
||||
}
|
||||
|
||||
err = parser->GetError();
|
||||
if (err != nsINIParser::OK)
|
||||
return err;
|
||||
|
||||
XI_ERR_BAIL(ParseGeneral(parser));
|
||||
XI_ERR_BAIL(gCtx->ldlg->Parse(parser));
|
||||
XI_ERR_BAIL(gCtx->wdlg->Parse(parser));
|
||||
//XI_ERR_BAIL(gCtx->cdlg->Parse(parser)); // components before setup type
|
||||
XI_ERR_BAIL(gCtx->sdlg->Parse(parser));
|
||||
XI_ERR_BAIL(gCtx->idlg->Parse(parser));
|
||||
|
||||
BAIL:
|
||||
XI_IF_FREE(cfg);
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstaller::InitContext()
|
||||
{
|
||||
int err = OK;
|
||||
|
||||
gCtx = new nsXIContext();
|
||||
if (!gCtx)
|
||||
return E_MEM;
|
||||
|
||||
gCtx->me = this;
|
||||
|
||||
gCtx->ldlg = new nsLicenseDlg();
|
||||
gCtx->wdlg = new nsWelcomeDlg();
|
||||
gCtx->sdlg = new nsSetupTypeDlg();
|
||||
gCtx->cdlg = new nsComponentsDlg();
|
||||
gCtx->idlg = new nsInstallDlg();
|
||||
|
||||
if (!(gCtx->ldlg && gCtx->wdlg && gCtx->sdlg && gCtx->cdlg && gCtx->idlg)) {
|
||||
err = E_MEM;
|
||||
goto BAIL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
|
||||
BAIL:
|
||||
XI_IF_DELETE(gCtx->ldlg);
|
||||
XI_IF_DELETE(gCtx->wdlg);
|
||||
XI_IF_DELETE(gCtx->sdlg);
|
||||
XI_IF_DELETE(gCtx->cdlg);
|
||||
XI_IF_DELETE(gCtx->idlg);
|
||||
XI_IF_DELETE(gCtx);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstaller::RunWizard(int argc, char **argv)
|
||||
{
|
||||
int err = OK;
|
||||
|
||||
XI_VERIFY(gCtx);
|
||||
|
||||
// create the dialog window
|
||||
if (gCtx->opt->mMode != nsXIOptions::MODE_SILENT) {
|
||||
gtk_init(&argc, &argv);
|
||||
gCtx->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
XI_VERIFY(gCtx->window);
|
||||
|
||||
gtk_window_set_position(GTK_WINDOW(gCtx->window), GTK_WIN_POS_CENTER);
|
||||
gtk_signal_connect(GTK_OBJECT(gCtx->window), "delete_event",
|
||||
GTK_SIGNAL_FUNC(Kill), NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(gCtx->window), "key_press_event",
|
||||
GTK_SIGNAL_FUNC(HandleKeyPress), NULL);
|
||||
|
||||
gtk_window_set_title(GTK_WINDOW(gCtx->window), gCtx->opt->mTitle);
|
||||
|
||||
SetupBoxes();
|
||||
|
||||
// create an area for the header image.
|
||||
// this will remain 0-height until the user advances past
|
||||
// the welcome dialog.
|
||||
|
||||
gCtx->header = gtk_event_box_new();
|
||||
if (gCtx->opt->mHeaderPixmap) {
|
||||
GdkPixbuf *pb = gdk_pixbuf_new_from_file(gCtx->opt->mHeaderPixmap, NULL);
|
||||
if (pb) {
|
||||
GdkPixmap *pm = NULL;
|
||||
gdk_pixbuf_render_pixmap_and_mask(pb, &pm, NULL, 0);
|
||||
if (pm) {
|
||||
GtkStyle *newStyle =
|
||||
gtk_style_copy(gtk_widget_get_style(gCtx->header));
|
||||
|
||||
newStyle->bg_pixmap[GTK_STATE_NORMAL] = pm;
|
||||
gtk_widget_set_style(gCtx->header, newStyle);
|
||||
|
||||
// newStyle now owns the pixmap, so we don't unref it.
|
||||
g_object_unref(newStyle);
|
||||
|
||||
// Make the initial window width be as wide as the header.
|
||||
gint width, height;
|
||||
gdk_drawable_get_size(pm, &width, &height);
|
||||
gtk_window_set_default_size(GTK_WINDOW(gCtx->window), width, -1);
|
||||
}
|
||||
|
||||
// We're done with rendering the pixbuf, so destroy it.
|
||||
gdk_pixbuf_unref(pb);
|
||||
}
|
||||
}
|
||||
|
||||
// The header contains a vbox with two labels
|
||||
GtkWidget *header_vbox = gtk_vbox_new(FALSE, 6);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(header_vbox), 6);
|
||||
|
||||
gCtx->header_title = gtk_label_new(NULL);
|
||||
gtk_misc_set_alignment(GTK_MISC(gCtx->header_title), 0.0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(header_vbox), gCtx->header_title,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
gCtx->header_subtitle = gtk_label_new(NULL);
|
||||
gtk_misc_set_alignment(GTK_MISC(gCtx->header_subtitle), 0.0, 0.5);
|
||||
gtk_misc_set_padding(GTK_MISC(gCtx->header_subtitle), 24, 0);
|
||||
gtk_box_pack_start(GTK_BOX(header_vbox), gCtx->header_subtitle,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(gCtx->header), header_vbox);
|
||||
|
||||
gtk_widget_set_size_request(header_vbox, 0, 0);
|
||||
gtk_box_pack_start(GTK_BOX(gCtx->mainbox), gCtx->header, FALSE, FALSE, 0);
|
||||
|
||||
// create the notebook whose pages are dlgs
|
||||
gCtx->notebook = gtk_notebook_new();
|
||||
XI_VERIFY(gCtx->notebook);
|
||||
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gCtx->notebook), FALSE);
|
||||
gtk_notebook_set_show_border(GTK_NOTEBOOK(gCtx->notebook), FALSE);
|
||||
gtk_notebook_set_scrollable(GTK_NOTEBOOK(gCtx->notebook), FALSE);
|
||||
gtk_widget_show(gCtx->notebook);
|
||||
gtk_box_pack_start(GTK_BOX(gCtx->mainbox), gCtx->notebook, TRUE, TRUE, 0);
|
||||
|
||||
// create and display the nav buttons
|
||||
XI_ERR_BAIL(DrawNavButtons());
|
||||
}
|
||||
|
||||
if (gCtx->opt->mMode == nsXIOptions::MODE_DEFAULT) {
|
||||
// show welcome dlg
|
||||
gCtx->wdlg->Show(nsXInstallerDlg::FORWARD_MOVE);
|
||||
gtk_widget_show(gCtx->window);
|
||||
|
||||
// pop over to main event loop
|
||||
gtk_main();
|
||||
} else {
|
||||
// show install dlg
|
||||
if (gCtx->opt->mMode == nsXIOptions::MODE_AUTO)
|
||||
gCtx->idlg->Show(nsXInstallerDlg::FORWARD_MOVE);
|
||||
|
||||
gCtx->idlg->Next((GtkWidget *)NULL, (gpointer) gCtx->idlg);
|
||||
}
|
||||
|
||||
return OK;
|
||||
|
||||
BAIL:
|
||||
return err;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nsXInstaller::HandleKeyPress(GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (event->keyval == GDK_Escape) {
|
||||
gtk_main_quit();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint
|
||||
nsXInstaller::Kill(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||
{
|
||||
gtk_main_quit();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nsXInstaller::SetupBoxes()
|
||||
{
|
||||
GtkWidget *mainbox = gtk_vbox_new(FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(gCtx->window), mainbox);
|
||||
|
||||
gtk_widget_show(mainbox);
|
||||
gCtx->mainbox = mainbox; /* mainbox = canvas + nav btns' box */
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstaller::DrawNavButtons()
|
||||
{
|
||||
int err = OK;
|
||||
|
||||
GtkWidget *navbtnhbox;
|
||||
GtkWidget *navbtntable;
|
||||
|
||||
XI_VERIFY(gCtx->mainbox);
|
||||
|
||||
gCtx->next = gtk_button_new_from_stock(GTK_STOCK_GO_FORWARD);
|
||||
gCtx->back = gtk_button_new_from_stock(GTK_STOCK_GO_BACK);
|
||||
gCtx->cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
|
||||
|
||||
gCtx->nextLabel = gtk_label_new(gCtx->Res("NEXT"));
|
||||
gCtx->backLabel = gtk_label_new(gCtx->Res("BACK"));
|
||||
XI_VERIFY(gCtx->next);
|
||||
XI_VERIFY(gCtx->back);
|
||||
XI_VERIFY(gCtx->cancel);
|
||||
|
||||
gCtx->cancelID = gtk_signal_connect(GTK_OBJECT(gCtx->cancel), "clicked",
|
||||
GTK_SIGNAL_FUNC(Kill), NULL);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS(gCtx->next, GTK_CAN_DEFAULT);
|
||||
|
||||
navbtnhbox = gtk_hbox_new(TRUE, 10);
|
||||
GtkWidget *separator = gtk_hseparator_new();
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(gCtx->mainbox), separator, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(gCtx->mainbox), navbtnhbox, FALSE, FALSE, 0);
|
||||
|
||||
// put a table in the nav btn box
|
||||
navbtntable = gtk_table_new(1, 5, TRUE);
|
||||
gtk_box_pack_start(GTK_BOX(navbtnhbox), navbtntable, TRUE, TRUE, 0);
|
||||
|
||||
gtk_table_attach(GTK_TABLE(navbtntable), gCtx->cancel, 2, 3, 0, 1,
|
||||
static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
|
||||
static_cast<GtkAttachOptions>(GTK_SHRINK),
|
||||
5, 5);
|
||||
|
||||
gtk_table_attach(GTK_TABLE(navbtntable), gCtx->back, 3, 4, 0, 1,
|
||||
static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
|
||||
static_cast<GtkAttachOptions>(GTK_SHRINK),
|
||||
5, 5);
|
||||
gtk_table_attach(GTK_TABLE(navbtntable), gCtx->next, 4, 5, 0, 1,
|
||||
static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
|
||||
static_cast<GtkAttachOptions>(GTK_SHRINK),
|
||||
5, 5);
|
||||
|
||||
gtk_widget_show_all(gCtx->mainbox);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstaller::ParseGeneral(nsINIParser *aParser)
|
||||
{
|
||||
int err = OK, size = 0;
|
||||
char *buf = NULL;
|
||||
|
||||
/* optional: main program name. if this file exists in the destination
|
||||
directory, the user will be prompted to remove the directory or choose
|
||||
a different directory. */
|
||||
|
||||
err = aParser->GetStringAlloc(GENERAL, PROGRAM_NAME, &buf, &size);
|
||||
if (err == OK && size > 0) {
|
||||
gCtx->opt->mProgramName = buf;
|
||||
}
|
||||
|
||||
/* optional: destination directory can be specified in config.ini */
|
||||
err = aParser->GetStringAlloc(GENERAL, DEFAULT_LOCATION, &buf, &size);
|
||||
if (err == OK && size > 0) {
|
||||
/* malloc MAXPATHLEN for consistency in behavior if destination
|
||||
* directory is not specified in the config.ini
|
||||
*/
|
||||
gCtx->opt->mDestination = (char *)malloc(MAXPATHLEN * sizeof(char));
|
||||
strncpy(gCtx->opt->mDestination, buf, size);
|
||||
XI_IF_FREE(buf);
|
||||
} else {
|
||||
err = OK; /* optional so no error if we didn't find it */
|
||||
}
|
||||
|
||||
/* optional: installer app window title */
|
||||
size = 0;
|
||||
buf = NULL;
|
||||
err = aParser->GetStringAlloc(GENERAL, TITLE, &buf, &size);
|
||||
if (err == OK && size > 0) {
|
||||
gCtx->opt->mTitle = buf;
|
||||
} else {
|
||||
err = OK; /* optional so no error if we didn't find it */
|
||||
gCtx->opt->mTitle = strdup(gCtx->Res("DEFAULT_TITLE"));
|
||||
}
|
||||
|
||||
/* optional: product name (substituted for %s elsewhere) */
|
||||
size = 0;
|
||||
buf = NULL;
|
||||
err = aParser->GetStringAlloc(GENERAL, PRODUCT_NAME, &buf, &size);
|
||||
if (err == OK && size > 0)
|
||||
gCtx->opt->mProductName = buf;
|
||||
else
|
||||
err = OK;
|
||||
|
||||
/* optional: header image */
|
||||
size = 0;
|
||||
buf = NULL;
|
||||
err = aParser->GetStringAlloc(GENERAL, HEADER_IMAGE, &buf, &size);
|
||||
if (err == OK && size > 0)
|
||||
gCtx->opt->mHeaderPixmap = buf;
|
||||
else
|
||||
err = OK;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int err = OK;
|
||||
nsXInstaller *installer = new nsXInstaller();
|
||||
if (!installer) {
|
||||
err = E_MEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((err = installer->ParseConfig()) != OK)
|
||||
goto out;
|
||||
|
||||
if ((err = installer->ParseArgs(argc, argv)) != OK)
|
||||
goto out;
|
||||
|
||||
err = installer->RunWizard(argc, argv);
|
||||
|
||||
out:
|
||||
XI_IF_DELETE(installer);
|
||||
_exit(err);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*
|
||||
* Default Error Handler
|
||||
*------------------------------------------------------------------*/
|
||||
int
|
||||
ErrorHandler(int aErr, const char* aErrMsg)
|
||||
{
|
||||
GtkWidget *okButton, *label;
|
||||
char msg[256];
|
||||
char newmsg[256];
|
||||
char errStr[16];
|
||||
|
||||
sprintf(errStr, "%d", aErr);
|
||||
if (!IsErrFatal(aErr)) {
|
||||
if (aErr == E_INSTALL && aErrMsg) {
|
||||
sprintf(newmsg, gCtx->Res(errStr), aErrMsg);
|
||||
sprintf(msg, gCtx->Res("ERROR"), aErr, newmsg);
|
||||
} else {
|
||||
sprintf(msg, gCtx->Res("ERROR"), aErr, gCtx->Res(errStr));
|
||||
}
|
||||
} else {
|
||||
sprintf(msg, gCtx->Res("FATAL_ERROR"), aErr, gCtx->Res(errStr));
|
||||
}
|
||||
|
||||
// lack of gCtx->window indicates we have not yet run RunWizard
|
||||
// and gtk_init
|
||||
if (gCtx->opt->mMode == nsXIOptions::MODE_SILENT || !gCtx->window) {
|
||||
fprintf (stderr, "%s\n", msg);
|
||||
return aErr;
|
||||
}
|
||||
|
||||
sErrDlg = gtk_dialog_new();
|
||||
gtk_window_set_title(GTK_WINDOW(sErrDlg), gCtx->Res("ERROR_TITLE"));
|
||||
okButton = gtk_button_new_with_label(gCtx->Res("OK_LABEL"));
|
||||
label = gtk_label_new(msg);
|
||||
|
||||
gtk_window_set_position(GTK_WINDOW(sErrDlg), GTK_WIN_POS_CENTER);
|
||||
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(sErrDlg)->action_area), okButton);
|
||||
gtk_signal_connect(GTK_OBJECT(okButton), "clicked",
|
||||
GTK_SIGNAL_FUNC(ErrDlgOK), (void*)aErr);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(sErrDlg)->vbox), label);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS(okButton, GTK_CAN_DEFAULT);
|
||||
gtk_widget_grab_default(okButton);
|
||||
gtk_widget_show_all(sErrDlg);
|
||||
|
||||
gtk_main();
|
||||
|
||||
return aErr;
|
||||
}
|
||||
|
||||
void
|
||||
ErrDlgOK(GtkWidget *aWidget, gpointer aData)
|
||||
{
|
||||
int err = NS_PTR_TO_INT32(aData);
|
||||
|
||||
if (sErrDlg) {
|
||||
gtk_widget_destroy(sErrDlg);
|
||||
sErrDlg = NULL;
|
||||
}
|
||||
|
||||
gtk_main_quit();
|
||||
|
||||
if (IsErrFatal(err))
|
||||
exit(err);
|
||||
}
|
||||
|
||||
int
|
||||
IsErrFatal(int aErr)
|
||||
{
|
||||
int bFatal = TRUE;
|
||||
|
||||
/* non-fatal errors */
|
||||
switch (aErr) {
|
||||
case -620:
|
||||
case -621:
|
||||
case -624:
|
||||
case -625:
|
||||
bFatal = FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return bFatal;
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_XINSTALLER_H_
|
||||
#define _NS_XINSTALLER_H_
|
||||
|
||||
#include "XIDefines.h"
|
||||
#include "XIErrors.h"
|
||||
|
||||
#include "nsINIParser.h"
|
||||
#include "nsLicenseDlg.h"
|
||||
#include "nsXIContext.h"
|
||||
|
||||
extern nsXIContext *gCtx;
|
||||
|
||||
class nsXInstaller
|
||||
{
|
||||
public:
|
||||
nsXInstaller();
|
||||
~nsXInstaller();
|
||||
|
||||
int ParseArgs(int aArgc, char **aArgv);
|
||||
int ParseConfig();
|
||||
int RunWizard(int argc, char **argv);
|
||||
int ParseGeneral(nsINIParser *aParser);
|
||||
|
||||
static gint Kill(GtkWidget *widget, GdkEvent *event, gpointer data);
|
||||
|
||||
private:
|
||||
static gboolean HandleKeyPress(GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer data);
|
||||
|
||||
int InitContext();
|
||||
void SetupBoxes();
|
||||
int DrawNavButtons();
|
||||
};
|
||||
|
||||
int main(int argc, char **argv);
|
||||
int ErrorHandler(int aErr, const char *aErrMsg=NULL);
|
||||
void ErrDlgOK(GtkWidget *aWidget, gpointer aData);
|
||||
int IsErrFatal(int aErr);
|
||||
|
||||
#define CONFIG "config"
|
||||
|
||||
#if defined(DUMP)
|
||||
#undef DUMP
|
||||
#endif
|
||||
#if defined(DEBUG_sgehani) || defined(DEBUG_druidd) || defined(DEBUG_root)
|
||||
#define DUMP(_msg) printf("%s %d: %s \n", __FILE__, __LINE__, _msg);
|
||||
#else
|
||||
#define DUMP(_msg)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*_NS_XINSTALLER_H_ */
|
||||
@ -1,93 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsXInstallerDlg.h"
|
||||
|
||||
nsXInstallerDlg::nsXInstallerDlg() :
|
||||
mShowDlg(nsXInstallerDlg::SHOW_DIALOG),
|
||||
mTitle(NULL),
|
||||
mSubTitle(NULL),
|
||||
mWidgetsInit((int)FALSE),
|
||||
mTable(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsXInstallerDlg::~nsXInstallerDlg()
|
||||
{
|
||||
if (mTitle)
|
||||
free (mTitle);
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstallerDlg::SetShowDlg(int aShowDlg)
|
||||
{
|
||||
if ( aShowDlg != nsXInstallerDlg::SHOW_DIALOG &&
|
||||
aShowDlg != nsXInstallerDlg::SKIP_DIALOG )
|
||||
return E_PARAM;
|
||||
|
||||
mShowDlg = aShowDlg;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstallerDlg::GetShowDlg()
|
||||
{
|
||||
return mShowDlg;
|
||||
}
|
||||
|
||||
int
|
||||
nsXInstallerDlg::SetTitle(char *aTitle)
|
||||
{
|
||||
if (!aTitle)
|
||||
return E_PARAM;
|
||||
|
||||
mTitle = aTitle;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
char *
|
||||
nsXInstallerDlg::GetTitle()
|
||||
{
|
||||
if (mTitle)
|
||||
return mTitle;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -1,103 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_XINSTALLERDLG_H_
|
||||
#define _NS_XINSTALLERDLG_H_
|
||||
|
||||
#include <malloc.h>
|
||||
#include "XIErrors.h"
|
||||
#include "XIDefines.h"
|
||||
|
||||
#include "nsINIParser.h"
|
||||
|
||||
/**
|
||||
* nsXInstallerDlg
|
||||
*
|
||||
* The interface for all installer dialogs. Helps maintain
|
||||
* uniform navigation mechanism, startup init, and UI widgets.
|
||||
*/
|
||||
class nsXInstallerDlg
|
||||
{
|
||||
public:
|
||||
nsXInstallerDlg();
|
||||
virtual ~nsXInstallerDlg();
|
||||
|
||||
/*-------------------------------------------------------------------*
|
||||
* Navigation
|
||||
*-------------------------------------------------------------------*/
|
||||
// NOTE: Please define these static methods too
|
||||
// (static methods can't be virtual)
|
||||
// static void Back(GtkWidget *aWidget, gpointer aData);
|
||||
// static void Next(GtkWidget *aWidget, gpointer aData);
|
||||
|
||||
virtual int Parse(nsINIParser *aParser) = 0;
|
||||
|
||||
virtual int Show(int aDirection) = 0;
|
||||
virtual int Hide(int aDirection) = 0;
|
||||
|
||||
/*-------------------------------------------------------------------*
|
||||
* INI Properties
|
||||
*-------------------------------------------------------------------*/
|
||||
int SetShowDlg(int aShowDlg);
|
||||
int GetShowDlg();
|
||||
int SetTitle(char *aTitle);
|
||||
char *GetTitle();
|
||||
|
||||
void SetPageNum(int aPageNum);
|
||||
int GetPageNum();
|
||||
|
||||
enum
|
||||
{
|
||||
SKIP_DIALOG = 0,
|
||||
SHOW_DIALOG = 1,
|
||||
|
||||
FORWARD_MOVE = 555,
|
||||
BACKWARD_MOVE = -555
|
||||
};
|
||||
|
||||
protected:
|
||||
int mShowDlg;
|
||||
char *mTitle;
|
||||
char *mSubTitle;
|
||||
int mPageNum; // GtkNotebook page number for this dlg
|
||||
int mWidgetsInit; // FALSE until widgets are created (first Show())
|
||||
GtkWidget *mTable;
|
||||
};
|
||||
|
||||
#endif /* _NS_XINSTALLERDLG_H_ */
|
||||
@ -1,188 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsZipExtractor.h"
|
||||
|
||||
#define STANDALONE 1
|
||||
#include "zipstub.h"
|
||||
#include "zipfile.h"
|
||||
|
||||
nsZipExtractor::nsZipExtractor(char *aSrc, char *aDest) :
|
||||
mSrc(NULL),
|
||||
mDest(NULL)
|
||||
{
|
||||
if (aSrc)
|
||||
mSrc = strdup(aSrc);
|
||||
if (aDest)
|
||||
mDest = strdup(aDest);
|
||||
}
|
||||
|
||||
nsZipExtractor::~nsZipExtractor()
|
||||
{
|
||||
XI_IF_FREE(mSrc);
|
||||
XI_IF_FREE(mDest);
|
||||
}
|
||||
|
||||
int
|
||||
nsZipExtractor::Extract(nsComponent *aXPIEngine, int aTotal)
|
||||
{
|
||||
DUMP("Extract");
|
||||
|
||||
char apath[MAXPATHLEN]; /* archive path */
|
||||
char bindir[512];
|
||||
char zpath[MAXPATHLEN]; /* path of file in zip archive */
|
||||
char epath[MAXPATHLEN]; /* path of file after being extracted */
|
||||
char *leaf = NULL, *lslash = NULL;
|
||||
struct stat dummy;
|
||||
int i, bFoundAll = FALSE, err = OK;
|
||||
PRInt32 zerr = ZIP_OK;
|
||||
void *hZip = NULL, *hFind = NULL;
|
||||
|
||||
if (!aXPIEngine || !(aXPIEngine->GetArchive()))
|
||||
return E_PARAM;
|
||||
|
||||
sprintf(apath, "%s/%s", mSrc, aXPIEngine->GetArchive());
|
||||
if (-1 == stat(apath, &dummy))
|
||||
return E_NO_DOWNLOAD;
|
||||
|
||||
/* initialize archive etc.
|
||||
*/
|
||||
zerr = ZIP_OpenArchive(apath, &hZip);
|
||||
if (zerr != ZIP_OK) return E_EXTRACTION;
|
||||
hFind = ZIP_FindInit(hZip, (const char *) NULL);
|
||||
if (!hFind)
|
||||
{
|
||||
err = E_EXTRACTION;
|
||||
goto au_revoir;
|
||||
}
|
||||
|
||||
/* extract files
|
||||
*/
|
||||
i = 0;
|
||||
while (!bFoundAll)
|
||||
{
|
||||
memset(zpath, 0, MAXPATHLEN);
|
||||
zerr = ZIP_FindNext(hFind, zpath, MAXPATHLEN);
|
||||
if (zerr == ZIP_ERR_FNF)
|
||||
{
|
||||
bFoundAll = true;
|
||||
break;
|
||||
}
|
||||
if (zerr != ZIP_OK)
|
||||
{
|
||||
err = E_EXTRACTION;
|
||||
goto au_revoir;
|
||||
}
|
||||
|
||||
/* directory encountered: ignore entry
|
||||
*/
|
||||
lslash = strrchr(zpath, '/');
|
||||
if (lslash == (zpath + strlen(zpath) - 1))
|
||||
continue;
|
||||
|
||||
if (!lslash)
|
||||
leaf = zpath;
|
||||
else
|
||||
leaf = lslash + 1;
|
||||
if (!leaf)
|
||||
continue;
|
||||
|
||||
/* update UI
|
||||
*/
|
||||
if (gCtx->opt->mMode != nsXIOptions::MODE_SILENT)
|
||||
nsInstallDlg::MajorProgressCB(leaf, i,
|
||||
aTotal, nsInstallDlg::ACT_EXTRACT);
|
||||
|
||||
sprintf(epath, "%s/%s", mDest, zpath);
|
||||
err = DirCreateRecursive(epath);
|
||||
if (err != OK) goto au_revoir;
|
||||
|
||||
zerr = ZIP_ExtractFile(hZip, zpath, epath);
|
||||
if (zerr != ZIP_OK)
|
||||
{
|
||||
err = E_EXTRACTION;
|
||||
goto au_revoir;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
sprintf(bindir, "%s/%s", mDest, TMP_EXTRACT_SUBDIR);
|
||||
if (-1 == stat(bindir, &dummy))
|
||||
err = E_EXTRACTION;
|
||||
|
||||
au_revoir:
|
||||
/* close archive etc.
|
||||
*/
|
||||
if (hFind)
|
||||
ZIP_FindFree(hFind);
|
||||
if (hZip)
|
||||
ZIP_CloseArchive(&hZip);
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
nsZipExtractor::DirCreateRecursive(char *aPath)
|
||||
{
|
||||
int err = OK;
|
||||
char *slash = NULL, *pathpos = NULL;
|
||||
char currdir[MAXPATHLEN];
|
||||
struct stat dummy;
|
||||
|
||||
if (!aPath || !mDest)
|
||||
return E_PARAM;
|
||||
|
||||
slash = aPath + strlen(mDest);
|
||||
if (*slash != '/')
|
||||
return E_INVALID_PTR;
|
||||
|
||||
while (slash)
|
||||
{
|
||||
memset(currdir, 0, MAXPATHLEN);
|
||||
strncpy(currdir, aPath, slash - aPath);
|
||||
|
||||
if (-1 == stat(currdir, &dummy))
|
||||
mkdir(currdir, 0755);
|
||||
|
||||
pathpos = slash;
|
||||
slash = strchr(pathpos+1, '/');
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Samir Gehani <sgehani@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _NS_ZIPEXTRACTOR_H_
|
||||
#define _NS_ZIPEXTRACTOR_H_
|
||||
|
||||
#include "XIDefines.h"
|
||||
#include "nsComponent.h"
|
||||
#include "nsXInstaller.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
class nsZipExtractor
|
||||
{
|
||||
public:
|
||||
nsZipExtractor(char *aSrc, char *aDest);
|
||||
~nsZipExtractor();
|
||||
|
||||
int Extract(nsComponent *aXPIEngine, int aTotal);
|
||||
|
||||
private:
|
||||
int DirCreateRecursive(char *aPath);
|
||||
|
||||
char *mSrc;
|
||||
char *mDest;
|
||||
};
|
||||
|
||||
#endif /* _NS_ZIPEXTRACTOR_H_ */
|
||||
@ -1,48 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = wizard
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@ -1,365 +0,0 @@
|
||||
# Windows implementation of platform-specific installer functions:
|
||||
#
|
||||
# BuildPlatformInstaller()
|
||||
|
||||
# Define wizard file locations
|
||||
$exe_suffix = '.exe';
|
||||
@wizard_files = (
|
||||
"setup.exe",
|
||||
"setuprsc.dll"
|
||||
);
|
||||
|
||||
sub BuildPlatformInstaller
|
||||
{
|
||||
# copy the lean installer to stub\ dir
|
||||
print "\n****************************\n";
|
||||
print "* *\n";
|
||||
print "* creating Stub files... *\n";
|
||||
print "* *\n";
|
||||
print "****************************\n";
|
||||
print "\n $gDirDistInstall/stub/$seiFileNameSpecificStub\n";
|
||||
|
||||
# build the self-extracting .exe (installer) file.
|
||||
copy("$gDirDistInstall/$seiFileNameGeneric", "$gDirDistInstall/$seiFileNameSpecificStub") ||
|
||||
die "copy $gDirDistInstall/$seiFileNameGeneric $gDirDistInstall/$seiFileNameSpecificStub: $!\n";
|
||||
|
||||
$origCwd = cwd();
|
||||
chdir($gDirDistInstall);
|
||||
system("./nsztool.exe $seiFileNameSpecificStub setup/*.*") && die "Error creating self-extracting installer";
|
||||
chdir($origCwd);
|
||||
|
||||
if(-d "$gDirDistInstall/stub")
|
||||
{
|
||||
unlink <$gDirDistInstall/stub/*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$gDirDistInstall/stub",0775);
|
||||
}
|
||||
copy("$gDirDistInstall/$seiFileNameSpecificStub", "$gDirDistInstall/stub") ||
|
||||
die "copy $gDirDistInstall/$seiFileNameSpecificStub $gDirDistInstall/stub: $!\n";
|
||||
|
||||
|
||||
# create the xpi for launching the stub installer
|
||||
print "\n************************************\n";
|
||||
print "* *\n";
|
||||
print "* creating stub installer xpi... *\n";
|
||||
print "* *\n";
|
||||
print "************************************\n";
|
||||
print "\n $gDirDistInstall/$seiStubRootName.xpi\n\n";
|
||||
|
||||
if(-d "$gDirStageProduct/$seiStubRootName")
|
||||
{
|
||||
unlink <$gDirStageProduct/$seiStubRootName/*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$gDirStageProduct/$seiStubRootName",0775);
|
||||
}
|
||||
copy("$gDirDistInstall/stub/$seiFileNameSpecificStub", "$gDirStageProduct/$seiStubRootName") ||
|
||||
die "copy $gDirDistInstall/stub/$seiFileNameSpecificStub $gDirStageProduct/$seiStubRootName: $!\n";
|
||||
|
||||
# Make .js files
|
||||
if(MakeJsFile($seiStubRootName))
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
|
||||
# Make .xpi file
|
||||
if(system("perl $gNGAppsScriptsDir/makexpi.pl $seiStubRootName $gDirStageProduct $gDirDistInstall"))
|
||||
{
|
||||
print "\n Error: perl $gNGAppsScriptsDir/makexpi.pl $seiStubRootName $gDirStageProduct $gDirDistInstall\n";
|
||||
return(1);
|
||||
}
|
||||
|
||||
# group files for CD
|
||||
print "\n************************************\n";
|
||||
print "* *\n";
|
||||
print "* creating Compact Disk files... *\n";
|
||||
print "* *\n";
|
||||
print "************************************\n";
|
||||
print "\n $gDirDistInstall/cd\n";
|
||||
|
||||
if(-d "$gDirDistInstall/cd")
|
||||
{
|
||||
unlink <$gDirDistInstall/cd/*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$gDirDistInstall/cd",0775);
|
||||
}
|
||||
|
||||
copy("$gDirDistInstall/$seiFileNameSpecificStub", "$gDirDistInstall/cd") ||
|
||||
die "copy $gDirDistInstall/$seiFileNameSpecificStub $gDirDistInstall/cd: $!\n";
|
||||
|
||||
StageUtils::CopyFiles("$gDirDistInstall/xpi", "$gDirDistInstall/cd");
|
||||
|
||||
# create the big self extracting .exe installer
|
||||
print "\n**************************************************************\n";
|
||||
print "* *\n";
|
||||
print "* creating Self Extracting Executable Full Install file... *\n";
|
||||
print "* *\n";
|
||||
print "**************************************************************\n";
|
||||
print "\n $gDirDistInstall/$seiFileNameSpecific\n";
|
||||
|
||||
if(-d "$gDirDistInstall/sea")
|
||||
{
|
||||
unlink <$gDirDistInstall/sea/*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$gDirDistInstall/sea",0775);
|
||||
}
|
||||
|
||||
copy("$gDirDistInstall/$seiFileNameGeneric", "$gDirDistInstall/$seiFileNameSpecific") ||
|
||||
die "copy $gDirDistInstall/$seiFileNameGeneric $gDirDistInstall/$seiFileNameSpecific: $!\n";
|
||||
|
||||
$origCwd = cwd();
|
||||
chdir($gDirDistInstall);
|
||||
|
||||
system("./nsztool.exe $seiFileNameSpecific setup/*.* xpi/*.*") &&
|
||||
die "\n Error: ./nsztool.exe $seiFileNameSpecific setup/*.* xpi/*.*\n";
|
||||
chdir($origCwd);
|
||||
|
||||
copy("$gDirDistInstall/$seiFileNameSpecific", "$gDirDistInstall/sea") ||
|
||||
die "copy $gDirDistInstall/$seiFileNameSpecific $gDirDistInstall/sea: $!\n";
|
||||
|
||||
unlink <$gDirDistInstall/$seiFileNameSpecificStub>;
|
||||
|
||||
if ($ENV{MOZ_INSTALLER_USE_7ZIP})
|
||||
{
|
||||
# 7-Zip Self Extracting Archive
|
||||
print "\n********************************************************************\n";
|
||||
print "* *\n";
|
||||
print "* creating 7-Zip Self Extracting Executable Full Install File... *\n";
|
||||
print "* *\n";
|
||||
print "********************************************************************\n";
|
||||
print "\n $gDirDistInstall/7-zip\n";
|
||||
|
||||
if(-d "$gDirDistInstall/7z")
|
||||
{
|
||||
unlink <$gDirDistInstall/7z/*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$gDirDistInstall/7z",0775);
|
||||
}
|
||||
|
||||
# Set up the 7-Zip stage
|
||||
if(-d "$gDirDistInstall/7zstage")
|
||||
{
|
||||
unlink <$gDirDistInstall/7zstage/*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$gDirDistInstall/7zstage",0775);
|
||||
}
|
||||
|
||||
# Copy the files into the stage
|
||||
chdir("$gDirDistInstall/setup");
|
||||
`cp *.* $gDirDistInstall/7zstage`;
|
||||
chdir("$gDirDistInstall/xpi");
|
||||
`cp *.* $gDirDistInstall/7zstage`;
|
||||
chdir("$gDirDistInstall");
|
||||
|
||||
# Copy the 7zSD SFX launcher to dist/install/7z
|
||||
copy("$topsrcdir/$ENV{WIZ_sfxModule}", "$gDirDistInstall/7z") ||
|
||||
die "copy $topsrcdir/$ENV{WIZ_sfxModule} $gDirDistInstall/7z\n";
|
||||
|
||||
# Copy the SEA manifest to dist/install/7z
|
||||
copy("$inConfigFiles/app.tag", "$gDirDistInstall/7z") ||
|
||||
die "copy $inConfigFiles/app.tag $gDirDistInstall/7z";
|
||||
|
||||
# Copy the generation batch file to dist/install
|
||||
copy("$inConfigFiles/7zip.bat", "$gDirDistInstall") ||
|
||||
die "copy $inConfigFiles/7zip.bat $gDirDistInstall";
|
||||
|
||||
chdir($gDirDistInstall);
|
||||
system("cmd /C 7zip.bat");
|
||||
move("$gDirDistInstall/7z/SetupGeneric.exe", "$gDirDistInstall/sea/$seiFileNameSpecific") ||
|
||||
die "move $gDirDistInstall/SetupGeneric.exe $gDirDistInstall/sea/$seiFileNameSpecific";
|
||||
}
|
||||
|
||||
# post-mozilla-rel.pl unsets MOZ_INSTALLER_USE_7ZIP so it can make the xpi
|
||||
# files so we only run when MOZ_INSTALLER_USE_7ZIP is set until
|
||||
# post-mozilla-rel.pl is fixed
|
||||
if ($ENV{MOZ_PACKAGE_NSIS} && $ENV{MOZ_INSTALLER_USE_7ZIP})
|
||||
{
|
||||
# NSIS Installer - requires 7-Zip Self Extracting Archive
|
||||
print "\n********************************\n";
|
||||
print "* *\n";
|
||||
print "* creating NSIS Installer... *\n";
|
||||
print "* *\n";
|
||||
print "********************************\n";
|
||||
print "\n $gDirDistInstall/nsis\n";
|
||||
|
||||
# Make sure this is compiling on a win32 system
|
||||
$win32 = ($^O =~ / ((MS)?win32)|cygwin|os2/i) ? 1 : 0;
|
||||
if (!$win32) {
|
||||
die "ERROR: NSIS installers can currently only be made on the Windows platforms\n";
|
||||
}
|
||||
|
||||
# Make sure makensis.exe is available
|
||||
$makensis = `which makensis.exe`;
|
||||
if (!defined($makensis) or length($makensis) lt 1) {
|
||||
die "ERROR: makensis.exe not found. Is NSIS installed and in your $PATH?\n";
|
||||
}
|
||||
|
||||
# Make sure 7z.exe is available
|
||||
$zip = `which 7z.exe`;
|
||||
if (!defined($zip) or length($zip) lt 1) {
|
||||
die "ERROR: 7z.exe not found. Is 7-Zip installed and in your $PATH?\n";
|
||||
}
|
||||
|
||||
# Make sure installer-stage is available
|
||||
if (!(-d "$topobjdir/installer-stage")) {
|
||||
die "ERROR: $topobjdir/installer-stage not found.\n ".
|
||||
"First make installer-stage in the application's installer ".
|
||||
"directory to stage the files.\n";
|
||||
}
|
||||
|
||||
# Set up the NSIS stage
|
||||
if(-d "$gDirDistInstall/nsis")
|
||||
{
|
||||
unlink <$gDirDistInstall/nsis/*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$gDirDistInstall/nsis",0775);
|
||||
}
|
||||
|
||||
# Set up the NSIS config directory for inclusion in the SEA
|
||||
if(-d "$topobjdir/installer-stage/config")
|
||||
{
|
||||
die "installer-stage/config shouldn't exist!";
|
||||
}
|
||||
|
||||
mkdir ("$topobjdir/installer-stage/config",0775);
|
||||
|
||||
# Copy application NSIS installer files
|
||||
copy("$inConfigFiles/instfiles-extra.nsi", "$gDirDistInstall/nsis") ||
|
||||
die "copy $inConfigFiles/instfiles-extra.nsi $gDirDistInstall/nsis: $!\n";
|
||||
copy("$inConfigFiles/SetProgramAccess.nsi", "$gDirDistInstall/nsis") ||
|
||||
die "copy $inConfigFiles/SetProgramAccess.nsi $gDirDistInstall/nsis: $!\n";
|
||||
copy("$inConfigFiles/appLocale.nsi", "$gDirDistInstall/nsis") ||
|
||||
die "copy $inConfigFiles/appLocale.nsi $gDirDistInstall/nsis: $!\n";
|
||||
copy("$gDirDistInstall/license.txt", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gDirDistInstall/license.txt $gDirDistInstall/nsis: $!\n";
|
||||
copy("$inDistPath/branding/wizHeader.bmp", "$gDirDistInstall/nsis") ||
|
||||
die "copy $inDistPath/branding/wizHeader.bmp $gDirDistInstall/nsis: $!\n";
|
||||
copy("$inDistPath/branding/wizWatermark.bmp", "$gDirDistInstall/nsis") ||
|
||||
die "copy $inDistPath/branding/wizWatermark.bmp $gDirDistInstall/nsis: $!\n";
|
||||
|
||||
# Copy config files used during setip when the installer runs
|
||||
copy("$inConfigFiles/defines.nsi", "$gDirDistInstall/nsis") ||
|
||||
die "copy $inConfigFiles/defines.nsi $gDirDistInstall/nsis: $!\n";
|
||||
|
||||
# Copy toolkit NSIS installer files
|
||||
copy("$gNGAppsScriptsDir/windows/nsis/common.nsh", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gNGAppsScriptsDir/windows/nsis/common.nsh $gDirDistInstall/nsis: $!\n";
|
||||
copy("$gNGAppsScriptsDir/windows/nsis/installer.nsi", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gNGAppsScriptsDir/windows/nsis/installer.nsi $gDirDistInstall/nsis: $!\n";
|
||||
copy("$gNGAppsScriptsDir/windows/nsis/options.ini", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gNGAppsScriptsDir/windows/nsis/options.ini $gDirDistInstall/nsis: $!\n";
|
||||
copy("$gNGAppsScriptsDir/windows/nsis/shortcuts.ini", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gNGAppsScriptsDir/windows/nsis/shortcuts.ini $gDirDistInstall/nsis: $!\n";
|
||||
copy("$gNGAppsScriptsDir/windows/nsis/ShellLink.dll", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gNGAppsScriptsDir/windows/nsis/ShellLink.dll $gDirDistInstall/nsis: $!\n";
|
||||
copy("$gNGAppsScriptsDir/windows/nsis/version.nsh", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gNGAppsScriptsDir/windows/nsis/version.nsh $gDirDistInstall/nsis: $!\n";
|
||||
copy("$gNGAppsScriptsDir/windows/wizard/setuprsc/setup.ico", "$gDirDistInstall/nsis") ||
|
||||
die "copy $gNGAppsScriptsDir/windows/wizard/setuprsc/setup.ico $gDirDistInstall/nsis: $!\n";
|
||||
|
||||
# Copy toolkit NSIS installer locale files
|
||||
copy("$topsrcdir/toolkit/locales/en-US/installer/windows/commonLocale.nsh", "$gDirDistInstall/nsis") ||
|
||||
die "copy $topsrcdir/toolkit/locales/en-US/installer/windows/commonLocale.nsh $gDirDistInstall/nsis: $!\n";
|
||||
|
||||
# Create the NSIS installer
|
||||
# makensis.exe commandline options that affect stdout logging
|
||||
# /Vx verbosity where x is 4=all,3=no script,2=no info,1=no warnings,0=none
|
||||
# /Ofile specifies a text file to log compiler output (default is stdout)
|
||||
chdir("$gDirDistInstall/nsis");
|
||||
system("makensis.exe installer.nsi") &&
|
||||
die "Error creating NSIS installer";
|
||||
|
||||
copy("$inConfigFiles/app.tag", "$gDirDistInstall/nsis") ||
|
||||
die "copy $inConfigFiles/app.tag $gDirDistInstall/nsis";
|
||||
|
||||
# Stage files to installer-stage
|
||||
copy("$gDirDistInstall/nsis/setup.exe", "$topobjdir/installer-stage") ||
|
||||
die "copy $gDirDistInstall/nsis $topobjdir/installer-stage: $!";
|
||||
copy("$inConfigFiles/removed-files.log", "$topobjdir/installer-stage/config") ||
|
||||
die "copy $inConfigFiles/removed-files.log $topobjdir/installer-stage/config: $!";
|
||||
|
||||
my $dostopsrcdir = $topsrcdir;
|
||||
my $dosDistInstall = $gDirDistInstall;
|
||||
if ($^O =~ /cygwin/) {
|
||||
$dostopsrcdir = `cygpath --mixed --short-name $topsrcdir`;
|
||||
$dosDistInstall = `cygpath --mixed --short-name $gDirDistInstall`;
|
||||
chomp ($dostopsrcdir, $dosDistInstall);
|
||||
}
|
||||
|
||||
chdir "$topobjdir/installer-stage";
|
||||
system("7z a -r -t7z $dosDistInstall/nsis/app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3") &&
|
||||
die "7z failed: $!";
|
||||
|
||||
system("upx --best -o $dosDistInstall/nsis/7zSD.sfx $dostopsrcdir/$ENV{WIZ_sfxModule}") &&
|
||||
die "'upx --best -o $dosDistInstall/nsis/7zSD.sfx $dostopsrcdir/$ENV{WIZ_sfxModule}' failed: $!";
|
||||
|
||||
# Temporary name change to include -nsis before .exe
|
||||
$nsisFileNameSpecific = $seiFileNameSpecific;
|
||||
$nsisFileNameSpecific =~ s/\.exe$/-nsis\.exe/;
|
||||
|
||||
chdir("$gDirDistInstall/nsis");
|
||||
|
||||
# Since we are using a unique temp name for the NSIS installer it is safe
|
||||
# to copy it alongside the xpinstall based installer.
|
||||
print ("cmd /C copy /b 7zSD.sfx+app.tag+app.7z ..\\\\sea\\\\$nsisFileNameSpecific\n");
|
||||
|
||||
system("cmd /C copy /b 7zSD.sfx+app.tag+app.7z ..\\\\sea\\\\$nsisFileNameSpecific") &&
|
||||
die "Final concatenation failed.";
|
||||
}
|
||||
print " done!\n\n";
|
||||
|
||||
if((!(-e "$topsrcdir/../redist/microsoft/system/msvcrt.dll")) ||
|
||||
(!(-e "$topsrcdir/../redist/microsoft/system/msvcirt.dll")))
|
||||
{
|
||||
print "***\n";
|
||||
print "**\n";
|
||||
print "** The following required Microsoft redistributable system files were not found\n";
|
||||
print "** in $topsrcdir/../redist/microsoft/system:\n";
|
||||
print "**\n";
|
||||
if(!(-e "$topsrcdir/../redist/microsoft/system/msvcrt.dll"))
|
||||
{
|
||||
print "** msvcrt.dll\n";
|
||||
}
|
||||
if(!(-e "$topsrcdir/../redist/microsoft/system/msvcirt.dll"))
|
||||
{
|
||||
print "** msvcirt.dll\n";
|
||||
}
|
||||
print "**\n";
|
||||
print "** The above files are required by the installer and the browser. If you attempt\n";
|
||||
print "** to run the installer, you may encounter the following bug:\n";
|
||||
print "**\n";
|
||||
print "** http://bugzilla.mozilla.org/show_bug.cgi?id=27601\n";
|
||||
print "**\n";
|
||||
print "***\n\n";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub MakeExeZip
|
||||
{
|
||||
my($aSrcDir, $aExeFile, $aZipFile) = @_;
|
||||
my($saveCwdir);
|
||||
|
||||
$saveCwdir = cwd();
|
||||
chdir($aSrcDir);
|
||||
if(system("zip $gDirDistInstall/xpi/$aZipFile $aExeFile"))
|
||||
{
|
||||
chdir($saveCwdir);
|
||||
die "\n Error: zip $gDirDistInstall/xpi/$aZipFile $aExeFile";
|
||||
}
|
||||
chdir($saveCwdir);
|
||||
}
|
||||
|
||||
@ -1,200 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Cwd;
|
||||
|
||||
my $oldfh = select(STDOUT);
|
||||
$| = 1;
|
||||
select($oldfh);
|
||||
|
||||
$win32 = ($^O =~ / ((MS)?win32)|cygwin|os2/i) ? 1 : 0;
|
||||
if (!$win32) {
|
||||
die "ERROR: MSI installers can currently only be made on Windows platforms\n";
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# If $ENV{MOZ_PACKAGE_MSI} is not true, exit.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
if (!exists($ENV{MOZ_PACKAGE_MSI}) or !defined($ENV{MOZ_PACKAGE_MSI}) or ($ENV{MOZ_PACKAGE_MSI} ne 1) ) {
|
||||
Print("MOZ_PACKAGE_MSI environment variable is not true.. exiting.\n");
|
||||
exit;
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Find the MakeMSI mm.cmd program.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
$mm = `which mm.cmd`;
|
||||
if (!defined($mm) or length($mm) lt 1) {
|
||||
die "ERROR: mm.cmd not found. Is MakeMSI installed and in $PATH?\n";
|
||||
}
|
||||
|
||||
Print("Found mm.cmd as $mm\n");
|
||||
|
||||
ParseArgv(@ARGV);
|
||||
|
||||
if ($inSrcDir eq "") {
|
||||
die "ERROR: Mozilla source directory must be specified with -srcDir\n";
|
||||
}
|
||||
|
||||
if ($inObjDir eq "") {
|
||||
Print("Objdir not specified, using $inSrcDir\n");
|
||||
$inObjDir = $inSrcDir;
|
||||
}
|
||||
|
||||
if ($inConfigFiles eq "") {
|
||||
die "ERROR: Packager manifests and install script location must be specified with -config\n";
|
||||
}
|
||||
|
||||
if ($inProject eq "") {
|
||||
die "ERROR: Project must be specified with -project\n";
|
||||
}
|
||||
|
||||
$DIST = "$inObjDir/dist";
|
||||
$MMH = "$inSrcDir/toolkit/mozapps/installer/windows/msi";
|
||||
$MDIST = "$DIST/msi";
|
||||
$STAGE = "$DIST/install";
|
||||
|
||||
if ($inProject eq "firefox") {
|
||||
$MSRC = "$inSrcDir/browser/installer/windows/msi";
|
||||
} elsif ($inProject eq "thunderbird") {
|
||||
$MSRC = "$inSrcDir/mail/installer/windows/msi";
|
||||
} else {
|
||||
die "ERROR: make-msi.pl currently only supports the firefox and thunderbird projects.\n";
|
||||
}
|
||||
|
||||
$STAGE =~ s:/+:/:g;
|
||||
$DIST =~ s:/+:/:g;
|
||||
$MSRC =~ s:/+:/:g;
|
||||
$MDIST =~ s:/+:/:g;
|
||||
|
||||
if ( ! -e $DIST or ! -d $DIST ) {
|
||||
die "ERROR: make-msi requires\n\n\t$DIST\n\nto have been created by a proper build.\n";
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Parse the installer config file.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
ParseInstallerCfg();
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Prepare the staging directory and temp MSI location.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
if ( ! -d $STAGE ) {
|
||||
mkdir($STAGE, 0775);
|
||||
}
|
||||
|
||||
if ( -e $MDIST ) {
|
||||
Print("Found old $MDIST entry. Removing in 5 seconds..");
|
||||
for my $i (1..5) {
|
||||
printf("$i..");
|
||||
sleep(1);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
Print("Removing $MDIST.\n");
|
||||
system("rm -rf \"$MDIST\"");
|
||||
}
|
||||
|
||||
mkdir($MDIST, 0775);
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Place MSI files as needed.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
Print("Placing MSI files in $MDIST/...\n");
|
||||
system("cp \"$MSRC/$inProject.mm\" \"$MDIST/\"");
|
||||
system("cp \"$MSRC/$inProject.mmh\" \"$MDIST/\"");
|
||||
system("cp \"$MSRC/$inProject.ver\" \"$MDIST/\"");
|
||||
system("cp \"$MMH/mozilla-dept.mmh\" \"$MDIST/\"");
|
||||
system("cp \"$MMH/mozilla-company.mmh\" \"$MDIST/\"");
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Generate MSI file.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
Print("Generating MSI file...\n");
|
||||
chdir($MDIST);
|
||||
system("mm.cmd $inProject P");
|
||||
|
||||
if ( ! -e "out/$inProject.mm/MSI/$inProject.msi" ) {
|
||||
die "ERROR: Failed to build MSI -- $MDIST/out/$inProject.mm/MSI/$inProject.msi missing!\n";
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Copy MSI file to stage.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
Print("Copying MSI file to staging area...\n");
|
||||
my $cmd = "cp out/$inProject.mm/MSI/$inProject.msi \"$STAGE/$output_filename\"";
|
||||
Print("$cmd\n");
|
||||
system($cmd);
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Exit.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
exit;
|
||||
|
||||
sub Print {
|
||||
my($text) = @_;
|
||||
print("make-msi.pl: " . $text);
|
||||
}
|
||||
|
||||
sub PrintUsage {
|
||||
printf("$0: Usage\n\n");
|
||||
printf("\t-config [dir]\n\n\t\tInstaller config directory.\n\n");
|
||||
printf("\t-objDir [dir]\n\n\t\tThe main project object directory.\n\n");
|
||||
printf("\t-srcDir [dir]\n\n\t\tThe main project source directory.\n\n");
|
||||
}
|
||||
|
||||
sub ParseArgv {
|
||||
my @argv = @_;
|
||||
my $counter;
|
||||
|
||||
for($counter = 0; $counter <= $#argv; $counter++) {
|
||||
if($argv[$counter] =~ /^[-,\/]h$/i) {
|
||||
PrintUsage() and exit();
|
||||
} elsif ($argv[$counter] =~ /^[-,\/]srcDir$/i) {
|
||||
if ($#argv >= ($counter + 1)) {
|
||||
$counter++;
|
||||
$inSrcDir = $argv[$counter];
|
||||
}
|
||||
} elsif ($argv[$counter] =~ /^[-,\/]objDir$/i) {
|
||||
if ($#argv >= ($counter + 1)) {
|
||||
$counter++;
|
||||
$inObjDir = $argv[$counter];
|
||||
}
|
||||
} elsif ($argv[$counter] =~ /^[-,\/]config$/i) {
|
||||
if ($#argv >= ($counter + 1)) {
|
||||
$counter++;
|
||||
$inConfigFiles = $argv[$counter];
|
||||
}
|
||||
} elsif ($argv[$counter] =~ /^[-,\/]project$/i) {
|
||||
if ($#argv >= ($counter + 1)) {
|
||||
$counter++;
|
||||
$inProject = $argv[$counter];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub ParseInstallerCfg {
|
||||
open(fpInstallCfg, "$inConfigFiles/installer.cfg") || die "Couldn't open $inConfigFiles/installer.cfg: $!\n";
|
||||
|
||||
while ($line = <fpInstallCfg>) {
|
||||
if (substr($line, -2, 2) eq "\r\n") {
|
||||
$line = substr($line, 0, length($line) - 2) . "\n";
|
||||
}
|
||||
|
||||
($prop, $value) = ($line =~ m/(\w*)\s+=\s+(.*)\n/);
|
||||
|
||||
if ($prop eq "FileInstallerMSI") {
|
||||
$output_filename = $value;
|
||||
}
|
||||
}
|
||||
|
||||
close(fpInstallCfg);
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
; dept.mmh
|
||||
;
|
||||
; Derived from MakeMSI's dept.mmh file:
|
||||
; (C)opyright Dennis Bareis, Australia, 2003. All rights reserved.
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;--- Define Version number of this install support --------------------------
|
||||
;----------------------------------------------------------------------------
|
||||
#ifdef DEPT_VERSION
|
||||
;--- Die, already included -----------------------------------------------
|
||||
#error ^You have already included "<?InputComponent>"^
|
||||
#endif
|
||||
#define DEPT_VERSION 03.171
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;--- Obsolete values (don't use!) -------------------------------------------
|
||||
;----------------------------------------------------------------------------
|
||||
#define? DEPT_SUPPORT_WEB_URL
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;--- Define some Department details -----------------------------------------
|
||||
;----------------------------------------------------------------------------
|
||||
#define? DEPT_ARP_URL_PUBLISHER
|
||||
#define? DEPT_ARP_URL_TECHNICAL_SUPPORT <$DEPT_SUPPORT_WEB_URL>
|
||||
#define? DEPT_ARP_URL_APPLICATION_UPDATE_INFORMATION
|
||||
#define? DEPT_NAME Mozilla.Org
|
||||
#define? DEPT_ADDRESS United States
|
||||
#define? DEPT_MSI_MANUFACTURER <$DEPT_NAME>
|
||||
#define? DEPT_MSI_AUTHOR <$DEPT_NAME>
|
||||
;#define? COMPANY_CONTACT_NAME Fred Nerk
|
||||
;#define? COMPANY_CONTACT_NAME_PHONE (03)1234-5678
|
||||
#define? COMPANY_PACKAGED_BY Packaged by <$DEPT_NAME> (<$DEPT_ADDRESS>).
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;--- Define the types of boxes your department/company supports -------------
|
||||
;----------------------------------------------------------------------------
|
||||
#ifndef COMPANY_DEFINE_DEPARTMENTS_PLATFORMS
|
||||
#(
|
||||
#define COMPANY_DEFINE_DEPARTMENTS_PLATFORMS ;;COMPANY.MMH expands...
|
||||
|
||||
;--- User must override... -------------------------------------------
|
||||
<$Platform "TEST" DESC=^Testing (NOT SUPPORTED)^ PLATDIR="Testing-Unsupported">
|
||||
#)
|
||||
#endif
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;--- Load MAKEMSI support ---------------------------------------------------
|
||||
;----------------------------------------------------------------------------
|
||||
#NextId PUSH
|
||||
#include "mozilla-company.mmh"
|
||||
#NextId POP
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;--- Make sure we record details about this header --------------------------
|
||||
;----------------------------------------------------------------------------
|
||||
<$SourceFile Version="<$DEPT_VERSION>">
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;--- Start "location" status information (if allowed) -----------------------
|
||||
;----------------------------------------------------------------------------
|
||||
<$LocationVerboseOn> ;;Outputs messages during length processing (to prove it hasn't hung etc)
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = setuprsc setup
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@ -1,840 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="installer" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=installer - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "installer.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "installer.mak" CFG="installer - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "installer - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "installer - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "installer - Win32 Release"
|
||||
# Name "installer - Win32 Debug"
|
||||
# Begin Group "setup"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\dialogs.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\dialogs.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\extern.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\extra.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\extra.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\ifuncns.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\ifuncns.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\logging.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\logging.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\nsEscape.cpp
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\nsEscape.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\process.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\process.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\resource.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\setup.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\setup.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\setup.rc
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\shortcut.cpp
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\shortcut.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\supersede.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\supersede.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\version.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\version.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\wizverreg.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\xperr.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\xpi.c
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\xpi.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\xpistub.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\xpnetHook.cpp
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\xpnetHook.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setup\zipfile.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Ignore_Default_Tool 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "setuprsc"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setuprsc\setuprsc.cpp
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setuprsc\setuprsc.h
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\wizard\setuprsc\setuprsc.rc
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "xappscripts"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\build_static.pl
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\windows\makeall.pl
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\makecfgini.pl
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "browserscripts"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\abe.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\adt.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\browser.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\chatzilla.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\config.it
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\deflenus.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\editor.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\..\..\..\browser\installer\windows\firebird-win32-stub-installer.jst"
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\inspector.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\install.it
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\installer.cfg
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\langenus.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\..\..\..\browser\installer\windows\packages-static"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\psm.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\redirect.it
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\regus.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\talkback.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\uninstall.it
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\venkman.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\..\browser\installer\windows\xpcom.jst
|
||||
|
||||
!IF "$(CFG)" == "installer - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setuprsc\bitmap1.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setuprsc\browser.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setuprsc\Header.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setuprsc\setup.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\setuprsc\Watermrk.bmp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@ -1,29 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "installer"=.\installer.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@ -1,100 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
PROGRAM = setup$(BIN_SUFFIX)
|
||||
RESFILE = setup.res
|
||||
|
||||
REQUIRES = \
|
||||
setuprsc \
|
||||
xpnet \
|
||||
$(NULL)
|
||||
|
||||
LIBS = \
|
||||
$(DEPTH)/modules/libreg/standalone/$(LIB_PREFIX)mozregsa_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/modules/libjar/standalone/$(LIB_PREFIX)jar50_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/modules/zlib/standalone/$(LIB_PREFIX)mozz_s.$(LIB_SUFFIX) \
|
||||
$(DEPTH)/xpinstall/wizard/libxpnet/src/$(LIB_PREFIX)xpnet_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
USE_STATIC_LIBS = 1
|
||||
|
||||
CSRCS = \
|
||||
dialogs.c \
|
||||
extra.c \
|
||||
ifuncns.c \
|
||||
setup.c \
|
||||
xpi.c \
|
||||
logging.c \
|
||||
supersede.c \
|
||||
version.c \
|
||||
process.c \
|
||||
|
||||
CPPSRCS = \
|
||||
shortcut.cpp \
|
||||
xpnetHook.cpp \
|
||||
nsEscape.cpp \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir) -I$(srcdir)/../uninstall
|
||||
|
||||
NO_DIST_INSTALL = 1
|
||||
|
||||
MOZ_WINCONSOLE = 0
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_OS_LIBS = ole32 comdlg32 comctl32 shell32 version
|
||||
ifdef GNU_CC
|
||||
_OS_LIBS += uuid
|
||||
endif
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,$(_OS_LIBS))
|
||||
|
||||
libs:: $(PROGRAM)
|
||||
$(INSTALL) $(PROGRAM) $(DIST)/install
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(INSTALL) $(PROGRAM) $(DESTDIR)$(mozappdir)/install
|
||||
|
||||
clean clobber realclean clobber_all::
|
||||
$(RM) $(DIST)/install/$(PROGRAM)
|
||||
@ -1,95 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _DIALOGS_H_
|
||||
#define _DIALOGS_H_
|
||||
|
||||
|
||||
#ifdef STUB_INSTALLER
|
||||
#undef STUB_INSTALLER
|
||||
#endif
|
||||
|
||||
|
||||
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 DlgProcSelectInstallPath(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcUpgrade(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
#ifdef STUB_INSTALLER
|
||||
LRESULT CALLBACK DlgProcAdvancedSettings(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
#endif
|
||||
LRESULT CALLBACK DlgProcSummary(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcDownloading(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcInstalling(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcInstallSuccessful(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);
|
||||
|
||||
LRESULT CALLBACK ListBoxBrowseWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
BOOL IsSelectableComponent(siC* aComponent);
|
||||
BOOL IsComponentSelected(siC* aComponent);
|
||||
HFONT MakeFont(TCHAR* aFaceName, int aFontSize, LONG aWeight);
|
||||
void SaveUserChanges();
|
||||
BOOL IsDownloadRequired();
|
||||
BOOL InstallFiles(HWND hDlg);
|
||||
void InitPathDisplay (HWND aWindow, char* aPath, int aFolderIcon, int aFolderField);
|
||||
void CheckForUpgrade(HWND aPanel, int aNextPanel);
|
||||
|
||||
void ToggleCheck(HWND hwndListBox, DWORD dwIndex, DWORD dwACFlag);
|
||||
BOOL ShouldExitSetup(HWND hDlg);
|
||||
void lbAddItem(HWND hList, siC *siCComponent);
|
||||
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
|
||||
void InitSequence(HINSTANCE hInstance);
|
||||
void BrowseForDirectory(HWND hDlg);
|
||||
void ShowMessage(LPSTR szMessage, BOOL bShow);
|
||||
void DrawLBText(LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag);
|
||||
void DrawCheck(LPDRAWITEMSTRUCT lpdis, DWORD dwACFlag);
|
||||
void InvalidateLBCheckbox(HWND hwndListBox);
|
||||
void ProcessWindowsMessages(void);
|
||||
LPSTR GetStartInstallMessage(void);
|
||||
void AppendStringWOAmpersand(LPSTR szInputString, DWORD dwInputStringSize, LPSTR szString);
|
||||
void TruncateString(HWND hWnd, LPSTR szInPath, LPSTR szOutPath, DWORD dwOutPathBufSize);
|
||||
WNDPROC SubclassWindow( HWND hWnd, WNDPROC NewWndProc);
|
||||
|
||||
#endif /* _DIALOGS_H_ */
|
||||
|
||||
@ -1,129 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#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 hbmpBoxCheckedDisabled;
|
||||
extern HBITMAP hbmpBoxUnChecked;
|
||||
|
||||
extern HANDLE hAccelTable;
|
||||
|
||||
extern HWND hDlgCurrent;
|
||||
extern HWND hDlgMessage;
|
||||
extern HWND hWndMain;
|
||||
extern HWND hWizardWnd;
|
||||
|
||||
extern LPSTR szEGlobalAlloc;
|
||||
extern LPSTR szEStringLoad;
|
||||
extern LPSTR szEDllLoad;
|
||||
extern LPSTR szEStringNull;
|
||||
extern LPSTR szEOutOfMemory;
|
||||
extern LPSTR szTempSetupPath;
|
||||
|
||||
extern LPSTR szSetupDir;
|
||||
extern LPSTR szTempDir;
|
||||
extern LPSTR szOSTempDir;
|
||||
extern LPSTR szFileIniInstall;
|
||||
|
||||
extern LPSTR szSiteSelectorDescription;
|
||||
|
||||
extern DWORD dwWizardState;
|
||||
extern DWORD dwSetupType;
|
||||
|
||||
extern DWORD dwTempSetupType;
|
||||
extern DWORD gdwUpgradeValue;
|
||||
extern DWORD gdwSiteSelectorStatus;
|
||||
|
||||
extern BOOL bSDUserCanceled;
|
||||
extern BOOL bIdiArchivesExists;
|
||||
extern BOOL bCreateDestinationDir;
|
||||
extern BOOL bReboot;
|
||||
extern BOOL gbILUseTemp;
|
||||
extern BOOL gbPreviousUnfinishedDownload;
|
||||
extern BOOL gbIgnoreRunAppX;
|
||||
extern BOOL gbIgnoreProgramFolderX;
|
||||
extern BOOL gbRestrictedAccess;
|
||||
extern BOOL gbDownloadTriggered;
|
||||
extern BOOL gbAllowMultipleInstalls;
|
||||
extern BOOL gbForceInstall;
|
||||
extern BOOL gbForceInstallGre;
|
||||
extern BOOL gShowBannerImage;
|
||||
|
||||
extern setupGen sgProduct;
|
||||
extern diS diSetup;
|
||||
extern diW diWelcome;
|
||||
extern diQL diQuickLaunch;
|
||||
extern diL diLicense;
|
||||
extern diST diSetupType;
|
||||
extern diSC diSelectComponents;
|
||||
extern diSIP diSelectInstallPath;
|
||||
extern diU diUpgrade;
|
||||
extern diSC diSelectAdditionalComponents;
|
||||
extern diWI diWindowsIntegration;
|
||||
extern diPF diProgramFolder;
|
||||
extern diDO diAdditionalOptions;
|
||||
extern diAS diAdvancedSettings;
|
||||
extern diSI diStartInstall;
|
||||
extern diDL diDownloading;
|
||||
extern diI diInstalling;
|
||||
extern diIS diInstallSuccessful;
|
||||
extern diD diDownload;
|
||||
extern diR diReboot;
|
||||
extern siSD siSDObject;
|
||||
extern siCF siCFXpcomFile;
|
||||
extern siC *siComponents;
|
||||
extern ssi *ssiSiteSelector;
|
||||
extern char *SetupFileList[];
|
||||
extern installGui sgInstallGui;
|
||||
extern sems gErrorMessageStream;
|
||||
extern sysinfo gSystemInfo;
|
||||
extern dsN *gdsnComponentDSRequirement;
|
||||
|
||||
#endif /* _EXTERN_H */
|
||||
|
||||
@ -1,261 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _EXTRA_H_
|
||||
#define _EXTRA_H_
|
||||
|
||||
#include "supersede.h"
|
||||
|
||||
BOOL InitDialogClass(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
|
||||
BOOL InitApplication(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
|
||||
BOOL InitInstance(HINSTANCE hInstance, DWORD dwCmdShow);
|
||||
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH);
|
||||
void FreeMemory(void **vPointer);
|
||||
void *NS_GlobalReAlloc(HGLOBAL *hgMemory,
|
||||
DWORD dwMemoryBufSize,
|
||||
DWORD dwNewSize);
|
||||
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 ParseInstallIni();
|
||||
HRESULT DecryptString(LPSTR szOutputStr, LPSTR szInputStr);
|
||||
HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize);
|
||||
void CollateBackslashes(LPSTR szInputOutputStr);
|
||||
HRESULT InitSetupGeneral(void);
|
||||
HRESULT InitDlgWelcome(diW *diDialog);
|
||||
HRESULT InitDlgLicense(diL *diDialog);
|
||||
HRESULT InitDlgQuickLaunch(diQL *diDialog);
|
||||
HRESULT InitDlgSetupType(diST *diDialog);
|
||||
HRESULT InitDlgSelectComponents(diSC *diDialog, DWORD dwSM);
|
||||
HRESULT InitDlgSelectInstallPath(diSIP *diDialog);
|
||||
HRESULT InitDlgUpgrade(diU *diDialog);
|
||||
HRESULT InitDlgWindowsIntegration(diWI *diDialog);
|
||||
HRESULT InitDlgProgramFolder(diPF *diDialog);
|
||||
HRESULT InitDlgStartInstall(diSI *diDialog);
|
||||
HRESULT InitDlgDownloading(diDL *diDialog);
|
||||
HRESULT InitDlgInstalling(diI *diDialog);
|
||||
HRESULT InitDlgSiteSelector(diAS *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, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible, DWORD dwACFlag, HWND hwndListBox);
|
||||
void SiCNodeSetItemsSelected(DWORD dwSetupType);
|
||||
char *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
char *SiCNodeGetDescriptionShort(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
char *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
char *SiCNodeGetReferenceName(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
siC *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs, DWORD dwACFlag);
|
||||
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
ULONGLONG SiCNodeGetInstallSizeSystem(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
ULONGLONG SiCNodeGetInstallSizeArchive(DWORD dwIndex, BOOL bIncludeInvisible, DWORD dwACFlag);
|
||||
siC *SiCNodeFind(siC *siComponents, char *szInReferenceName);
|
||||
void InitSiComponents();
|
||||
HRESULT ParseComponentAttributes(char *szBuf, DWORD dwAttributes, BOOL bOverride);
|
||||
void InitSiteSelector();
|
||||
void DeInitSiCDependencies(siCD *siCDDependencies);
|
||||
BOOL ResolveDependencies(DWORD dwIndex, HWND hwndListBox);
|
||||
BOOL ResolveComponentDependency(siCD *siCDInDependency, HWND hwndListBox);
|
||||
void ResolveDependees(LPSTR szToggledDescriptionShort, HWND hwndListBox);
|
||||
BOOL ResolveComponentDependee(siCD *siCDInDependee);
|
||||
void STSetVisibility(st *stSetupType);
|
||||
HRESULT InitSXpcomFile(void);
|
||||
void DeInitSXpcomFile(void);
|
||||
void DeInitialize(void);
|
||||
void DeInitDlgWelcome(diW *diDialog);
|
||||
void DeInitDlgLicense(diL *diDialog);
|
||||
void DeInitDlgQuickLaunch(diQL *diDialog);
|
||||
void DeInitDlgSetupType(diST *diDialog);
|
||||
void DeInitDlgSelectComponents(diSC *diDialog);
|
||||
void DeInitDlgSelectInstallPath(diSIP *diDialog);
|
||||
void DeInitDlgUpgrade(diU *diDialog);
|
||||
void DeInitDlgWindowsIntegration(diWI *diDialog);
|
||||
void DeInitDlgProgramFolder(diPF *diDialog);
|
||||
void DeInitDlgStartInstall(diSI *diDialog);
|
||||
void DeInitDlgDownloading(diDL *diDialog);
|
||||
void DeInitDlgInstalling(diI *diDialog);
|
||||
void DeInitDlgSiteSelector(diAS *diDialog);
|
||||
void DetermineOSVersionEx(void);
|
||||
void DeInitSiComponents(siC **siComponents);
|
||||
void DeInitSetupGeneral(void);
|
||||
HRESULT ParseSetupIni(void);
|
||||
HRESULT GetConfigIni(void);
|
||||
DWORD GetConfigIniProfileString(const char* aSection, const char *aKey,
|
||||
const char *aDefault,
|
||||
char *aResult, DWORD aMaxLen);
|
||||
HRESULT GetInstallIni(void);
|
||||
void CleanTempFiles(void);
|
||||
void OutputSetupTitle(HDC hDC);
|
||||
long RetrieveArchives(void);
|
||||
long RetrieveRedirectFile(void);
|
||||
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, BOOL bUseSlash, DWORD dwType);
|
||||
void RemoveBackSlash(LPSTR szInput);
|
||||
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
|
||||
void RemoveSlash(LPSTR szInput);
|
||||
void AppendSlash(LPSTR szInput, DWORD dwInputSize);
|
||||
BOOL DeleteIdiGetConfigIni(void);
|
||||
BOOL DeleteIdiGetArchives(void);
|
||||
BOOL DeleteIdiGetRedirect(void);
|
||||
BOOL DeleteIdiFileIniConfig(void);
|
||||
BOOL DeleteIdiFileIniInstall(void);
|
||||
void DeleteArchives(DWORD dwDeleteCheck);
|
||||
BOOL DeleteIniRedirect(void);
|
||||
HRESULT LaunchApps(void);
|
||||
HRESULT FileExists(LPSTR szFile);
|
||||
int ExtractDirEntries(char* directory,void* vZip);
|
||||
int LocateJar(siC *siCObject, LPSTR szPath, int dwPathSize, BOOL bIncludeTempDir);
|
||||
HRESULT AddArchiveToIdiFile(siC *siCObject,
|
||||
char *szSFile,
|
||||
char *szFileIdiGetArchives);
|
||||
int SiCNodeGetIndexDS(char *szInDescriptionShort);
|
||||
int SiCNodeGetIndexRN(char *szInReferenceName);
|
||||
void ViewSiComponentsDependency(char *szBuffer, char *szIndentation, siC *siCNode);
|
||||
void ViewSiComponentsDependee(char *szBuffer, char *szIndentation, siC *siCNode);
|
||||
void ViewSiComponents(void);
|
||||
BOOL IsWin95Debute(void);
|
||||
ULONGLONG GetDiskSpaceRequired(DWORD dwType);
|
||||
ULONGLONG GetDiskSpaceAvailable(LPSTR szPath);
|
||||
HRESULT VerifyDiskSpace(void);
|
||||
HRESULT ErrorMsgDiskSpace(ULONGLONG ullDSAvailable, ULONGLONG ullDSRequired, LPSTR szPath, BOOL bCrutialMsg);
|
||||
void SetCustomType(void);
|
||||
void GetAlternateArchiveSearchPath(LPSTR lpszCmdLine);
|
||||
BOOL NeedReboot(void);
|
||||
BOOL LocatePreviousPath(LPSTR szMainSectionName, LPSTR szPath, DWORD dwPathSize);
|
||||
BOOL LocatePathNscpReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
|
||||
BOOL LocatePathWinReg(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
|
||||
BOOL LocatePath(LPSTR szSection, LPSTR szPath, DWORD dwPathSize);
|
||||
int VR_GetPath(char *component_path, unsigned long sizebuf, char *buf);
|
||||
dsN *CreateDSNode();
|
||||
void DsNodeInsert(dsN **dsNHead, dsN *dsNTemp);
|
||||
void DsNodeDelete(dsN **dsNTemp);
|
||||
void DeInitDSNode(dsN **dsnComponentDSRequirement);
|
||||
void UpdatePathDiskSpaceRequired(LPSTR szPath, ULONGLONG ullInstallSize, dsN **dsnComponentDSRequirement);
|
||||
HRESULT InitComponentDiskSpaceInfo(dsN **dsnComponentDSRequirement);
|
||||
HRESULT CheckInstances();
|
||||
long RandomSelect(void);
|
||||
BOOL CheckLegacy(HWND hDlg);
|
||||
COLORREF DecryptFontColor(LPSTR szColor);
|
||||
ssi *CreateSsiSiteSelectorNode();
|
||||
void SsiSiteSelectorNodeInsert(ssi **ssiHead, ssi *ssiTemp);
|
||||
void SsiSiteSelectorNodeDelete(ssi *ssiTemp);
|
||||
ssi* SsiGetNode(LPSTR szDescription);
|
||||
void UpdateSiteSelector(void);
|
||||
DWORD GetAdditionalComponentsCount(void);
|
||||
DWORD GetTotalArchivesToDownload();
|
||||
void RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize);
|
||||
int MozCopyStr(LPSTR szSrc, LPSTR szDest, DWORD dwDestBufSize);
|
||||
LPSTR GetFirstNonSpace(LPSTR lpszString);
|
||||
LPSTR MozStrChar(LPSTR lpszString, char c);
|
||||
int GetArgC(LPSTR lpszCommandLine);
|
||||
LPSTR GetArgV(LPSTR lpszCommandLine,
|
||||
int iIndex,
|
||||
LPSTR lpszDest,
|
||||
int iDestSize);
|
||||
DWORD ParseCommandLine(LPSTR aMessageToClose, LPSTR lpszCmdLine);
|
||||
DWORD ParseForStartupOptions(LPSTR aCmdLine);
|
||||
void SetSetupRunMode(LPSTR szMode);
|
||||
void Delay(DWORD dwSeconds);
|
||||
void UnsetSetupState(void);
|
||||
void SetSetupState(char *szState);
|
||||
siCD *InitWinInitNodes(char *szInFile);
|
||||
char *GetSaveInstallerPath(char *szBuf, DWORD dwBufSize);
|
||||
void SaveInstallerFiles(void);
|
||||
void ResetComponentAttributes(char *szFileIni);
|
||||
BOOL IsInList(DWORD dwCurrentItem,
|
||||
DWORD dwItems,
|
||||
DWORD *dwItemsSelected);
|
||||
int LocateExistingPath(char *szPath,
|
||||
char *szExistingPath,
|
||||
DWORD dwExistingPathSize);
|
||||
BOOL ContainsReparseTag(char *szPath,
|
||||
char *szReparsePath,
|
||||
DWORD dwReparsePathSize);
|
||||
BOOL DeleteInstallLogFile(char *szFile);
|
||||
int CRCCheckDownloadedArchives(char *szCorruptedArchiveList,
|
||||
DWORD dwCorruptedArchivelistSize,
|
||||
char *szFileIdiGetArchives);
|
||||
int CRCCheckArchivesStartup(char *szCorruptedArchiveList,
|
||||
DWORD dwCorruptedArchiveListSize,
|
||||
BOOL bIncludeTempPath);
|
||||
BOOL ResolveForceUpgrade(siC *siCObject);
|
||||
void RestoreInvisibleFlag(siC *siCNode);
|
||||
void RestoreAdditionalFlag(siC *siCNode);
|
||||
void RestoreEnabledFlag(siC *siCNode);
|
||||
void SwapFTPAndHTTP(char *szInUrl, DWORD dwInUrlSize);
|
||||
void RemoveDelayedDeleteFileEntries(const char *aPathToMatch);
|
||||
int AppendToGlobalMessageStream(char *szInfo);
|
||||
char *GetOSTypeString(char *szOSType, DWORD dwOSTypeBufSize);
|
||||
int UpdateIdiFile(char *szPartialUrl,
|
||||
DWORD dwPartialUrlBufSize,
|
||||
siC *siCObject,
|
||||
char *szSection,
|
||||
char *szKey,
|
||||
char *szFileIdiGetArchives);
|
||||
void SetDownloadFile(void);
|
||||
void UnsetSetupCurrentDownloadFile(void);
|
||||
void SetSetupCurrentDownloadFile(char *szCurrentFilename);
|
||||
char *GetSetupCurrentDownloadFile(char *szCurrentDownloadFile,
|
||||
DWORD dwCurrentDownloadFileBufSize);
|
||||
BOOL DeleteWGetLog(void);
|
||||
DWORD ParseOSType(char *szOSType);
|
||||
BOOL ShowAdditionalOptionsDialog(void);
|
||||
DWORD GetPreviousUnfinishedState(void);
|
||||
void RefreshIcons();
|
||||
void NeedToInstallFiles(LPSTR szProdDir);
|
||||
void LaunchOneComponent(siC *siCObject, greInfo *aGre);
|
||||
HRESULT ProcessXpinstallEngine(void);
|
||||
void GetXpinstallPath(char *aPath, int aPathBufSize);
|
||||
BOOL GreInstallerNeedsReboot(void);
|
||||
void ReplacePrivateProfileStrCR(LPSTR aInputOutputStr);
|
||||
void UpdateGREInstallProgress(int percent);
|
||||
BOOL IsPathWithinWindir();
|
||||
void CleanupOnUpgrade();
|
||||
BOOL IsInstallerProductGRE(void);
|
||||
HRESULT CleanupOrphanedGREs(void);
|
||||
|
||||
#endif /* _EXTRA_H_ */
|
||||
|
||||
@ -1,125 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _IFUNCNS_H_
|
||||
#define _IFUNCNS_H_
|
||||
|
||||
HRESULT TimingCheck(DWORD dwTiming, LPSTR szSection);
|
||||
HRESULT MeetCondition(LPSTR dwSection);
|
||||
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo);
|
||||
HRESULT ProcessXpcomFile(void);
|
||||
void CleanupXpcomFile(void);
|
||||
HRESULT ProcessUncompressFile(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT FileMove(LPSTR szFrom, LPSTR szTo);
|
||||
HRESULT ProcessMoveFile(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists, BOOL bDnu);
|
||||
HRESULT ProcessCopyFile(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT ProcessCreateDirectory(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT ProcessCreateCustomFiles(DWORD dwTiming);
|
||||
HRESULT FileDelete(LPSTR szDestination);
|
||||
HRESULT ProcessDeleteFile(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs);
|
||||
HRESULT ProcessRemoveDirectory(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT ProcessRunApp(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT ProcessWinReg(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT CreateALink(LPSTR lpszPathObj,
|
||||
LPSTR lpszPathLink,
|
||||
LPSTR lpszDesc,
|
||||
LPSTR lpszWorkingPath,
|
||||
LPSTR lpszArgs,
|
||||
LPSTR lpszIconFullPath,
|
||||
int iIcon);
|
||||
HRESULT ProcessProgramFolder(DWORD dwTiming, char *szSectionPrefix);
|
||||
HRESULT ProcessProgramFolderShowCmd(void);
|
||||
HRESULT CreateDirectoriesAll(char* szPath, BOOL bLogForUninstall);
|
||||
void ProcessFileOps(DWORD dwTiming, char *szSectionPrefix);
|
||||
void DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
|
||||
void DeleteWinRegKey(HKEY hkRootKey, LPSTR szKey, BOOL bAbsoluteDelete);
|
||||
DWORD GetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, LPSTR szReturnValue, DWORD dwSize);
|
||||
void SetWinReg(HKEY hkRootKey,
|
||||
LPSTR szKey,
|
||||
BOOL bOverwriteKey,
|
||||
LPSTR szName,
|
||||
BOOL bOverwriteName,
|
||||
DWORD dwType,
|
||||
LPBYTE lpbData,
|
||||
DWORD dwSize,
|
||||
BOOL bLogForUninstall,
|
||||
BOOL bDnu);
|
||||
HKEY ParseRootKey(LPSTR szRootKey);
|
||||
char *ParseRootKeyString(HKEY hkKey,
|
||||
LPSTR szRootKey,
|
||||
DWORD dwRootKeyBufSize);
|
||||
BOOL ParseRegType(LPSTR szType, DWORD *dwType);
|
||||
BOOL WinRegKeyExists(HKEY hkRootKey, LPSTR szKey);
|
||||
BOOL WinRegNameExists(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
|
||||
HRESULT FileCopySequential(LPSTR szSourcePath, LPSTR szDestPath, LPSTR szFilename);
|
||||
HRESULT ProcessCopyFileSequential(DWORD dwTiming, char *szSectionPrefix);
|
||||
void UpdateInstallLog(LPSTR szKey, LPSTR szString, BOOL bDnu);
|
||||
void UpdateInstallStatusLog(LPSTR szString);
|
||||
int RegisterDll32(char *File);
|
||||
HRESULT FileSelfRegister(LPSTR szFilename, LPSTR szDestination);
|
||||
HRESULT ProcessSelfRegisterFile(DWORD dwTiming, char *szSectionPrefix);
|
||||
void UpdateJSProxyInfo(void);
|
||||
int VerifyArchive(LPSTR szArchive);
|
||||
HRESULT ProcessSetVersionRegistry(DWORD dwTiming, char *szSectionPrefix);
|
||||
char *BuildNumberedString(DWORD dwIndex, char *szInputStringPrefix, char *szInputString, char *szOutBuf, DWORD dwOutBufSize);
|
||||
void GetUserAgentShort(char *szUserAgent, char *szOutUAShort, DWORD dwOutUAShortSize);
|
||||
void CleanupPreviousVersionRegKeys(void);
|
||||
DWORD ParseRestrictedAccessKey(LPSTR szKey);
|
||||
LPSTR GetKeyInfo(LPSTR aKey, LPSTR aOut, DWORD aOutBufSize, DWORD aInfoType);
|
||||
void AppendWinReg(HKEY hkRootKey,
|
||||
LPSTR szKey,
|
||||
LPSTR szName,
|
||||
DWORD dwType,
|
||||
LPBYTE lpbData,
|
||||
BYTE delimiter,
|
||||
DWORD dwSize,
|
||||
BOOL bLogForUninstall,
|
||||
BOOL bDnu);
|
||||
HRESULT CleanupArgsRegistry();
|
||||
void ProcessFileOpsForSelectedComponents(DWORD dwTiming);
|
||||
void ProcessFileOpsForAll(DWORD dwTiming);
|
||||
HRESULT DirHasWriteAccess(char *szPath);
|
||||
|
||||
#define KEY_INFO_ROOT 0x00000001
|
||||
#define KEY_INFO_SUBKEY 0x00000002
|
||||
|
||||
#endif /* _IFUNCNS_H_ */
|
||||
|
||||
@ -1,659 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 Navigator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "extern.h"
|
||||
#include "logging.h"
|
||||
#include "extra.h"
|
||||
#include "ifuncns.h"
|
||||
#include "xpi.h"
|
||||
|
||||
#define E_USER_CANCEL -813
|
||||
#define SECTION_EXIT_STATUS "Exit Status"
|
||||
#define KEY_STATUS "Status"
|
||||
|
||||
int AppendToGlobalMessageStream(char *szInfo)
|
||||
{
|
||||
DWORD dwInfoLen = lstrlen(szInfo);
|
||||
DWORD dwMessageLen;
|
||||
|
||||
if(gErrorMessageStream.bEnabled && gErrorMessageStream.szMessage)
|
||||
{
|
||||
dwMessageLen = lstrlen(gErrorMessageStream.szMessage);
|
||||
if((dwInfoLen + dwMessageLen) >= gErrorMessageStream.dwMessageBufSize)
|
||||
{
|
||||
if(NS_GlobalReAlloc(&gErrorMessageStream.szMessage,
|
||||
gErrorMessageStream.dwMessageBufSize,
|
||||
dwInfoLen + dwMessageLen + MAX_BUF_TINY) == NULL)
|
||||
return(WIZ_OUT_OF_MEMORY);
|
||||
|
||||
gErrorMessageStream.dwMessageBufSize = dwInfoLen +
|
||||
dwMessageLen +
|
||||
MAX_BUF_TINY;
|
||||
}
|
||||
|
||||
lstrcat(gErrorMessageStream.szMessage, szInfo);
|
||||
}
|
||||
|
||||
return(WIZ_OK);
|
||||
}
|
||||
|
||||
void LogISTime(int iType)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szTime[MAX_BUF_TINY];
|
||||
char szDate[MAX_BUF_TINY];
|
||||
SYSTEMTIME stLocalTime;
|
||||
|
||||
GetLocalTime(&stLocalTime);
|
||||
GetTimeFormat(LOCALE_NEUTRAL,
|
||||
LOCALE_NOUSEROVERRIDE,
|
||||
&stLocalTime,
|
||||
NULL,
|
||||
szTime,
|
||||
sizeof(szTime));
|
||||
GetDateFormat(LOCALE_NEUTRAL,
|
||||
LOCALE_NOUSEROVERRIDE,
|
||||
&stLocalTime,
|
||||
NULL,
|
||||
szDate,
|
||||
sizeof(szDate));
|
||||
|
||||
if(iType == W_START)
|
||||
wsprintf(szBuf, "Start Log: %s - %s\n", szDate, szTime);
|
||||
else
|
||||
wsprintf(szBuf, "End Log: %s - %s\n", szDate, szTime);
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISProductInfo(void)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
wsprintf(szBuf, "\n Product Info:\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
|
||||
switch(sgProduct.mode)
|
||||
{
|
||||
case SILENT:
|
||||
wsprintf(szBuf, " Install mode: Silent\n");
|
||||
break;
|
||||
case AUTO:
|
||||
wsprintf(szBuf, " Install mode: Auto\n");
|
||||
break;
|
||||
default:
|
||||
wsprintf(szBuf, " Install mode: Normal\n");
|
||||
break;
|
||||
}
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
|
||||
wsprintf(szBuf, " Company name: %s\n Product name (external): %s\n Product name (internal): %s\n UserAgent: %s\n Alternate search path: %s\n",
|
||||
sgProduct.szCompanyName,
|
||||
sgProduct.szProductName,
|
||||
sgProduct.szProductNameInternal,
|
||||
sgProduct.szUserAgent,
|
||||
sgProduct.szAlternateArchiveSearchPath);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISDestinationPath(void)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
wsprintf(szBuf,
|
||||
"\n Destination Path:\n Main: %s\n SubPath: %s\n",
|
||||
sgProduct.szPath,
|
||||
sgProduct.szSubPath);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISShared(void)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(sgProduct.bSharedInst == TRUE)
|
||||
wsprintf(szBuf,"\n Shared Installation: TRUE\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISSetupType(void)
|
||||
{
|
||||
char szBuf[MAX_BUF_TINY];
|
||||
|
||||
switch(dwSetupType)
|
||||
{
|
||||
case ST_RADIO1:
|
||||
wsprintf(szBuf, "\n Setup Type: %s\n",
|
||||
diSetupType.stSetupType1.szDescriptionShort);
|
||||
break;
|
||||
|
||||
default:
|
||||
wsprintf(szBuf, "\n Setup Type: %s\n",
|
||||
diSetupType.stSetupType0.szDescriptionShort);
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISComponentsSelected(void)
|
||||
{
|
||||
char szBuf[MAX_BUF_TINY];
|
||||
siC *siCNode;
|
||||
BOOL bFoundComponentSelected;
|
||||
|
||||
wsprintf(szBuf, "\n Components selected:\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
|
||||
bFoundComponentSelected = FALSE;
|
||||
siCNode = siComponents;
|
||||
do
|
||||
{
|
||||
if(siCNode == NULL)
|
||||
break;
|
||||
|
||||
if(siCNode->dwAttributes & SIC_SELECTED)
|
||||
{
|
||||
if(!siCNode->bForceUpgrade)
|
||||
wsprintf(szBuf,
|
||||
" %s\n",
|
||||
siCNode->szDescriptionShort);
|
||||
else
|
||||
wsprintf(szBuf,
|
||||
" %s (Required)\n",
|
||||
siCNode->szDescriptionShort);
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
bFoundComponentSelected = TRUE;
|
||||
}
|
||||
|
||||
siCNode = siCNode->Next;
|
||||
} while((siCNode != NULL) && (siCNode != siComponents));
|
||||
|
||||
if(!bFoundComponentSelected)
|
||||
{
|
||||
wsprintf(szBuf, " none\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
}
|
||||
|
||||
void LogISComponentsToDownload(void)
|
||||
{
|
||||
char szBuf[MAX_BUF_TINY];
|
||||
char szArchivePath[MAX_BUF_MEDIUM];
|
||||
siC *siCNode;
|
||||
BOOL bFoundComponentSelected;
|
||||
BOOL bFoundComponentsToDownload;
|
||||
|
||||
wsprintf(szBuf, "\n Components to download:\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
|
||||
bFoundComponentSelected = FALSE;
|
||||
bFoundComponentsToDownload = FALSE;
|
||||
siCNode = siComponents;
|
||||
do
|
||||
{
|
||||
if(siCNode == NULL)
|
||||
break;
|
||||
|
||||
if(siCNode->dwAttributes & SIC_SELECTED)
|
||||
{
|
||||
|
||||
if(LocateJar(siCNode,
|
||||
szArchivePath,
|
||||
sizeof(szArchivePath),
|
||||
gbPreviousUnfinishedDownload) == AP_NOT_FOUND)
|
||||
{
|
||||
wsprintf(szBuf,
|
||||
" %s will be downloaded\n",
|
||||
siCNode->szDescriptionShort);
|
||||
bFoundComponentsToDownload = TRUE;
|
||||
}
|
||||
else
|
||||
wsprintf(szBuf,
|
||||
" %s found: %s\n",
|
||||
siCNode->szDescriptionShort,
|
||||
szArchivePath);
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
bFoundComponentSelected = TRUE;
|
||||
}
|
||||
|
||||
siCNode = siCNode->Next;
|
||||
} while((siCNode != NULL) && (siCNode != siComponents));
|
||||
|
||||
if(!bFoundComponentSelected)
|
||||
{
|
||||
wsprintf(szBuf, " none\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
if(!bFoundComponentsToDownload)
|
||||
{
|
||||
wsprintf(szBuf, " **\n ** All components have been found locally. No components will be downloaded.\n **\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
}
|
||||
|
||||
void LogISDownloadProtocol(DWORD dwProtocolType)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szProtocolType[MAX_BUF];
|
||||
|
||||
switch(dwProtocolType)
|
||||
{
|
||||
case UP_HTTP:
|
||||
lstrcpy(szProtocolType, "HTTP");
|
||||
break;
|
||||
|
||||
default:
|
||||
lstrcpy(szProtocolType, "FTP");
|
||||
break;
|
||||
}
|
||||
|
||||
wsprintf(szBuf, "\n Download protocol: %s\n", szProtocolType);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISDownloadStatus(char *szStatus, char *szFailedFile)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
siC *siCObject = NULL;
|
||||
DWORD dwIndex;
|
||||
|
||||
if(szFailedFile)
|
||||
wsprintf(szBuf,
|
||||
"\n Download status: %s\n file: %s\n\n",
|
||||
szStatus,
|
||||
szFailedFile);
|
||||
else
|
||||
wsprintf(szBuf,
|
||||
"\n Download status: %s\n",
|
||||
szStatus);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
|
||||
dwIndex = 0;
|
||||
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
|
||||
while(siCObject)
|
||||
{
|
||||
if(siCObject->dwAttributes & SIC_SELECTED)
|
||||
{
|
||||
wsprintf(szBuf, " %s: NetRetries:%d, CRCRetries:%d, NetTimeOuts:%d\n",
|
||||
siCObject->szDescriptionShort,
|
||||
siCObject->iNetRetries,
|
||||
siCObject->iCRCRetries,
|
||||
siCObject->iNetTimeOuts);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
void LogISComponentsFailedCRC(char *szList, int iWhen)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(iWhen == W_STARTUP)
|
||||
{
|
||||
if(szList && (*szList != '\0'))
|
||||
wsprintf(szBuf,
|
||||
"\n Components corrupted (startup):\n%s",
|
||||
szList);
|
||||
else
|
||||
wsprintf(szBuf,
|
||||
"\n Components corrupted (startup):\n none\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(szList && (*szList != '\0'))
|
||||
wsprintf(szBuf,
|
||||
"\n Components corrupted (download):\n%s",
|
||||
szList);
|
||||
else
|
||||
wsprintf(szBuf,
|
||||
"\n Components corrupted (download):\n none\n");
|
||||
}
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISXPInstall(int iWhen)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(iWhen == W_START)
|
||||
wsprintf(szBuf, "\n XPInstall Start\n");
|
||||
else
|
||||
wsprintf(szBuf, " XPInstall End\n");
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISXPInstallComponent(char *szComponentName)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
wsprintf(szBuf, " %s", szComponentName);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISXPInstallComponentResult(DWORD dwErrorNumber)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szErrorString[MAX_BUF];
|
||||
|
||||
GetErrorString(dwErrorNumber, szErrorString, sizeof(szErrorString));
|
||||
wsprintf(szBuf, ": %d %s\n", dwErrorNumber, szErrorString);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISLaunchApps(int iWhen)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(iWhen == W_START)
|
||||
wsprintf(szBuf, "\n Launch Apps Start\n");
|
||||
else
|
||||
wsprintf(szBuf, " Launch Apps End\n");
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISLaunchAppsComponent(char *szComponentName)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
wsprintf(szBuf, " launching %s\n", szComponentName);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISLaunchAppsComponentUncompress(char *szComponentName, DWORD dwErr)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
wsprintf(szBuf, " uncompressing %s: %d\n", szComponentName, dwErr);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISProcessXpcomFile(int iStatus, int iResult)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(iStatus == LIS_SUCCESS)
|
||||
wsprintf(szBuf, "\n Uncompressing Xpcom Succeeded: %d\n", iResult);
|
||||
else
|
||||
wsprintf(szBuf, "\n Uncompressing Xpcom Failed: %d\n", iResult);
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogISDiskSpace(dsN *dsnComponentDSRequirement)
|
||||
{
|
||||
ULONGLONG ullDSAvailable;
|
||||
dsN *dsnTemp = NULL;
|
||||
char szBuf[MAX_BUF];
|
||||
char szDSRequired[MAX_BUF_TINY];
|
||||
char szDSAvailable[MAX_BUF_TINY];
|
||||
|
||||
if(dsnComponentDSRequirement != NULL)
|
||||
{
|
||||
wsprintf(szBuf, "\n Disk Space Info:\n");
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
dsnTemp = dsnComponentDSRequirement;
|
||||
do
|
||||
{
|
||||
if(!dsnTemp)
|
||||
break;
|
||||
|
||||
ullDSAvailable = GetDiskSpaceAvailable(dsnTemp->szVDSPath);
|
||||
_ui64toa(ullDSAvailable, szDSAvailable, 10);
|
||||
_ui64toa(dsnTemp->ullSpaceRequired, szDSRequired, 10);
|
||||
wsprintf(szBuf,
|
||||
" Path: %s\n Required: %sKB\n Available: %sKB\n",
|
||||
dsnTemp->szVDSPath,
|
||||
szDSRequired,
|
||||
szDSAvailable);
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
|
||||
dsnTemp = dsnTemp->Next;
|
||||
} while((dsnTemp != NULL) && (dsnTemp != dsnComponentDSRequirement));
|
||||
}
|
||||
}
|
||||
|
||||
void LogISTurboMode(BOOL bTurboMode)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(bTurboMode)
|
||||
wsprintf(szBuf, "\n Turbo Mode: true\n");
|
||||
else
|
||||
wsprintf(szBuf, "\n Turbo Mode: false\n");
|
||||
|
||||
UpdateInstallStatusLog(szBuf);
|
||||
}
|
||||
|
||||
void LogMSProductInfo(void)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szOSType[MAX_BUF_TINY];
|
||||
|
||||
GetOSTypeString(szOSType, sizeof(szOSType));
|
||||
if(*gSystemInfo.szExtraString != '\0')
|
||||
wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d,%s)",
|
||||
sgProduct.szProductName,
|
||||
sgProduct.szUserAgent,
|
||||
szOSType,
|
||||
gSystemInfo.dwMajorVersion,
|
||||
gSystemInfo.dwMinorVersion,
|
||||
gSystemInfo.dwBuildNumber,
|
||||
gSystemInfo.szExtraString);
|
||||
else
|
||||
wsprintf(szBuf, "UserAgent=%s/%s (%s,%d.%d.%d)",
|
||||
sgProduct.szProductName,
|
||||
sgProduct.szUserAgent,
|
||||
szOSType,
|
||||
gSystemInfo.dwMajorVersion,
|
||||
gSystemInfo.dwMinorVersion,
|
||||
gSystemInfo.dwBuildNumber);
|
||||
|
||||
AppendToGlobalMessageStream(szBuf);
|
||||
}
|
||||
|
||||
void LogMSDownloadProtocol(DWORD dwProtocolType)
|
||||
{
|
||||
char szMessageStream[MAX_BUF_TINY];
|
||||
char szProtocolType[MAX_BUF];
|
||||
|
||||
switch(dwProtocolType)
|
||||
{
|
||||
case UP_HTTP:
|
||||
lstrcpy(szProtocolType, "HTTP");
|
||||
break;
|
||||
|
||||
default:
|
||||
lstrcpy(szProtocolType, "FTP");
|
||||
break;
|
||||
}
|
||||
|
||||
wsprintf(szMessageStream, "&DownloadProtocol=%s", szProtocolType);
|
||||
AppendToGlobalMessageStream(szMessageStream);
|
||||
}
|
||||
|
||||
void LogMSDownloadStatus(int iDownloadStatus)
|
||||
{
|
||||
char szMessageStream[MAX_BUF_TINY];
|
||||
|
||||
wsprintf(szMessageStream, "&DownloadStatus=%d", iDownloadStatus);
|
||||
AppendToGlobalMessageStream(szMessageStream);
|
||||
gErrorMessageStream.bSendMessage = TRUE;
|
||||
}
|
||||
|
||||
void LogMSDownloadFileStatus(void)
|
||||
{
|
||||
siC *siCObject = NULL;
|
||||
DWORD dwIndex;
|
||||
char szMessageStream[MAX_BUF];
|
||||
|
||||
ZeroMemory(szMessageStream, sizeof(szMessageStream));
|
||||
dwIndex = 0;
|
||||
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
|
||||
while(siCObject)
|
||||
{
|
||||
if(siCObject->iNetRetries ||
|
||||
siCObject->iCRCRetries ||
|
||||
siCObject->iNetTimeOuts)
|
||||
{
|
||||
char szFileInfo[MAX_BUF_SMALL];
|
||||
|
||||
wsprintf(szFileInfo,
|
||||
"&%s=%d,%d,%d",
|
||||
siCObject->szArchiveName,
|
||||
siCObject->iNetRetries,
|
||||
siCObject->iCRCRetries,
|
||||
siCObject->iNetTimeOuts);
|
||||
|
||||
lstrcat(szMessageStream, szFileInfo);
|
||||
}
|
||||
++dwIndex;
|
||||
siCObject = SiCNodeGetObject(dwIndex, TRUE, AC_ALL);
|
||||
}
|
||||
|
||||
if(*szMessageStream != '\0')
|
||||
AppendToGlobalMessageStream(szMessageStream);
|
||||
}
|
||||
|
||||
void LogMSXPInstallStatus(char *szFile, int iErr)
|
||||
{
|
||||
char szMessageStream[MAX_BUF];
|
||||
static BOOL bAlreadyLogged = FALSE;
|
||||
|
||||
if(bAlreadyLogged)
|
||||
return;
|
||||
|
||||
if(szFile)
|
||||
wsprintf(szMessageStream, "&XPInstallStatus=%d&XPInstallFile=%s", iErr, szFile);
|
||||
else
|
||||
wsprintf(szMessageStream, "&XPInstallStatus=%d", iErr);
|
||||
|
||||
AppendToGlobalMessageStream(szMessageStream);
|
||||
bAlreadyLogged = TRUE;
|
||||
if((iErr != E_REBOOT) &&
|
||||
(((iErr == E_USER_CANCEL) &&
|
||||
!gErrorMessageStream.bShowConfirmation) ||
|
||||
((iErr != E_USER_CANCEL) &&
|
||||
(iErr != WIZ_OK))))
|
||||
gErrorMessageStream.bSendMessage = TRUE;
|
||||
}
|
||||
|
||||
void LogMSTurboMode(BOOL bTurboMode)
|
||||
{
|
||||
char szMessageStream[MAX_BUF];
|
||||
|
||||
wsprintf(szMessageStream, "&TM=%d", bTurboMode);
|
||||
AppendToGlobalMessageStream(szMessageStream);
|
||||
}
|
||||
|
||||
/* Function: GetExitStatusLogFile()
|
||||
* in: aProductName, aLogFileBufSize
|
||||
* in/out: aLogFile
|
||||
* purpose: To build the full filename of the exit log file
|
||||
* located in the TEMP dir given aProductName.
|
||||
*/
|
||||
void GetExitStatusLogFile(LPSTR aProductName, LPSTR aLogFile, DWORD aLogFileBufSize)
|
||||
{
|
||||
char buf[MAX_BUF];
|
||||
char logFilename[MAX_BUF];
|
||||
|
||||
if(!aProductName || !aLogFile)
|
||||
return;
|
||||
|
||||
*aLogFile = '\0';
|
||||
lstrcpy(buf, szOSTempDir);
|
||||
MozCopyStr(szOSTempDir, buf, sizeof(buf));
|
||||
AppendBackSlash(buf, sizeof(buf));
|
||||
_snprintf(logFilename, sizeof(logFilename), SETUP_EXIT_STATUS_LOG, aProductName);
|
||||
logFilename[sizeof(logFilename) - 1] = '\0';
|
||||
_snprintf(aLogFile, aLogFileBufSize, "%s%s", buf, logFilename);
|
||||
aLogFile[aLogFileBufSize - 1] = '\0';
|
||||
}
|
||||
|
||||
/* Function: DeleteExitStatusFile()
|
||||
* in: none.
|
||||
* out: none
|
||||
* purpose: To delete the setup's exit status file located in
|
||||
* the TEMP dir.
|
||||
*/
|
||||
void DeleteExitStatusFile()
|
||||
{
|
||||
char logFile[MAX_BUF];
|
||||
|
||||
GetExitStatusLogFile(sgProduct.szProductNameInternal, logFile, sizeof(logFile));
|
||||
if(FileExists(logFile))
|
||||
DeleteFile(logFile);
|
||||
}
|
||||
|
||||
/* Function: LogExitStatus()
|
||||
* in: status to log.
|
||||
* out: none
|
||||
* purpose: To log the exit status of this setup. We're normally
|
||||
* trying to log the need for a reboot.
|
||||
*/
|
||||
void LogExitStatus(LPSTR status)
|
||||
{
|
||||
char logFile[MAX_BUF];
|
||||
|
||||
GetExitStatusLogFile(sgProduct.szProductNameInternal, logFile, sizeof(logFile));
|
||||
WritePrivateProfileString(SECTION_EXIT_STATUS, KEY_STATUS, status, logFile);
|
||||
}
|
||||
|
||||
/* Function: GetGreSetupExitStatus()
|
||||
* in: none
|
||||
* out: aStatus - status read in from the exit status log file
|
||||
* purpose: To read the exis status from the GRE setup that was run
|
||||
* from within this setup.
|
||||
*/
|
||||
void GetGreSetupExitStatus(LPSTR aStatus, DWORD aStatusBufSize)
|
||||
{
|
||||
char logFile[MAX_BUF];
|
||||
|
||||
*aStatus = '\0';
|
||||
GetExitStatusLogFile("GRE", logFile, sizeof(logFile));
|
||||
if(FileExists(logFile))
|
||||
GetPrivateProfileString(SECTION_EXIT_STATUS, KEY_STATUS, "", aStatus, aStatusBufSize, logFile);
|
||||
}
|
||||
|
||||
@ -1,73 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 Navigator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _LOGGING_H_
|
||||
#define _LOGGING_H_
|
||||
|
||||
int AppendToGlobalMessageStream(char *szInfo);
|
||||
void LogISTime(int iType);
|
||||
void LogISProductInfo(void);
|
||||
void LogISDestinationPath(void);
|
||||
void LogISSetupType(void);
|
||||
void LogISComponentsSelected(void);
|
||||
void LogISComponentsToDownload(void);
|
||||
void LogISComponentsFailedCRC(char *szList, int iWhen);
|
||||
void LogISDownloadStatus(char *szStatus, char *szFailedFile);
|
||||
void LogISDownloadProtocol(DWORD dwProtocolType);
|
||||
void LogISXPInstall(int iWhen);
|
||||
void LogISXPInstallComponent(char *szComponentName);
|
||||
void LogISXPInstallComponentResult(DWORD dwErrorNumber);
|
||||
void LogISLaunchApps(int iWhen);
|
||||
void LogISLaunchAppsComponent(char *szComponentName);
|
||||
void LogISLaunchAppsComponentUncompress(char *szComponentName,
|
||||
DWORD dwErr);
|
||||
void LogISProcessXpcomFile(int iStatus, int iResult);
|
||||
void LogISShared(void);
|
||||
void LogISDiskSpace(dsN *dsnComponentDSRequirement);
|
||||
void LogISTurboMode(BOOL bTurboMode);
|
||||
void LogMSProductInfo(void);
|
||||
void LogMSDownloadFileStatus(void);
|
||||
void LogMSDownloadStatus(int iDownloadStatus);
|
||||
void LogMSDownloadProtocol(DWORD dwProtocolType);
|
||||
void LogMSXPInstallStatus(char *szFile, int iErr);
|
||||
void LogMSTurboMode(BOOL bTurboMode);
|
||||
void DeleteExitStatusFile(void);
|
||||
void LogExitStatus(LPSTR status);
|
||||
void GetGreSetupExitStatus(LPSTR aStatus, DWORD aStatusBufSize);
|
||||
|
||||
#endif /* _LOGGING_H_ */
|
||||
|
||||
@ -1,201 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
* Revision checked in on 01/03/30 by ssu@netscape.com, derived from:
|
||||
* mozilla/xpcom/io/nsEscape.h
|
||||
* mozilla/xpcom/io/nsEscape.cpp
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "extern.h"
|
||||
#include "extra.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "nsEscape.h"
|
||||
|
||||
typedef int PRInt32;
|
||||
|
||||
const int netCharType[256] =
|
||||
/* Bit 0 xalpha -- the alphas
|
||||
** Bit 1 xpalpha -- as xalpha but
|
||||
** converts spaces to plus and plus to %20
|
||||
** Bit 3 ... path -- as xalphas but doesn't escape '/'
|
||||
*/
|
||||
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
|
||||
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x */
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1x */
|
||||
0,0,0,0,0,0,0,0,0,0,7,4,0,7,7,4, /* 2x !"#$%&'()*+,-./ */
|
||||
7,7,7,7,7,7,7,7,7,7,0,0,0,7,0,0, /* 3x 0123456789:;<=>? */
|
||||
0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 4x @ABCDEFGHIJKLMNO */
|
||||
/* bits for '@' changed from 7 to 0 so '@' can be escaped */
|
||||
/* in usernames and passwords in publishing. */
|
||||
7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,7, /* 5X PQRSTUVWXYZ[\]^_ */
|
||||
0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 6x `abcdefghijklmno */
|
||||
7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0, /* 7X pqrstuvwxyz{\}~ DEL */
|
||||
0, };
|
||||
|
||||
/* decode % escaped hex codes into character values
|
||||
*/
|
||||
#define UNHEX(C) \
|
||||
((C >= '0' && C <= '9') ? C - '0' : \
|
||||
((C >= 'A' && C <= 'F') ? C - 'A' + 10 : \
|
||||
((C >= 'a' && C <= 'f') ? C - 'a' + 10 : 0)))
|
||||
|
||||
|
||||
#define IS_OK(C) (netCharType[((unsigned int) (C))] & (mask))
|
||||
#define HEX_ESCAPE '%'
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_COM char* nsEscape(const char * str, nsEscapeMask mask)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if(!str)
|
||||
return NULL;
|
||||
return nsEscapeCount(str, lstrlen(str), mask, NULL);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_COM char* nsEscapeCount(
|
||||
const char * str,
|
||||
PRInt32 len,
|
||||
nsEscapeMask mask,
|
||||
PRInt32* out_len)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
int i, extra = 0;
|
||||
char* hexChars = "0123456789ABCDEF";
|
||||
|
||||
register const unsigned char* src = (const unsigned char *) str;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (!IS_OK(*src++))
|
||||
extra += 2; /* the escape, plus an extra byte for each nibble */
|
||||
}
|
||||
|
||||
char* result = (char *)NS_GlobalAlloc(len + extra + 1);
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
register unsigned char* dst = (unsigned char *) result;
|
||||
src = (const unsigned char *) str;
|
||||
if (mask == url_XPAlphas)
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
unsigned char c = *src++;
|
||||
if (IS_OK(c))
|
||||
*dst++ = c;
|
||||
else if (c == ' ')
|
||||
*dst++ = '+'; /* convert spaces to pluses */
|
||||
else
|
||||
{
|
||||
*dst++ = HEX_ESCAPE;
|
||||
*dst++ = hexChars[c >> 4]; /* high nibble */
|
||||
*dst++ = hexChars[c & 0x0f]; /* low nibble */
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
unsigned char c = *src++;
|
||||
if (IS_OK(c))
|
||||
*dst++ = c;
|
||||
else
|
||||
{
|
||||
*dst++ = HEX_ESCAPE;
|
||||
*dst++ = hexChars[c >> 4]; /* high nibble */
|
||||
*dst++ = hexChars[c & 0x0f]; /* low nibble */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*dst = '\0'; /* tack on eos */
|
||||
if(out_len)
|
||||
*out_len = dst - (unsigned char *) result;
|
||||
return result;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_COM char* nsUnescape(char * str)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsUnescapeCount(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_COM PRInt32 nsUnescapeCount(char * str)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
register char *src = str;
|
||||
register char *dst = str;
|
||||
|
||||
while (*src)
|
||||
if (*src != HEX_ESCAPE)
|
||||
*dst++ = *src++;
|
||||
else
|
||||
{
|
||||
src++; /* walk over escape */
|
||||
if (*src)
|
||||
{
|
||||
*dst = UNHEX(*src) << 4;
|
||||
src++;
|
||||
}
|
||||
if (*src)
|
||||
{
|
||||
*dst = (*dst + UNHEX(*src));
|
||||
src++;
|
||||
}
|
||||
dst++;
|
||||
}
|
||||
|
||||
*dst = 0;
|
||||
return (int)(dst - str);
|
||||
|
||||
} /* NET_UnEscapeCnt */
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
* Revision checked in on 01/03/22 by ssu@netscape.com, derived from:
|
||||
* mozilla/xpcom/io/nsEscape.h
|
||||
* mozilla/xpcom/io/nsEscape.cpp
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _ESCAPE_H_
|
||||
#define _ESCAPE_H_
|
||||
|
||||
#define NS_COM
|
||||
#define PRUnichar char
|
||||
|
||||
/* valid mask values for NET_Escape() and NET_EscapedSize(). */
|
||||
typedef enum {
|
||||
url_XAlphas = (1<<0)
|
||||
, url_XPAlphas = (1<<1)
|
||||
, url_Path = (1<<2)
|
||||
} nsEscapeMask;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
NS_COM char * nsEscape(const char * str, nsEscapeMask mask);
|
||||
/* Caller must use nsCRT::free() on the result */
|
||||
|
||||
NS_COM char * nsUnescape(char * str);
|
||||
/* decode % escaped hex codes into character values,
|
||||
* modifies the parameter, returns the same buffer
|
||||
*/
|
||||
|
||||
NS_COM char * nsEscapeCount(const char * str, PRInt32 len, nsEscapeMask mask, PRInt32* out_len);
|
||||
/* Like nsEscape, but if out_len is non-null, return result string length
|
||||
* in *out_len, and uses len instead of NUL termination.
|
||||
* Caller must use nsCRT::free() on the result.
|
||||
*/
|
||||
NS_COM PRInt32 nsUnescapeCount (char * str);
|
||||
/* decode % escaped hex codes into character values,
|
||||
* modifies the parameter buffer, returns the length of the result
|
||||
* (result may contain \0's).
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _ESCAPE_H_
|
||||
|
||||
@ -1,681 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "process.h"
|
||||
#include "extern.h"
|
||||
#include "extra.h"
|
||||
#include "dialogs.h"
|
||||
#include <tlhelp32.h>
|
||||
#include <winperf.h>
|
||||
|
||||
#define INDEX_STR_LEN 10
|
||||
#define PN_PROCESS TEXT("Process")
|
||||
#define PN_PROCESS_ID TEXT("ID Process")
|
||||
#define PN_THREAD TEXT("Thread")
|
||||
|
||||
/* CW: Close Window */
|
||||
#define CW_CLOSE_ALL 0x00000001
|
||||
#define CW_CLOSE_VISIBLE_ONLY 0x00000002
|
||||
#define CW_CHECK_VISIBLE_ONLY 0x00000003
|
||||
|
||||
typedef PERF_DATA_BLOCK PERF_DATA, *PPERF_DATA;
|
||||
typedef PERF_OBJECT_TYPE PERF_OBJECT, *PPERF_OBJECT;
|
||||
typedef PERF_INSTANCE_DEFINITION PERF_INSTANCE, *PPERF_INSTANCE;
|
||||
typedef BOOL (WINAPI *NS_ProcessWalk)(HANDLE hSnapshot, LPPROCESSENTRY32 lppe);
|
||||
typedef HANDLE (WINAPI *NS_CreateSnapshot)(DWORD dwFlags, DWORD th32ProcessID);
|
||||
|
||||
TCHAR INDEX_PROCTHRD_OBJ[2*INDEX_STR_LEN];
|
||||
DWORD PX_PROCESS;
|
||||
DWORD PX_PROCESS_ID;
|
||||
DWORD PX_THREAD;
|
||||
|
||||
BOOL _FindAndKillProcessNT4(LPSTR aProcessName,
|
||||
BOOL aKillProcess);
|
||||
BOOL KillProcess(char *aProcessName, HWND aHwndProcess, DWORD aProcessID);
|
||||
DWORD GetTitleIdx(HWND hWnd, LPTSTR Title[], DWORD LastIndex, LPTSTR Name);
|
||||
PPERF_OBJECT FindObject (PPERF_DATA pData, DWORD TitleIndex);
|
||||
PPERF_OBJECT NextObject (PPERF_OBJECT pObject);
|
||||
PPERF_OBJECT FirstObject (PPERF_DATA pData);
|
||||
PPERF_INSTANCE NextInstance (PPERF_INSTANCE pInst);
|
||||
PPERF_INSTANCE FirstInstance (PPERF_OBJECT pObject);
|
||||
DWORD GetPerfData (HKEY hPerfKey,
|
||||
LPTSTR szObjectIndex,
|
||||
PPERF_DATA *ppData,
|
||||
DWORD *pDataSize);
|
||||
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM aParam);
|
||||
|
||||
typedef struct _CAWOWH
|
||||
{
|
||||
DWORD cwState;
|
||||
DWORD processID;
|
||||
} CAWOWH;
|
||||
|
||||
typedef struct _kpf
|
||||
{
|
||||
NS_CreateSnapshot pCreateToolhelp32Snapshot;
|
||||
NS_ProcessWalk pProcessWalkFirst;
|
||||
NS_ProcessWalk pProcessWalkNext;
|
||||
} kpf;
|
||||
|
||||
BOOL _FindAndKillProcess(kpf *kpfRoutines, LPSTR aProcessName, BOOL aKillProcess);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Function: FindAndKillProcess()
|
||||
*
|
||||
* in: LPSTR aProcessName: Name of process to find and kill
|
||||
* BOOL aKillProcess: Indicates whether to kill the process
|
||||
* or not.
|
||||
* purpose: To find and kill a given process name currently running.
|
||||
*/
|
||||
BOOL FindAndKillProcess(LPSTR aProcessName, BOOL aKillProcess)
|
||||
{
|
||||
HANDLE hKernel = NULL;
|
||||
BOOL bDoWin95Check = TRUE;
|
||||
kpf kpfRoutines;
|
||||
|
||||
if((hKernel = GetModuleHandle("kernel32.dll")) == NULL)
|
||||
return(FALSE);
|
||||
|
||||
kpfRoutines.pCreateToolhelp32Snapshot = (NS_CreateSnapshot)GetProcAddress(hKernel, "CreateToolhelp32Snapshot");
|
||||
kpfRoutines.pProcessWalkFirst = (NS_ProcessWalk)GetProcAddress(hKernel, "Process32First");
|
||||
kpfRoutines.pProcessWalkNext = (NS_ProcessWalk)GetProcAddress(hKernel, "Process32Next");
|
||||
|
||||
if(kpfRoutines.pCreateToolhelp32Snapshot && kpfRoutines.pProcessWalkFirst && kpfRoutines.pProcessWalkNext)
|
||||
return(_FindAndKillProcess(&kpfRoutines, aProcessName, aKillProcess));
|
||||
else
|
||||
return(_FindAndKillProcessNT4(aProcessName, aKillProcess));
|
||||
}
|
||||
|
||||
/* Function: KillProcess()
|
||||
*
|
||||
* in: LPSTR aProcessName: Name of process to find and kill
|
||||
* BOOL aKillProcess: Indicates whether to kill the process
|
||||
* or not.
|
||||
* purpose: To find and kill a given process name currently running.
|
||||
*/
|
||||
BOOL KillProcess(char *aProcessName, HWND aHwndProcess, DWORD aProcessID)
|
||||
{
|
||||
BOOL rv = FALSE;
|
||||
HWND hwndProcess;
|
||||
|
||||
hwndProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, aProcessID);
|
||||
if(!hwndProcess)
|
||||
return(rv);
|
||||
|
||||
if(!TerminateProcess(hwndProcess, 1))
|
||||
{
|
||||
char errorMsg[MAX_BUF];
|
||||
|
||||
if(GetPrivateProfileString("Messages", "ERROR_TERMINATING_PROCESS", "", errorMsg, sizeof(errorMsg), szFileIniInstall))
|
||||
{
|
||||
char buf[MAX_BUF];
|
||||
|
||||
wsprintf(buf, errorMsg, aProcessName);
|
||||
PrintError(buf, ERROR_CODE_SHOW);
|
||||
}
|
||||
}
|
||||
else
|
||||
rv = TRUE;
|
||||
|
||||
CloseHandle(hwndProcess);
|
||||
return(rv);
|
||||
}
|
||||
|
||||
// Windows callback function that processes each window found to be running.
|
||||
// This function will close all the visible and invisible windows that
|
||||
// match a processes passed in from aParam.
|
||||
BOOL CALLBACK EnumWindowsProc(HWND aHwnd, LPARAM aParam)
|
||||
{
|
||||
BOOL rv = TRUE;
|
||||
DWORD processID;
|
||||
CAWOWH *closeWindowInfo = (CAWOWH *)aParam;
|
||||
|
||||
GetWindowThreadProcessId(aHwnd, &processID);
|
||||
if(processID == closeWindowInfo->processID)
|
||||
{
|
||||
switch(closeWindowInfo->cwState)
|
||||
{
|
||||
case CW_CLOSE_ALL:
|
||||
SendMessageTimeout(aHwnd, WM_CLOSE, (WPARAM)1, (LPARAM)0, SMTO_NORMAL, WM_CLOSE_TIMEOUT_VALUE, NULL);
|
||||
break;
|
||||
|
||||
case CW_CLOSE_VISIBLE_ONLY:
|
||||
// only close the windows that are visible
|
||||
if(GetWindowLong(aHwnd, GWL_STYLE) & WS_VISIBLE)
|
||||
SendMessageTimeout(aHwnd, WM_CLOSE, (WPARAM)1, (LPARAM)0, SMTO_NORMAL, WM_CLOSE_TIMEOUT_VALUE, NULL);
|
||||
break;
|
||||
|
||||
case CW_CHECK_VISIBLE_ONLY:
|
||||
/* Check for visible windows. If there are any, then the previous
|
||||
* call to close all visible windows had failed (most likely due
|
||||
* to user canceling a save request on a window) */
|
||||
if(GetWindowLong(aHwnd, GWL_STYLE) & WS_VISIBLE)
|
||||
rv = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return(rv); // Returning TRUE will continue with the enumeration!
|
||||
// it will automatically stop when there's no more
|
||||
// windows to process.
|
||||
// Returning FALSE will stop immediately.
|
||||
}
|
||||
|
||||
|
||||
/* Function: CloseAllWindowsOfWindowHandle()
|
||||
*
|
||||
* in: HWND aHwndWindow: Handle to the process window to close.
|
||||
* char *aMsgWait : Message to show while closing the windows.
|
||||
*
|
||||
* purpose: To quit an application by closing all of its vibible and
|
||||
* invisible windows. There are 3 states to closing all windows:
|
||||
* 1) Close all visible windows
|
||||
* 2) Check to make sure all visible windows have been closed.
|
||||
* The user could be in editor and not want to close that
|
||||
* particular window just yet.
|
||||
* 3) Close the rest of the windows (invisible or not) if 2)
|
||||
* passed.
|
||||
*/
|
||||
BOOL CloseAllWindowsOfWindowHandle(HWND aHwndWindow, char *aMsgWait)
|
||||
{
|
||||
CAWOWH closeWindowInfo;
|
||||
BOOL rv = TRUE;
|
||||
|
||||
assert(aHwndWindow);
|
||||
assert(aMsgWait);
|
||||
if(*aMsgWait != '\0')
|
||||
ShowMessage(aMsgWait, TRUE);
|
||||
|
||||
GetWindowThreadProcessId(aHwndWindow, &closeWindowInfo.processID);
|
||||
|
||||
/* only close the visible windows */
|
||||
closeWindowInfo.cwState = CW_CLOSE_VISIBLE_ONLY;
|
||||
EnumWindows(EnumWindowsProc, (LPARAM)&closeWindowInfo);
|
||||
|
||||
/* only check to make sure that the visible windows were closed */
|
||||
closeWindowInfo.cwState = CW_CHECK_VISIBLE_ONLY;
|
||||
rv = EnumWindows(EnumWindowsProc, (LPARAM)&closeWindowInfo);
|
||||
if(rv)
|
||||
{
|
||||
/* All visible windows have been closed. Close all remaining windows now */
|
||||
closeWindowInfo.cwState = CW_CLOSE_ALL;
|
||||
EnumWindows(EnumWindowsProc, (LPARAM)&closeWindowInfo);
|
||||
}
|
||||
if(*aMsgWait != '\0')
|
||||
ShowMessage(aMsgWait, FALSE);
|
||||
|
||||
return(rv);
|
||||
}
|
||||
|
||||
/* Function: _FindAndKillProcess()
|
||||
*
|
||||
* in: LPSTR aProcessName: Name of process to find and kill
|
||||
* BOOL aKillProcess: Indicates whether to kill the process
|
||||
* or not.
|
||||
* purpose: To find and kill a given process name currently running. This
|
||||
* function only works under Win9x, Win2k, and WinXP systems.
|
||||
*/
|
||||
BOOL _FindAndKillProcess(kpf *kpfRoutines, LPSTR aProcessName, BOOL aKillProcess)
|
||||
{
|
||||
BOOL rv = FALSE;
|
||||
HANDLE hCreateSnapshot = NULL;
|
||||
PROCESSENTRY32 peProcessEntry;
|
||||
|
||||
hCreateSnapshot = kpfRoutines->pCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||
if(hCreateSnapshot == (HANDLE)-1)
|
||||
return(rv);
|
||||
|
||||
peProcessEntry.dwSize = sizeof(PROCESSENTRY32);
|
||||
if(kpfRoutines->pProcessWalkFirst(hCreateSnapshot, &peProcessEntry))
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
do
|
||||
{
|
||||
ParsePath(peProcessEntry.szExeFile, szBuf, sizeof(szBuf), FALSE, PP_FILENAME_ONLY);
|
||||
|
||||
/* do process name string comparison here */
|
||||
if(lstrcmpi(szBuf, aProcessName) == 0)
|
||||
{
|
||||
rv = TRUE;
|
||||
if(aKillProcess)
|
||||
KillProcess(aProcessName, NULL, peProcessEntry.th32ProcessID);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
} while(kpfRoutines->pProcessWalkNext(hCreateSnapshot, &peProcessEntry));
|
||||
}
|
||||
|
||||
CloseHandle(hCreateSnapshot);
|
||||
return(rv);
|
||||
}
|
||||
|
||||
//
|
||||
// The functions below were copied from MSDN 6.0:
|
||||
//
|
||||
// \samples\vc98\sdk\sdktools\winnt\pviewer
|
||||
//
|
||||
// They were listed in the redist.txt file from the cd.
|
||||
// Only _FindAndKillProcessNT4() was modified to accomodate the setup needs.
|
||||
//
|
||||
/******************************************************************************\
|
||||
* * This is a part of the Microsoft Source Code Samples.
|
||||
* * Copyright (C) 1993-1997 Microsoft Corporation.
|
||||
* * All rights reserved.
|
||||
\******************************************************************************/
|
||||
BOOL _FindAndKillProcessNT4(LPSTR aProcessName, BOOL aKillProcess)
|
||||
{
|
||||
BOOL bRv;
|
||||
HKEY hKey;
|
||||
DWORD dwType;
|
||||
DWORD dwSize;
|
||||
DWORD dwTemp;
|
||||
DWORD dwTitleLastIdx;
|
||||
DWORD dwIndex;
|
||||
DWORD dwLen;
|
||||
DWORD pDataSize = 50 * 1024;
|
||||
LPSTR szCounterValueName;
|
||||
LPSTR szTitle;
|
||||
LPSTR *szTitleSz;
|
||||
LPSTR szTitleBuffer;
|
||||
PPERF_DATA pData;
|
||||
PPERF_OBJECT pProcessObject;
|
||||
|
||||
bRv = FALSE;
|
||||
hKey = NULL;
|
||||
|
||||
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\perflib"),
|
||||
0,
|
||||
KEY_READ,
|
||||
&hKey) != ERROR_SUCCESS)
|
||||
return(bRv);
|
||||
|
||||
dwSize = sizeof(dwTitleLastIdx);
|
||||
if(RegQueryValueEx(hKey, TEXT("Last Counter"), 0, &dwType, (LPBYTE)&dwTitleLastIdx, &dwSize) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
return(bRv);
|
||||
}
|
||||
|
||||
|
||||
dwSize = sizeof(dwTemp);
|
||||
if(RegQueryValueEx(hKey, TEXT("Version"), 0, &dwType, (LPBYTE)&dwTemp, &dwSize) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
szCounterValueName = TEXT("Counters");
|
||||
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\009"),
|
||||
0,
|
||||
KEY_READ,
|
||||
&hKey) != ERROR_SUCCESS)
|
||||
return(bRv);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
szCounterValueName = TEXT("Counter 009");
|
||||
hKey = HKEY_PERFORMANCE_DATA;
|
||||
}
|
||||
|
||||
// Find out the size of the data.
|
||||
//
|
||||
dwSize = 0;
|
||||
if(RegQueryValueEx(hKey, szCounterValueName, 0, &dwType, 0, &dwSize) != ERROR_SUCCESS)
|
||||
return(bRv);
|
||||
|
||||
|
||||
// Allocate memory
|
||||
//
|
||||
szTitleBuffer = (LPTSTR)LocalAlloc(LMEM_FIXED, dwSize);
|
||||
if(!szTitleBuffer)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
return(bRv);
|
||||
}
|
||||
|
||||
szTitleSz = (LPTSTR *)LocalAlloc(LPTR, (dwTitleLastIdx + 1) * sizeof(LPTSTR));
|
||||
if(!szTitleSz)
|
||||
{
|
||||
if(szTitleBuffer != NULL)
|
||||
{
|
||||
LocalFree(szTitleBuffer);
|
||||
szTitleBuffer = NULL;
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
return(bRv);
|
||||
}
|
||||
|
||||
// Query the data
|
||||
//
|
||||
if(RegQueryValueEx(hKey, szCounterValueName, 0, &dwType, (BYTE *)szTitleBuffer, &dwSize) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
if(szTitleSz)
|
||||
LocalFree(szTitleSz);
|
||||
if(szTitleBuffer)
|
||||
LocalFree(szTitleBuffer);
|
||||
|
||||
return(bRv);
|
||||
}
|
||||
|
||||
// Setup the TitleSz array of pointers to point to beginning of each title string.
|
||||
// TitleBuffer is type REG_MULTI_SZ.
|
||||
//
|
||||
szTitle = szTitleBuffer;
|
||||
while(dwLen = lstrlen(szTitle))
|
||||
{
|
||||
dwIndex = atoi(szTitle);
|
||||
szTitle = szTitle + dwLen + 1;
|
||||
|
||||
if(dwIndex <= dwTitleLastIdx)
|
||||
szTitleSz[dwIndex] = szTitle;
|
||||
|
||||
szTitle = szTitle + lstrlen(szTitle) + 1;
|
||||
}
|
||||
|
||||
PX_PROCESS = GetTitleIdx (NULL, szTitleSz, dwTitleLastIdx, PN_PROCESS);
|
||||
PX_PROCESS_ID = GetTitleIdx (NULL, szTitleSz, dwTitleLastIdx, PN_PROCESS_ID);
|
||||
PX_THREAD = GetTitleIdx (NULL, szTitleSz, dwTitleLastIdx, PN_THREAD);
|
||||
wsprintf(INDEX_PROCTHRD_OBJ, TEXT("%ld %ld"), PX_PROCESS, PX_THREAD);
|
||||
pData = NULL;
|
||||
if(GetPerfData(HKEY_PERFORMANCE_DATA, INDEX_PROCTHRD_OBJ, &pData, &pDataSize) == ERROR_SUCCESS)
|
||||
{
|
||||
PPERF_INSTANCE pInst;
|
||||
DWORD i = 0;
|
||||
|
||||
pProcessObject = FindObject(pData, PX_PROCESS);
|
||||
if(pProcessObject)
|
||||
{
|
||||
LPSTR szPtrStr;
|
||||
int iLen;
|
||||
char szProcessNamePruned[MAX_BUF];
|
||||
char szNewProcessName[MAX_BUF];
|
||||
|
||||
if(sizeof(szProcessNamePruned) < (lstrlen(aProcessName) + 1))
|
||||
{
|
||||
if(hKey)
|
||||
RegCloseKey(hKey);
|
||||
if(szTitleSz)
|
||||
LocalFree(szTitleSz);
|
||||
if(szTitleBuffer)
|
||||
LocalFree(szTitleBuffer);
|
||||
|
||||
return(bRv);
|
||||
}
|
||||
|
||||
/* look for .exe and remove from end of string because the Process names
|
||||
* under NT are returned without the extension */
|
||||
lstrcpy(szProcessNamePruned, aProcessName);
|
||||
iLen = lstrlen(szProcessNamePruned);
|
||||
szPtrStr = &szProcessNamePruned[iLen - 4];
|
||||
if((lstrcmpi(szPtrStr, ".exe") == 0) || (lstrcmpi(szPtrStr, ".dll") == 0))
|
||||
*szPtrStr = '\0';
|
||||
|
||||
pInst = FirstInstance(pProcessObject);
|
||||
for(i = 0; i < (DWORD)(pProcessObject->NumInstances); i++)
|
||||
{
|
||||
*szNewProcessName = '\0';
|
||||
if(WideCharToMultiByte(CP_ACP,
|
||||
0,
|
||||
(LPCWSTR)((PCHAR)pInst + pInst->NameOffset),
|
||||
-1,
|
||||
szNewProcessName,
|
||||
MAX_BUF,
|
||||
NULL,
|
||||
NULL) != 0)
|
||||
{
|
||||
if(lstrcmpi(szNewProcessName, szProcessNamePruned) == 0)
|
||||
{
|
||||
if(aKillProcess)
|
||||
KillProcess(aProcessName, NULL, PX_PROCESS_ID);
|
||||
bRv = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pInst = NextInstance(pInst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(hKey)
|
||||
RegCloseKey(hKey);
|
||||
if(szTitleSz)
|
||||
LocalFree(szTitleSz);
|
||||
if(szTitleBuffer)
|
||||
LocalFree(szTitleBuffer);
|
||||
|
||||
return(bRv);
|
||||
}
|
||||
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// GetPerfData
|
||||
//
|
||||
// Get a new set of performance data.
|
||||
//
|
||||
// *ppData should be NULL initially.
|
||||
// This function will allocate a buffer big enough to hold the
|
||||
// data requested by szObjectIndex.
|
||||
//
|
||||
// *pDataSize specifies the initial buffer size. If the size is
|
||||
// too small, the function will increase it until it is big enough
|
||||
// then return the size through *pDataSize. Caller should
|
||||
// deallocate *ppData if it is no longer being used.
|
||||
//
|
||||
// Returns ERROR_SUCCESS if no error occurs.
|
||||
//
|
||||
// Note: the trial and error loop is quite different from the normal
|
||||
// registry operation. Normally if the buffer is too small,
|
||||
// RegQueryValueEx returns the required size. In this case,
|
||||
// the perflib, since the data is dynamic, a buffer big enough
|
||||
// for the moment may not be enough for the next. Therefor,
|
||||
// the required size is not returned.
|
||||
//
|
||||
// One should start with a resonable size to avoid the overhead
|
||||
// of reallocation of memory.
|
||||
//
|
||||
DWORD GetPerfData (HKEY hPerfKey,
|
||||
LPTSTR szObjectIndex,
|
||||
PPERF_DATA *ppData,
|
||||
DWORD *pDataSize)
|
||||
{
|
||||
DWORD DataSize;
|
||||
DWORD dwR;
|
||||
DWORD Type;
|
||||
|
||||
|
||||
if (!*ppData)
|
||||
*ppData = (PPERF_DATA) LocalAlloc (LMEM_FIXED, *pDataSize);
|
||||
|
||||
|
||||
do {
|
||||
DataSize = *pDataSize;
|
||||
dwR = RegQueryValueEx (hPerfKey,
|
||||
szObjectIndex,
|
||||
NULL,
|
||||
&Type,
|
||||
(BYTE *)*ppData,
|
||||
&DataSize);
|
||||
|
||||
if (dwR == ERROR_MORE_DATA)
|
||||
{
|
||||
LocalFree (*ppData);
|
||||
*pDataSize += 1024;
|
||||
*ppData = (PPERF_DATA) LocalAlloc (LMEM_FIXED, *pDataSize);
|
||||
}
|
||||
|
||||
if (!*ppData)
|
||||
{
|
||||
LocalFree (*ppData);
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
} while (dwR == ERROR_MORE_DATA);
|
||||
|
||||
return dwR;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// FirstInstance
|
||||
//
|
||||
// Returns pointer to the first instance of pObject type.
|
||||
// If pObject is NULL then NULL is returned.
|
||||
//
|
||||
PPERF_INSTANCE FirstInstance (PPERF_OBJECT pObject)
|
||||
{
|
||||
if (pObject)
|
||||
return (PPERF_INSTANCE)((PCHAR) pObject + pObject->DefinitionLength);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// NextInstance
|
||||
//
|
||||
// Returns pointer to the next instance following pInst.
|
||||
//
|
||||
// If pInst is the last instance, bogus data maybe returned.
|
||||
// The caller should do the checking.
|
||||
//
|
||||
// If pInst is NULL, then NULL is returned.
|
||||
//
|
||||
PPERF_INSTANCE NextInstance (PPERF_INSTANCE pInst)
|
||||
{
|
||||
PERF_COUNTER_BLOCK *pCounterBlock;
|
||||
|
||||
if (pInst)
|
||||
{
|
||||
pCounterBlock = (PERF_COUNTER_BLOCK *)((PCHAR) pInst + pInst->ByteLength);
|
||||
return (PPERF_INSTANCE)((PCHAR) pCounterBlock + pCounterBlock->ByteLength);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// FirstObject
|
||||
//
|
||||
// Returns pointer to the first object in pData.
|
||||
// If pData is NULL then NULL is returned.
|
||||
//
|
||||
PPERF_OBJECT FirstObject (PPERF_DATA pData)
|
||||
{
|
||||
if (pData)
|
||||
return ((PPERF_OBJECT) ((PBYTE) pData + pData->HeaderLength));
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// NextObject
|
||||
//
|
||||
// Returns pointer to the next object following pObject.
|
||||
//
|
||||
// If pObject is the last object, bogus data maybe returned.
|
||||
// The caller should do the checking.
|
||||
//
|
||||
// If pObject is NULL, then NULL is returned.
|
||||
//
|
||||
PPERF_OBJECT NextObject (PPERF_OBJECT pObject)
|
||||
{
|
||||
if (pObject)
|
||||
return ((PPERF_OBJECT) ((PBYTE) pObject + pObject->TotalByteLength));
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
//
|
||||
// FindObject
|
||||
//
|
||||
// Returns pointer to object with TitleIndex. If not found, NULL
|
||||
// is returned.
|
||||
//
|
||||
PPERF_OBJECT FindObject (PPERF_DATA pData, DWORD TitleIndex)
|
||||
{
|
||||
PPERF_OBJECT pObject;
|
||||
DWORD i = 0;
|
||||
|
||||
if (pObject = FirstObject (pData))
|
||||
while (i < pData->NumObjectTypes)
|
||||
{
|
||||
if (pObject->ObjectNameTitleIndex == TitleIndex)
|
||||
return pObject;
|
||||
|
||||
pObject = NextObject (pObject);
|
||||
i++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//********************************************************
|
||||
//
|
||||
// GetTitleIdx
|
||||
//
|
||||
// Searches Titles[] for Name. Returns the index found.
|
||||
//
|
||||
DWORD GetTitleIdx(HWND hWnd, LPTSTR Title[], DWORD LastIndex, LPTSTR Name)
|
||||
{
|
||||
DWORD Index;
|
||||
|
||||
for(Index = 0; Index <= LastIndex; Index++)
|
||||
if(Title[Index])
|
||||
if(!lstrcmpi (Title[Index], Name))
|
||||
return(Index);
|
||||
|
||||
MessageBox(hWnd, Name, TEXT("Setup cannot find process title index"), MB_OK);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _PROCESS_H_
|
||||
#define _PROCESS_H_
|
||||
|
||||
#include "windows.h"
|
||||
|
||||
#define WM_CLOSE_TIMEOUT_VALUE 10000 /* 3 secs */
|
||||
|
||||
/* Kill Process */
|
||||
#define KP_KILL_PROCESS TRUE
|
||||
#define KP_DO_NOT_KILL_PROCESS FALSE
|
||||
|
||||
BOOL FindAndKillProcess(LPSTR aProcessName, BOOL aKillProcess);
|
||||
BOOL CloseAllWindowsOfWindowHandle(HWND hwndWindow, char *aMsgWait);
|
||||
|
||||
#endif /* _PROCESS_H_ */
|
||||
@ -1,63 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by setup.rc
|
||||
//
|
||||
|
||||
#include "winresrc.h"
|
||||
|
||||
#define IDS_ERROR_DLL_LOAD 1
|
||||
#define IDS_ERROR_STRING_LOAD 2
|
||||
#define IDS_ERROR_STRING_NULL 4
|
||||
#define IDS_ERROR_GLOBALALLOC 5
|
||||
#define IDS_ERROR_OUTOFMEMORY 6
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@ -1,238 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#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 hbmpBoxCheckedDisabled;
|
||||
HBITMAP hbmpBoxUnChecked;
|
||||
|
||||
HANDLE hAccelTable;
|
||||
|
||||
HWND hDlgCurrent;
|
||||
HWND hDlgMessage;
|
||||
HWND hWndMain;
|
||||
HWND hWizardWnd;
|
||||
|
||||
LPSTR szEGlobalAlloc;
|
||||
LPSTR szEStringLoad;
|
||||
LPSTR szEDllLoad;
|
||||
LPSTR szEStringNull;
|
||||
LPSTR szTempSetupPath;
|
||||
LPSTR szEOutOfMemory;
|
||||
|
||||
LPSTR szSetupDir;
|
||||
LPSTR szTempDir;
|
||||
LPSTR szOSTempDir;
|
||||
LPSTR szFileIniInstall;
|
||||
|
||||
LPSTR szSiteSelectorDescription;
|
||||
|
||||
DWORD dwWizardState;
|
||||
DWORD dwSetupType;
|
||||
|
||||
DWORD dwTempSetupType;
|
||||
DWORD gdwUpgradeValue;
|
||||
DWORD gdwSiteSelectorStatus;
|
||||
|
||||
BOOL bSDUserCanceled;
|
||||
BOOL bIdiArchivesExists;
|
||||
BOOL bCreateDestinationDir;
|
||||
BOOL bReboot;
|
||||
BOOL gbILUseTemp;
|
||||
BOOL gbPreviousUnfinishedDownload;
|
||||
BOOL gbPreviousUnfinishedInstallXpi;
|
||||
BOOL gbIgnoreRunAppX;
|
||||
BOOL gbIgnoreProgramFolderX;
|
||||
BOOL gbRestrictedAccess;
|
||||
BOOL gbDownloadTriggered;
|
||||
BOOL gbAllowMultipleInstalls = FALSE;
|
||||
BOOL gbForceInstall = FALSE;
|
||||
BOOL gbForceInstallGre = FALSE;
|
||||
BOOL gShowBannerImage = TRUE;
|
||||
|
||||
setupGen sgProduct;
|
||||
diS diSetup;
|
||||
diW diWelcome;
|
||||
diL diLicense;
|
||||
diQL diQuickLaunch;
|
||||
diST diSetupType;
|
||||
diSC diSelectComponents;
|
||||
diSIP diSelectInstallPath;
|
||||
diU diUpgrade;
|
||||
diSC diSelectAdditionalComponents;
|
||||
diWI diWindowsIntegration;
|
||||
diPF diProgramFolder;
|
||||
diDO diAdditionalOptions;
|
||||
diAS diAdvancedSettings;
|
||||
diSI diStartInstall;
|
||||
diDL diDownloading;
|
||||
diI diInstalling;
|
||||
diIS diInstallSuccessful;
|
||||
diD diDownload;
|
||||
diR diReboot;
|
||||
siSD siSDObject;
|
||||
siCF siCFXpcomFile;
|
||||
siC *siComponents;
|
||||
ssi *ssiSiteSelector;
|
||||
installGui sgInstallGui;
|
||||
sems gErrorMessageStream;
|
||||
sysinfo gSystemInfo;
|
||||
dsN *gdsnComponentDSRequirement = NULL;
|
||||
|
||||
|
||||
/* do not add setup.exe to the list because we figure out the filename
|
||||
* by calling GetModuleFileName() */
|
||||
char *SetupFileList[] = {"setuprsc.dll",
|
||||
"config.ini",
|
||||
"setup.ini",
|
||||
"install.ini",
|
||||
"license.txt",
|
||||
""};
|
||||
|
||||
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];
|
||||
int iRv = WIZ_OK;
|
||||
HWND hwndFW;
|
||||
|
||||
if(!hPrevInstance)
|
||||
{
|
||||
if(InitSetupGeneral())
|
||||
PostQuitMessage(1);
|
||||
else if(ParseForStartupOptions(lpszCmdLine))
|
||||
PostQuitMessage(1);
|
||||
else if(((hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL ||
|
||||
((hwndFW = FindWindow(CLASS_NAME_SETUP, NULL)) != NULL)) &&
|
||||
!gbAllowMultipleInstalls)
|
||||
{
|
||||
/* Allow only one instance of setup to run.
|
||||
* Detect a previous instance of setup, bring it to the
|
||||
* foreground, and quit current instance */
|
||||
|
||||
ShowWindow(hwndFW, SW_RESTORE);
|
||||
SetForegroundWindow(hwndFW);
|
||||
iRv = WIZ_SETUP_ALREADY_RUNNING;
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(Initialize(hInstance))
|
||||
PostQuitMessage(1);
|
||||
else if(!InitApplication(hInstance, hSetupRscInst))
|
||||
{
|
||||
char szEFailed[MAX_BUF];
|
||||
|
||||
if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
|
||||
{
|
||||
wsprintf(szBuf, szEFailed, "InitApplication().");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
}
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(!InitInstance(hInstance, nCmdShow))
|
||||
{
|
||||
char szEFailed[MAX_BUF];
|
||||
|
||||
if(GetPrivateProfileString("Messages", "ERROR_FAILED", "", szEFailed, sizeof(szEFailed), szFileIniInstall))
|
||||
{
|
||||
wsprintf(szBuf, szEFailed, "InitInstance().");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
}
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(GetInstallIni())
|
||||
{
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(ParseInstallIni())
|
||||
{
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(GetConfigIni())
|
||||
{
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(ParseConfigIni(lpszCmdLine))
|
||||
{
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
InitSequence(hInstance);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
while(GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if((!IsDialogMessage(hDlgCurrent, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
if(iRv != WIZ_SETUP_ALREADY_RUNNING)
|
||||
/* Do clean up before exiting from the application */
|
||||
DeInitialize();
|
||||
|
||||
/* garbage collection */
|
||||
DeInitSetupGeneral();
|
||||
|
||||
return(msg.wParam);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity
|
||||
version="1.0.0.0"
|
||||
processorArchitecture="X86"
|
||||
name="Microsoft.Winweb.MantaRay"
|
||||
type="win32"
|
||||
/>
|
||||
<description>.NET control deployment tool</description>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="X86"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
||||
@ -1,742 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _SETUP_H_
|
||||
#define _SETUP_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define PR_BEGIN_EXTERN_C extern "C" {
|
||||
#define PR_END_EXTERN_C }
|
||||
#else /* __cplusplus */
|
||||
#define PR_BEGIN_EXTERN_C
|
||||
#define PR_END_EXTERN_C
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#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 <direct.h>
|
||||
#include <tchar.h>
|
||||
#include <commctrl.h>
|
||||
#include "setuprsc.h"
|
||||
#include "resource.h"
|
||||
#include "zipfile.h"
|
||||
|
||||
#define DEFAULT_SETUP_WINDOW_NAME "Setup"
|
||||
/* Class name for the invisible window to be created */
|
||||
#define CLASS_NAME_SETUP "MozillaSetup"
|
||||
#define CLASS_NAME_SETUP_DLG "MozillaSetupDlg"
|
||||
#define FILE_INI_SETUP "setup.ini"
|
||||
#define FILE_INI_CONFIG "config.ini"
|
||||
#define FILE_INI_INSTALL "install.ini"
|
||||
#define FILE_IDI_GETCONFIGINI "getconfigini.idi"
|
||||
#define FILE_IDI_GETARCHIVES "getarchives.idi"
|
||||
#define FILE_IDI_GETREDIRECT "getredirect.idi"
|
||||
#define FILE_INI_REDIRECT "redirect.ini"
|
||||
#define FILE_WGET_LOG "wget.log"
|
||||
#define FILE_INSTALL_LOG "install_wizard.log"
|
||||
#define FILE_INSTALL_STATUS_LOG "install_status.log"
|
||||
#define FILE_ALL_JS "all-proxy.js"
|
||||
#define VR_DEFAULT_PRODUCT_NAME "Mozilla"
|
||||
|
||||
#ifdef MOZ_PHOENIX
|
||||
#define WIZ_TEMP_DIR "ff_temp"
|
||||
#elif defined(MOZ_THUNDERBIRD)
|
||||
#define WIZ_TEMP_DIR "tb_temp"
|
||||
#else
|
||||
#define WIZ_TEMP_DIR "ns_temp"
|
||||
#endif
|
||||
|
||||
#define FORCE_ADD_TO_UNINSTALL_LOG TRUE
|
||||
#define DO_NOT_FORCE_ADD_TO_UNINSTALL_LOG FALSE
|
||||
|
||||
/* defines that indicate whether something should
|
||||
* be logged to the install_wizardX.log or not
|
||||
* for uninstallation purposes.
|
||||
*/
|
||||
#define ADD_TO_UNINSTALL_LOG TRUE
|
||||
#define DO_NOT_ADD_TO_UNINSTALL_LOG FALSE
|
||||
|
||||
/* defines that indeicate whether an install command
|
||||
* should have '*dnu*' prepended. '*dnu*' is parsed
|
||||
* by the uninstaller and signals that the specific
|
||||
* install command should _not_ be undone.
|
||||
*/
|
||||
#define DNU_UNINSTALL FALSE
|
||||
#define DNU_DO_NOT_UNINSTALL TRUE
|
||||
|
||||
#define WINREG_OVERWRITE_KEY TRUE
|
||||
#define WINREG_DO_NOT_OVERWRITE_KEY FALSE
|
||||
#define WINREG_OVERWRITE_NAME TRUE
|
||||
#define WINREG_DO_NOT_OVERWRITE_NAME FALSE
|
||||
|
||||
#define INCLUDE_INVISIBLE_OBJS TRUE
|
||||
#define SKIP_INVISIBLE_OBJS FALSE
|
||||
|
||||
#define NO_BANNER_IMAGE 0x00000000
|
||||
#define BANNER_IMAGE_DOWNLOAD 0x00000001
|
||||
#define BANNER_IMAGE_INSTALLING 0x00000002
|
||||
|
||||
#define APPPATH_GRE_PATH_SET 0x00000000
|
||||
#define APPPATH_GRE_PATH_NOT_SET 0x00000001
|
||||
#define APPPATH_GRE_PATH_ALREADY_SET 0x00000002
|
||||
|
||||
#define NEXT_DLG 1
|
||||
#define PREV_DLG 2
|
||||
#define OTHER_DLG_1 3
|
||||
|
||||
#define MAX_CRC_FAILED_DOWNLOAD_RETRIES 5
|
||||
#define MAX_FILE_DOWNLOAD_RETRIES 10
|
||||
|
||||
#define STATUS_DISABLED 0
|
||||
#define STATUS_ENABLED 1
|
||||
|
||||
#define GRE_SETUP_DIR_NAME "Setup GRE"
|
||||
|
||||
/* filename which contains this product setup's exit status */
|
||||
#define SETUP_EXIT_STATUS_LOG "%s Setup Exit Status.log"
|
||||
|
||||
/* LOCAL GRE defines */
|
||||
#define GRE_TYPE_NOT_SET -1
|
||||
#define GRE_SHARED 0
|
||||
#define GRE_LOCAL 1
|
||||
|
||||
/* WS: WinSpawn wait values */
|
||||
#define WS_DO_NOT_WAIT FALSE
|
||||
#define WS_WAIT TRUE
|
||||
|
||||
#define MAX_KILL_PROCESS_RETRIES 10
|
||||
|
||||
/* CI: Check Instance */
|
||||
#define CI_FORCE_QUIT_PROCESS TRUE
|
||||
#define CI_CLOSE_PROCESS FALSE
|
||||
|
||||
#define BAR_MARGIN 1
|
||||
#define BAR_SPACING 0
|
||||
#define BAR_WIDTH 6
|
||||
#define BAR_LIBXPNET_MARGIN 1
|
||||
#define BAR_LIBXPNET_SPACING 0
|
||||
#define BAR_LIBXPNET_WIDTH 1
|
||||
|
||||
/* W: When for install status logging */
|
||||
#define W_START 0
|
||||
#define W_END 1
|
||||
|
||||
/* W: When for crc check failed logging */
|
||||
#define W_STARTUP 0
|
||||
#define W_DOWNLOAD 1
|
||||
|
||||
/* UP: Use Protocol */
|
||||
#define UP_FTP 0
|
||||
#define UP_HTTP 1
|
||||
|
||||
/* RA: Restricted Access */
|
||||
#define RA_IGNORE 0
|
||||
#define RA_ONLY_RESTRICTED 1
|
||||
#define RA_ONLY_NONRESTRICTED 2
|
||||
|
||||
/* LIS: Log Install Status */
|
||||
#define LIS_SUCCESS 0
|
||||
#define LIS_FAILURE 1
|
||||
|
||||
/* UG: Upgrade */
|
||||
#define UG_NONE 0
|
||||
#define UG_DELETE 1
|
||||
#define UG_IGNORE 2
|
||||
#define UG_GOBACK 3
|
||||
|
||||
/* AP: Archive Path */
|
||||
#define AP_NOT_FOUND 0
|
||||
#define AP_TEMP_PATH 1
|
||||
#define AP_SETUP_PATH 2
|
||||
#define AP_ALTERNATE_PATH 3
|
||||
|
||||
/* PP: Parse Path */
|
||||
#define PP_FILENAME_ONLY 1
|
||||
#define PP_PATH_ONLY 2
|
||||
#define PP_ROOT_ONLY 3
|
||||
#define PP_EXTENSION_ONLY 4
|
||||
|
||||
/* DA: Delete Archive */
|
||||
#define DA_ONLY_IF_IN_ARCHIVES_LST 1
|
||||
#define DA_ONLY_IF_NOT_IN_ARCHIVES_LST 2
|
||||
#define DA_IGNORE_ARCHIVES_LST 3
|
||||
|
||||
/* T: Timing */
|
||||
#define T_PRE_DOWNLOAD 1
|
||||
#define T_POST_DOWNLOAD 2
|
||||
#define T_PRE_XPCOM 3
|
||||
#define T_POST_XPCOM 4
|
||||
#define T_PRE_SMARTUPDATE 5
|
||||
#define T_POST_SMARTUPDATE 6
|
||||
#define T_PRE_LAUNCHAPP 7
|
||||
#define T_POST_LAUNCHAPP 8
|
||||
#define T_DEPEND_REBOOT 9
|
||||
#define T_PRE_ARCHIVE 10
|
||||
#define T_POST_ARCHIVE 11
|
||||
|
||||
#define MAX_BUF 2048
|
||||
#define MAX_BUF_TINY 256
|
||||
#define MAX_BUF_SMALL 512
|
||||
#define MAX_BUF_MEDIUM 1024
|
||||
#define MAX_BUF_LARGE MAX_BUF
|
||||
#define MAX_BUF_XLARGE 4096
|
||||
#define MAX_ITOA 46
|
||||
#define MAX_INI_SK 128
|
||||
|
||||
#define ERROR_CODE_HIDE 0
|
||||
#define ERROR_CODE_SHOW 1
|
||||
#define DLG_NONE 0
|
||||
#define DLG_COMMIT_INSTALL 1
|
||||
#define CX_CHECKBOX 13
|
||||
#define CY_CHECKBOX 13
|
||||
|
||||
/* WIZ: WIZARD defines */
|
||||
#define WIZ_OK 0
|
||||
#define WIZ_ERROR_UNDEFINED 1024
|
||||
#define WIZ_MEMORY_ALLOC_FAILED 1025
|
||||
#define WIZ_OUT_OF_MEMORY WIZ_MEMORY_ALLOC_FAILED
|
||||
#define WIZ_ARCHIVES_MISSING 1026
|
||||
#define WIZ_CRC_PASS WIZ_OK
|
||||
#define WIZ_CRC_FAIL 1028
|
||||
#define WIZ_SETUP_ALREADY_RUNNING 1029
|
||||
#define WIZ_TOO_MANY_NETWORK_ERRORS 1030
|
||||
#define WIZ_ERROR_PARSING_INTERNAL_STR 1031
|
||||
#define WIZ_ERROR_REGKEY 1032
|
||||
#define WIZ_ERROR_INIT 1033
|
||||
#define WIZ_ERROR_LOADING_RESOURCE_LIB 1034
|
||||
#define WIZ_ERROR_CREATE_DIRECTORY 1035
|
||||
|
||||
/* E: Errors */
|
||||
#define E_REBOOT 999
|
||||
|
||||
/* 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 FO_ERROR_WRITE 4
|
||||
#define FO_ERROR_INCR_EXCEEDS_LIMIT 5
|
||||
|
||||
/* Mode of Setup to run in */
|
||||
#define NOT_SET -1
|
||||
#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 0x00000001
|
||||
#define SIC_INVISIBLE 0x00000002
|
||||
#define SIC_LAUNCHAPP 0x00000004
|
||||
#define SIC_DOWNLOAD_REQUIRED 0x00000008
|
||||
#define SIC_DOWNLOAD_ONLY 0x00000010
|
||||
#define SIC_ADDITIONAL 0x00000020
|
||||
#define SIC_DISABLED 0x00000040
|
||||
#define SIC_FORCE_UPGRADE 0x00000080
|
||||
#define SIC_IGNORE_DOWNLOAD_ERROR 0x00000100
|
||||
#define SIC_IGNORE_XPINSTALL_ERROR 0x00000200
|
||||
#define SIC_UNCOMPRESS 0x00000400
|
||||
#define SIC_SUPERSEDE 0x00000800
|
||||
#define SIC_MAIN_COMPONENT 0x00001000
|
||||
|
||||
/* AC: Additional Components */
|
||||
#define AC_NONE 0
|
||||
#define AC_COMPONENTS 1
|
||||
#define AC_ADDITIONAL_COMPONENTS 2
|
||||
#define AC_ALL 3
|
||||
|
||||
/* OS: Operating System */
|
||||
#define OS_WIN9x 0x00000001
|
||||
#define OS_WIN95_DEBUTE 0x00000002
|
||||
#define OS_WIN95 0x00000004
|
||||
#define OS_WIN98 0x00000008
|
||||
#define OS_NT 0x00000010
|
||||
#define OS_NT3 0x00000020
|
||||
#define OS_NT4 0x00000040
|
||||
#define OS_NT5 0x00000080
|
||||
#define OS_NT50 0x00000100
|
||||
#define OS_NT51 0x00000200
|
||||
|
||||
/* DSR: Disk Space Required */
|
||||
#define DSR_DESTINATION 0
|
||||
#define DSR_SYSTEM 1
|
||||
#define DSR_TEMP 2
|
||||
#define DSR_DOWNLOAD_SIZE 3
|
||||
|
||||
/* SS: Site Selector */
|
||||
#define SS_HIDE 0
|
||||
#define SS_SHOW 1
|
||||
|
||||
/* PUS: Previous Unfinished State */
|
||||
#define PUS_NONE 0
|
||||
#define PUS_DOWNLOAD 1
|
||||
#define PUS_UNPACK_XPCOM 2
|
||||
#define PUS_INSTALL_XPI 3
|
||||
#define SETUP_STATE_DOWNLOAD "downloading"
|
||||
#define SETUP_STATE_UNPACK_XPCOM "unpacking xpcom"
|
||||
#define SETUP_STATE_INSTALL_XPI "installing xpi"
|
||||
#define SETUP_STATE_REMOVING_PREV_INST "removing previous installation"
|
||||
|
||||
|
||||
typedef struct dlgSetup
|
||||
{
|
||||
DWORD dwDlgID;
|
||||
WNDPROC fDlgProc;
|
||||
LPSTR szTitle;
|
||||
} diS;
|
||||
|
||||
typedef struct dlgWelcome
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessageWelcome;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szMessage1;
|
||||
LPSTR szMessage2;
|
||||
LPSTR szMessage3;
|
||||
} diW;
|
||||
|
||||
typedef struct dlgLicense
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szLicenseFilename;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szRadioAccept;
|
||||
LPSTR szRadioDecline;
|
||||
} diL;
|
||||
|
||||
typedef struct dlgQuickLaunch
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szMessage1;
|
||||
LPSTR szMessage2;
|
||||
BOOL bTurboMode;
|
||||
BOOL bTurboModeEnabled;
|
||||
} diQL;
|
||||
|
||||
|
||||
typedef struct stStruct
|
||||
{
|
||||
BOOL bVisible;
|
||||
DWORD dwCItems;
|
||||
DWORD dwCItemsSelected[MAX_BUF]; /* components */
|
||||
LPSTR szDescriptionShort;
|
||||
LPSTR szDescriptionLong;
|
||||
} st;
|
||||
|
||||
typedef struct dlgSetupType
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szMessage0;
|
||||
st stSetupType0;
|
||||
st stSetupType1;
|
||||
} diST;
|
||||
|
||||
typedef struct dlgSelectComponents
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
DWORD bShowDialogSM;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szMessage0;
|
||||
} diSC;
|
||||
|
||||
typedef struct dlgSelectInstallPath
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szMessage0;
|
||||
} diSIP;
|
||||
|
||||
typedef struct dlgUpgrade
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
BOOL bShowInEasyInstall;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szMessageCleanup;
|
||||
LPSTR szCheckboxSafeInstall;
|
||||
LPSTR szSafeInstallInfo;
|
||||
LPSTR szUnsafeInstallInfo;
|
||||
LPSTR szNoSafeUpgradeWindir;
|
||||
} diU;
|
||||
|
||||
typedef struct wiCBstruct
|
||||
{
|
||||
BOOL bEnabled;
|
||||
BOOL bCheckBoxState;
|
||||
LPSTR szDescription;
|
||||
LPSTR szArchive;
|
||||
} wiCBs;
|
||||
|
||||
typedef struct dlgWindowsIntegration
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szRegistryKey;
|
||||
wiCBs wiCB0;
|
||||
wiCBs wiCB1;
|
||||
wiCBs wiCB2;
|
||||
} diWI;
|
||||
|
||||
typedef struct dlgProgramFolder
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
} diPF;
|
||||
|
||||
typedef struct dlgAdditionalOptions
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szMessage1;
|
||||
BOOL bSaveInstaller;
|
||||
DWORD dwUseProtocol;
|
||||
BOOL bUseProtocolSettings;
|
||||
BOOL bShowProtocols;
|
||||
} diDO;
|
||||
|
||||
typedef struct dlgAdvancedSettings
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szProxyServer;
|
||||
LPSTR szProxyPort;
|
||||
LPSTR szProxyUser;
|
||||
LPSTR szProxyPasswd;
|
||||
} diAS;
|
||||
|
||||
typedef struct dlgStartInstall
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szMessageInstall;
|
||||
LPSTR szMessageDownload;
|
||||
LPSTR szMessage0;
|
||||
} diSI;
|
||||
|
||||
typedef struct dlgDownloading
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szBlurb;
|
||||
LPSTR szFileNameKey;
|
||||
LPSTR szTimeRemainingKey;
|
||||
} diDL;
|
||||
|
||||
typedef struct dlgInstalling
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szSubTitle;
|
||||
LPSTR szBlurb;
|
||||
LPSTR szStatusFile;
|
||||
LPSTR szStatusComponent;
|
||||
} diI;
|
||||
|
||||
typedef struct dlgInstallSuccessful
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessageHeader;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szMessage1;
|
||||
LPSTR szRegistryKey;
|
||||
LPSTR szLaunchApp;
|
||||
BOOL bLaunchAppChecked;
|
||||
} diIS;
|
||||
|
||||
typedef struct dlgDownload
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessageDownload0;
|
||||
LPSTR szMessageRetry0;
|
||||
} diD;
|
||||
|
||||
typedef struct dlgReboot
|
||||
{
|
||||
DWORD dwShowDialog;
|
||||
LPSTR szTitle;
|
||||
} diR;
|
||||
|
||||
typedef struct setupStruct
|
||||
{
|
||||
int mode;
|
||||
int greType;
|
||||
DWORD dwCustomType;
|
||||
DWORD dwNumberOfComponents;
|
||||
LPSTR szPath;
|
||||
LPSTR szSubPath;
|
||||
LPSTR szProgramName;
|
||||
LPSTR szCompanyName;
|
||||
LPSTR szProductName;
|
||||
LPSTR szProductNameInternal;
|
||||
LPSTR szProductNamePrevious;
|
||||
LPSTR szUserAgent;
|
||||
LPSTR szProgramFolderName;
|
||||
LPSTR szProgramFolderPath;
|
||||
LPSTR szAlternateArchiveSearchPath;
|
||||
LPSTR szParentProcessFilename;
|
||||
BOOL bLockPath;
|
||||
BOOL bSharedInst;
|
||||
BOOL bInstallFiles;
|
||||
BOOL checkCleanupOnUpgrade;
|
||||
BOOL doCleanupOnUpgrade;
|
||||
LPSTR szAppID;
|
||||
LPSTR szAppPath;
|
||||
LPSTR szRegPath;
|
||||
BOOL greCleanupOrphans;
|
||||
char greCleanupOrphansMessage[MAX_BUF];
|
||||
char greID[MAX_BUF];
|
||||
char grePrivateKey[MAX_BUF];
|
||||
} setupGen;
|
||||
|
||||
typedef struct sinfoSmartDownload
|
||||
{
|
||||
LPSTR szXpcomFile;
|
||||
LPSTR szXpcomDir;
|
||||
LPSTR szNoAds;
|
||||
LPSTR szSilent;
|
||||
LPSTR szExecution;
|
||||
LPSTR szConfirmInstall;
|
||||
LPSTR szExtractMsg;
|
||||
LPSTR szExe;
|
||||
LPSTR szExeParam;
|
||||
LPSTR szXpcomFilePath;
|
||||
} siSD;
|
||||
|
||||
typedef struct sinfoXpcomFile
|
||||
{
|
||||
LPSTR szSource;
|
||||
LPSTR szDestination;
|
||||
LPSTR szMessage;
|
||||
BOOL bCleanup;
|
||||
BOOL bStatus;
|
||||
ULONGLONG ullInstallSize;
|
||||
} siCF;
|
||||
|
||||
typedef struct sinfoComponentDep siCD;
|
||||
struct sinfoComponentDep
|
||||
{
|
||||
LPSTR szDescriptionShort;
|
||||
LPSTR szReferenceName;
|
||||
siCD *Next;
|
||||
siCD *Prev;
|
||||
};
|
||||
|
||||
typedef struct sinfoComponent siC;
|
||||
struct sinfoComponent
|
||||
{
|
||||
ULONGLONG ullInstallSize;
|
||||
ULONGLONG ullInstallSizeSystem;
|
||||
ULONGLONG ullInstallSizeArchive;
|
||||
long lRandomInstallPercentage;
|
||||
long lRandomInstallValue;
|
||||
DWORD dwAttributes;
|
||||
LPSTR szArchiveName;
|
||||
LPSTR szArchiveNameUncompressed;
|
||||
LPSTR szArchivePath;
|
||||
LPSTR szDestinationPath;
|
||||
LPSTR szDescriptionShort;
|
||||
LPSTR szDescriptionLong;
|
||||
LPSTR szParameter;
|
||||
LPSTR szReferenceName;
|
||||
BOOL bForceUpgrade;
|
||||
BOOL bSupersede;
|
||||
int iNetRetries;
|
||||
int iCRCRetries;
|
||||
int iNetTimeOuts;
|
||||
int iFileCount;
|
||||
siCD *siCDDependencies;
|
||||
siCD *siCDDependees;
|
||||
siC *Next;
|
||||
siC *Prev;
|
||||
};
|
||||
|
||||
typedef struct ssInfo ssi;
|
||||
struct ssInfo
|
||||
{
|
||||
LPSTR szDescription;
|
||||
LPSTR szDomain;
|
||||
LPSTR szIdentifier;
|
||||
ssi *Next;
|
||||
ssi *Prev;
|
||||
};
|
||||
|
||||
typedef struct dlgInstall
|
||||
{
|
||||
HFONT systemFont;
|
||||
HFONT definedFont;
|
||||
HFONT welcomeTitleFont;
|
||||
char szFontName[MAX_BUF];
|
||||
char szFontSize[MAX_BUF];
|
||||
char szCharSet[MAX_BUF];
|
||||
char szOk_[MAX_BUF];
|
||||
char szOk[MAX_BUF];
|
||||
char szCancel_[MAX_BUF];
|
||||
char szCancel[MAX_BUF];
|
||||
char szNext_[MAX_BUF];
|
||||
char szBack_[MAX_BUF];
|
||||
char szIgnore_[MAX_BUF];
|
||||
char szProxyMessage[MAX_BUF];
|
||||
char szProxyButton[MAX_BUF];
|
||||
char szProxySettings_[MAX_BUF];
|
||||
char szProxySettings[MAX_BUF];
|
||||
char szServer[MAX_BUF];
|
||||
char szPort[MAX_BUF];
|
||||
char szUserId[MAX_BUF];
|
||||
char szPassword[MAX_BUF];
|
||||
char szSelectDirectory[MAX_BUF];
|
||||
char szDirectories_[MAX_BUF];
|
||||
char szDrives_[MAX_BUF];
|
||||
char szStatus[MAX_BUF];
|
||||
char szFile[MAX_BUF];
|
||||
char szUrl[MAX_BUF];
|
||||
char szTo[MAX_BUF];
|
||||
char szAccept_[MAX_BUF];
|
||||
char szDecline_[MAX_BUF];
|
||||
char szProgramFolder_[MAX_BUF];
|
||||
char szExistingFolder_[MAX_BUF];
|
||||
char szSetupMessage[MAX_BUF];
|
||||
char szRestart[MAX_BUF];
|
||||
char szYesRestart[MAX_BUF];
|
||||
char szNoRestart[MAX_BUF];
|
||||
char szAdditionalComponents_[MAX_BUF];
|
||||
char szDescription[MAX_BUF];
|
||||
char szTotalDownloadSize[MAX_BUF];
|
||||
char szSpaceAvailable[MAX_BUF];
|
||||
char szComponents_[MAX_BUF];
|
||||
char szBrowseInfo[MAX_BUF];
|
||||
char szDestinationDirectory[MAX_BUF];
|
||||
char szBrowse_[MAX_BUF];
|
||||
char szDownloadSize[MAX_BUF];
|
||||
char szCurrentSettings[MAX_BUF];
|
||||
char szInstallFolder[MAX_BUF];
|
||||
char szPrimCompNoOthers[MAX_BUF];
|
||||
char szPrimCompOthers[MAX_BUF];
|
||||
char szAddtlCompWrapper[MAX_BUF];
|
||||
char szInstall_[MAX_BUF];
|
||||
char szDelete_[MAX_BUF];
|
||||
char szContinue_[MAX_BUF];
|
||||
char szSkip_[MAX_BUF];
|
||||
char szExtracting[MAX_BUF];
|
||||
char szReadme_[MAX_BUF];
|
||||
char szPause_[MAX_BUF];
|
||||
char szResume_[MAX_BUF];
|
||||
char szChecked[MAX_BUF];
|
||||
char szUnchecked[MAX_BUF];
|
||||
} installGui;
|
||||
|
||||
/* structure message stream */
|
||||
typedef struct sEMsgStream sems;
|
||||
struct sEMsgStream
|
||||
{
|
||||
char szURL[MAX_BUF];
|
||||
char szConfirmationMessage[MAX_BUF];
|
||||
char *szMessage;
|
||||
DWORD dwMessageBufSize;
|
||||
BOOL bEnabled;
|
||||
BOOL bSendMessage;
|
||||
BOOL bShowConfirmation;
|
||||
};
|
||||
|
||||
/* structure system info*/
|
||||
typedef struct sSysInfo sysinfo;
|
||||
struct sSysInfo
|
||||
{
|
||||
DWORD dwOSType;
|
||||
DWORD dwMajorVersion;
|
||||
DWORD dwMinorVersion;
|
||||
DWORD dwBuildNumber;
|
||||
char szExtraString[MAX_BUF];
|
||||
DWORD dwMemoryTotalPhysical;
|
||||
DWORD dwMemoryAvailablePhysical;
|
||||
DWORD dwScreenX;
|
||||
DWORD dwScreenY;
|
||||
DWORD lastWindowPosCenterX;
|
||||
DWORD lastWindowPosCenterY;
|
||||
BOOL bScreenReader;
|
||||
BOOL bRefreshIcons;
|
||||
};
|
||||
|
||||
typedef struct diskSpaceNode dsN;
|
||||
struct diskSpaceNode
|
||||
{
|
||||
ULONGLONG ullSpaceRequired;
|
||||
LPSTR szPath;
|
||||
LPSTR szVDSPath;
|
||||
dsN *Next;
|
||||
dsN *Prev;
|
||||
};
|
||||
|
||||
#endif /* _SETUP_H */
|
||||
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
@ -1,12 +0,0 @@
|
||||
[Netscape Install]
|
||||
no_ads=true
|
||||
silent=true
|
||||
execution=false
|
||||
confirm_install=false
|
||||
|
||||
[Proxy]
|
||||
|
||||
[File0]
|
||||
desc=Configuration file for setup.exe
|
||||
0=ftp://sweetlou/products/client/ssu/windows/config.ini
|
||||
|
||||
@ -1,178 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Windows XP Theme Engine
|
||||
//
|
||||
1 24 "setup.exe.manifest"
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#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
|
||||
"\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,2
|
||||
PRODUCTVERSION 1,0,0,2
|
||||
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", "mozilla.org\0"
|
||||
VALUE "FileDescription", "setup\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 2\0"
|
||||
VALUE "InternalName", "setup\0"
|
||||
VALUE "LegalCopyright", "Copyright © 2001\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "setup.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "Mozilla Setup\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 2\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
1 ICON DISCARDABLE "setup.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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."
|
||||
IDS_ERROR_OUTOFMEMORY "Out of memory"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@ -1,108 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/* This is a hack for vc5.0. It needs to be set *before* any shell
|
||||
* include files. The INITGUID definition turns off the inclusion
|
||||
* of shlguid.h in shlobj.h so it has to be done explicitly.
|
||||
*/
|
||||
#if (_MSC_VER == 1100)
|
||||
#define INITGUID
|
||||
#include "objbase.h"
|
||||
DEFINE_OLEGUID(IID_IPersistFile, 0x0000010BL, 0, 0);
|
||||
#endif
|
||||
|
||||
#include <shlobj.h>
|
||||
#include <shlguid.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);
|
||||
|
||||
// Do not set the description at this time. We need to fix this
|
||||
// parameter so it can be passed in independent of the shortcut name
|
||||
// itself. Comment this code out for now until a real fix can be done.
|
||||
// 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;
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#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
|
||||
@ -1,467 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "setup.h"
|
||||
#include "extern.h"
|
||||
#include "extra.h"
|
||||
#include "ifuncns.h"
|
||||
#include "supersede.h"
|
||||
|
||||
void SaveGreInfo(grever *aGreInstalledListTmp, greInfo* aGre);
|
||||
void ResolveSupersedeGre(siC *siCObject, greInfo *aGre);
|
||||
HRESULT GetGreSupersedeVersionList(siC *siCObject, grever **aGreSupersedeList);
|
||||
HRESULT GetGreInstalledVersionList(siC *siCObject, grever **aGreInstalledList);
|
||||
|
||||
grever *CreateGVerNode()
|
||||
{
|
||||
grever *gverNode;
|
||||
|
||||
if((gverNode = NS_GlobalAlloc(sizeof(struct structGreVer))) == NULL)
|
||||
return(NULL);
|
||||
|
||||
gverNode->greHomePath[0] = '\0';
|
||||
gverNode->greInstaller[0] = '\0';
|
||||
gverNode->greUserAgent[0] = '\0';
|
||||
gverNode->version.ullMajor = 0;
|
||||
gverNode->version.ullMinor = 0;
|
||||
gverNode->version.ullRelease = 0;
|
||||
gverNode->version.ullBuild = 0;
|
||||
gverNode->next = NULL;
|
||||
return(gverNode);
|
||||
}
|
||||
|
||||
void DeleteGverList(grever *gverHead)
|
||||
{
|
||||
grever *tmp;
|
||||
|
||||
while(gverHead != NULL)
|
||||
{
|
||||
tmp = gverHead;
|
||||
gverHead = gverHead->next;
|
||||
FreeMemory(&tmp);
|
||||
}
|
||||
}
|
||||
|
||||
/* function to build a linked list of GRE supersede versions */
|
||||
HRESULT GetGreSupersedeVersionList(siC *siCObject, grever **aGreSupersedeList)
|
||||
{
|
||||
grever *gverTmp = NULL;
|
||||
grever *gverTail = NULL;
|
||||
char key[MAX_BUF_TINY];
|
||||
char versionString[MAX_BUF_TINY];
|
||||
DWORD index;
|
||||
|
||||
if(*aGreSupersedeList)
|
||||
/* list already built, just return */
|
||||
return(WIZ_OK);
|
||||
|
||||
index = 0;
|
||||
wsprintf(key, "SupersedeVersion%d", index);
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, key, "",
|
||||
versionString, sizeof(versionString));
|
||||
while(*versionString != '\0')
|
||||
{
|
||||
gverTmp = CreateGVerNode();
|
||||
if(!gverTmp)
|
||||
// error has already been displayed.
|
||||
exit(WIZ_OUT_OF_MEMORY);
|
||||
|
||||
TranslateVersionStr(versionString, &gverTmp->version);
|
||||
if(*aGreSupersedeList == NULL)
|
||||
{
|
||||
/* brand new list */
|
||||
*aGreSupersedeList = gverTmp;
|
||||
gverTail = *aGreSupersedeList;
|
||||
}
|
||||
else if(gverTail)
|
||||
{
|
||||
/* append the new node to the end of the list */
|
||||
gverTail->next = gverTmp;
|
||||
gverTail = gverTail->next;
|
||||
}
|
||||
|
||||
wsprintf(key, "SupersedeVersion%d", ++index);
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, key, "",
|
||||
versionString, sizeof(versionString));
|
||||
}
|
||||
return(WIZ_OK);
|
||||
}
|
||||
|
||||
/* function to build a list of GRE's installed on the local system */
|
||||
HRESULT GetGreInstalledVersionList(siC *siCObject, grever **aGreInstalledList)
|
||||
{
|
||||
DWORD index;
|
||||
DWORD enumIndex;
|
||||
DWORD greVersionKeyLen;
|
||||
grever *gverTmp = NULL;
|
||||
grever *gverTail = NULL;
|
||||
char szSupersedeWinRegPath[MAX_BUF];
|
||||
char key[MAX_BUF_TINY];
|
||||
char greVersionKey[MAX_BUF_TINY];
|
||||
char subKey[MAX_BUF];
|
||||
char subKeyInstaller[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char greXpcomPath[MAX_BUF];
|
||||
char greXpcomFile[MAX_BUF];
|
||||
int greXpcomPathLen;
|
||||
char xpcomFilename[] = "xpcom.dll";
|
||||
char greKeyPath[MAX_BUF];
|
||||
verBlock vbInstalledVersion;
|
||||
HKEY hkeyRoot = NULL;
|
||||
HKEY hkGreKeyParentPath = NULL;
|
||||
HKEY hkGreKeyPath = NULL;
|
||||
LONG rv;
|
||||
|
||||
if(*aGreInstalledList)
|
||||
/* list already built, just return */
|
||||
return(WIZ_OK);
|
||||
|
||||
index = 0;
|
||||
wsprintf(key, "SupersedeWinReg%d", index);
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, key, "",
|
||||
szSupersedeWinRegPath, sizeof(szSupersedeWinRegPath));
|
||||
while(*szSupersedeWinRegPath != '\0')
|
||||
{
|
||||
BOOL skip = FALSE;
|
||||
if(!GetKeyInfo(szSupersedeWinRegPath, szBuf, sizeof(szBuf), KEY_INFO_ROOT))
|
||||
// Malformed windows registry key, continue to reading the next key.
|
||||
skip = TRUE;
|
||||
|
||||
hkeyRoot = ParseRootKey(szBuf);
|
||||
if(!GetKeyInfo(szSupersedeWinRegPath, subKey, sizeof(subKey), KEY_INFO_SUBKEY))
|
||||
// Malformed windows registry key, continue to reading the next key.
|
||||
skip = TRUE;
|
||||
|
||||
if(RegOpenKeyEx(hkeyRoot, subKey, 0, KEY_READ, &hkGreKeyParentPath) != ERROR_SUCCESS)
|
||||
// Problems opening the registry key. Ignore and continue reading the next key.
|
||||
skip = TRUE;
|
||||
|
||||
greVersionKeyLen = sizeof(greVersionKey);
|
||||
enumIndex = 0;
|
||||
while(!skip &&
|
||||
(RegEnumKeyEx(hkGreKeyParentPath, enumIndex++, greVersionKey, &greVersionKeyLen,
|
||||
NULL, NULL, NULL, NULL) != ERROR_NO_MORE_ITEMS))
|
||||
{
|
||||
sprintf(greKeyPath, "%s\\%s", subKey, greVersionKey);
|
||||
if(RegOpenKeyEx(hkeyRoot, greKeyPath, 0, KEY_READ, &hkGreKeyPath) != ERROR_SUCCESS)
|
||||
// Encoutered problems trying to open key. Just continue.
|
||||
// We don't care about any errors. If we can't open the key,
|
||||
// we just go on to other keys. These errors are nonfatal.
|
||||
continue;
|
||||
|
||||
greXpcomPathLen = sizeof(greXpcomPath);
|
||||
rv = RegQueryValueEx(hkGreKeyPath, "GreHome", 0, NULL, (BYTE *)greXpcomPath, &greXpcomPathLen);
|
||||
RegCloseKey(hkGreKeyPath);
|
||||
|
||||
if(rv != ERROR_SUCCESS)
|
||||
// Encoutered problems trying to read a var name. Just continue.
|
||||
// We don't care about any errors. If we can't open the key,
|
||||
// we just go on to other keys. These errors are nonfatal.
|
||||
continue;
|
||||
|
||||
if(MozCopyStr(greXpcomPath, greXpcomFile, sizeof(greXpcomFile)))
|
||||
{
|
||||
RegCloseKey(hkGreKeyParentPath);
|
||||
PrintError(szEOutOfMemory, ERROR_CODE_HIDE);
|
||||
exit(WIZ_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
if(sizeof(greXpcomFile) <= lstrlen(greXpcomFile) + sizeof(xpcomFilename) + 1)
|
||||
{
|
||||
RegCloseKey(hkGreKeyParentPath);
|
||||
PrintError(szEOutOfMemory, ERROR_CODE_HIDE);
|
||||
exit(WIZ_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
AppendBackSlash(greXpcomFile, sizeof(greXpcomFile));
|
||||
lstrcat(greXpcomFile, xpcomFilename);
|
||||
|
||||
if(GetFileVersion(greXpcomFile, &vbInstalledVersion))
|
||||
{
|
||||
// Don't create a node list unless xpcom.dll file actually exists.
|
||||
gverTmp = CreateGVerNode();
|
||||
if(!gverTmp)
|
||||
{
|
||||
RegCloseKey(hkGreKeyParentPath);
|
||||
// error has already been displayed.
|
||||
exit(WIZ_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
if(MozCopyStr(greXpcomPath, gverTmp->greHomePath, sizeof(gverTmp->greHomePath)))
|
||||
{
|
||||
RegCloseKey(hkGreKeyParentPath);
|
||||
PrintError(szEOutOfMemory, ERROR_CODE_HIDE);
|
||||
exit(WIZ_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
gverTmp->version.ullMajor = vbInstalledVersion.ullMajor;
|
||||
gverTmp->version.ullMinor = vbInstalledVersion.ullMinor;
|
||||
gverTmp->version.ullRelease = vbInstalledVersion.ullRelease;
|
||||
gverTmp->version.ullBuild = vbInstalledVersion.ullBuild;
|
||||
if(*aGreInstalledList == NULL)
|
||||
{
|
||||
/* brand new list */
|
||||
*aGreInstalledList = gverTmp;
|
||||
gverTail = *aGreInstalledList;
|
||||
}
|
||||
else if(gverTail)
|
||||
{
|
||||
/* append the new node to the end of the list */
|
||||
gverTail->next = gverTmp;
|
||||
gverTail = gverTail->next;
|
||||
}
|
||||
|
||||
/* get the GRE's installer app path */
|
||||
sprintf(subKeyInstaller, "%s\\%s\\Installer", subKey, greVersionKey);
|
||||
GetWinReg(hkeyRoot, subKeyInstaller, "PathToExe", gverTmp->greInstaller, sizeof(gverTmp->greInstaller));
|
||||
MozCopyStr(greVersionKey, gverTmp->greUserAgent, sizeof(gverTmp->greUserAgent));
|
||||
}
|
||||
|
||||
greVersionKeyLen = sizeof(greVersionKey);
|
||||
}
|
||||
|
||||
if(hkGreKeyParentPath)
|
||||
{
|
||||
RegCloseKey(hkGreKeyParentPath);
|
||||
hkGreKeyParentPath = NULL;
|
||||
}
|
||||
|
||||
++index;
|
||||
wsprintf(key, "SupersedeWinReg%d", index);
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, key, "", szSupersedeWinRegPath, sizeof(szSupersedeWinRegPath));
|
||||
}
|
||||
return(WIZ_OK);
|
||||
}
|
||||
|
||||
void SaveGreInfo(grever *aGreInstalledListTmp, greInfo* aGre)
|
||||
{
|
||||
MozCopyStr(aGreInstalledListTmp->greInstaller, aGre->installerAppPath, sizeof(aGre->installerAppPath));
|
||||
MozCopyStr(aGreInstalledListTmp->greUserAgent, aGre->userAgent, sizeof(aGre->userAgent));
|
||||
MozCopyStr(aGreInstalledListTmp->greHomePath, aGre->homePath, sizeof(aGre->homePath));
|
||||
}
|
||||
|
||||
void ResolveSupersedeGre(siC *siCObject, greInfo *aGre)
|
||||
{
|
||||
grever *greSupersedeListTmp = NULL;
|
||||
grever *greInstalledListTmp = NULL;
|
||||
char versionStr[MAX_BUF_TINY];
|
||||
siC *siCTmp = NULL;
|
||||
BOOL foundVersionWithinRange = FALSE;
|
||||
BOOL minVerRead = FALSE;
|
||||
BOOL maxVerRead = FALSE;
|
||||
BOOL stillInRange = FALSE;
|
||||
|
||||
if(GetGreSupersedeVersionList(siCObject, &aGre->greSupersedeList))
|
||||
return;
|
||||
if(GetGreInstalledVersionList(siCObject, &aGre->greInstalledList))
|
||||
return;
|
||||
if(!aGre->greSupersedeList || !aGre->greInstalledList)
|
||||
// nothing to compare, return
|
||||
return;
|
||||
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, "SupersedeMinVersion", "",
|
||||
versionStr, sizeof(versionStr));
|
||||
if(*versionStr != '\0')
|
||||
{
|
||||
TranslateVersionStr(versionStr, &aGre->minVersion);
|
||||
minVerRead = TRUE;
|
||||
}
|
||||
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, "SupersedeMaxVersion", "",
|
||||
versionStr, sizeof(versionStr));
|
||||
if(*versionStr != '\0')
|
||||
{
|
||||
TranslateVersionStr(versionStr, &aGre->maxVersion);
|
||||
maxVerRead = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// do the version comparison here.
|
||||
greInstalledListTmp = aGre->greInstalledList;
|
||||
while(greInstalledListTmp)
|
||||
{
|
||||
greSupersedeListTmp = aGre->greSupersedeList;
|
||||
while(greSupersedeListTmp)
|
||||
{
|
||||
if(CompareVersion(greInstalledListTmp->version, greSupersedeListTmp->version) == 0)
|
||||
{
|
||||
SaveGreInfo(greInstalledListTmp, aGre);
|
||||
siCObject->bSupersede = TRUE;
|
||||
aGre->siCGreComponent = siCObject;
|
||||
break;
|
||||
}
|
||||
else if(!foundVersionWithinRange && (minVerRead || maxVerRead))
|
||||
{
|
||||
stillInRange = TRUE;
|
||||
|
||||
if(minVerRead)
|
||||
stillInRange = CompareVersion(greInstalledListTmp->version, aGre->minVersion) >= 0;
|
||||
|
||||
if(stillInRange && maxVerRead)
|
||||
stillInRange = CompareVersion(greInstalledListTmp->version, aGre->maxVersion) <= 0;
|
||||
|
||||
if(stillInRange)
|
||||
{
|
||||
// Find the first version within the range.
|
||||
SaveGreInfo(greInstalledListTmp, aGre);
|
||||
foundVersionWithinRange = TRUE;
|
||||
}
|
||||
}
|
||||
greSupersedeListTmp = greSupersedeListTmp->next;
|
||||
}
|
||||
|
||||
if(siCObject->bSupersede)
|
||||
break;
|
||||
|
||||
greInstalledListTmp = greInstalledListTmp->next;
|
||||
}
|
||||
|
||||
if(!siCObject->bSupersede && foundVersionWithinRange)
|
||||
siCObject->bSupersede = TRUE;
|
||||
|
||||
if(siCObject->bSupersede)
|
||||
{
|
||||
siCObject->dwAttributes &= ~SIC_SELECTED;
|
||||
siCObject->dwAttributes |= SIC_DISABLED;
|
||||
siCObject->dwAttributes |= SIC_INVISIBLE;
|
||||
}
|
||||
else
|
||||
/* Make sure to unset the DISABLED bit. If the Setup Type is other than
|
||||
* Custom, then we don't care if it's DISABLED or not because this flag
|
||||
* is only used in the Custom dialogs.
|
||||
*
|
||||
* If the Setup Type is Custom and this component is DISABLED by default
|
||||
* via the config.ini, it's default value will be restored in the
|
||||
* SiCNodeSetItemsSelected() function that called ResolveSupersede(). */
|
||||
siCObject->dwAttributes &= ~SIC_DISABLED;
|
||||
}
|
||||
|
||||
BOOL ResolveSupersede(siC *siCObject, greInfo *aGre)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szFilePath[MAX_BUF];
|
||||
char szSupersedeFile[MAX_BUF];
|
||||
char szSupersedeVersion[MAX_BUF];
|
||||
char szType[MAX_BUF_TINY];
|
||||
char szKey[MAX_BUF_TINY];
|
||||
verBlock vbVersionNew;
|
||||
verBlock vbFileVersion;
|
||||
|
||||
siCObject->bSupersede = FALSE;
|
||||
if(siCObject->dwAttributes & SIC_SUPERSEDE)
|
||||
{
|
||||
dwIndex = 0;
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, "SupersedeType", "", szType, sizeof(szType));
|
||||
if(*szType !='\0')
|
||||
{
|
||||
if(lstrcmpi(szType, "File Exists") == 0)
|
||||
{
|
||||
wsprintf(szKey, "SupersedeFile%d", dwIndex);
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, szKey, "", szSupersedeFile, sizeof(szSupersedeFile));
|
||||
while(*szSupersedeFile != '\0')
|
||||
{
|
||||
DecryptString(szFilePath, szSupersedeFile);
|
||||
if(FileExists(szFilePath))
|
||||
{
|
||||
wsprintf(szKey, "SupersedeMinVersion%d",dwIndex);
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, szKey, "", szSupersedeVersion, sizeof(szSupersedeVersion));
|
||||
if(*szSupersedeVersion != '\0')
|
||||
{
|
||||
if(GetFileVersion(szFilePath,&vbFileVersion))
|
||||
{
|
||||
/* If we can get the version, and it is greater than or equal to the SupersedeVersion
|
||||
* set supersede. If we cannot get the version, do not supersede the file. */
|
||||
TranslateVersionStr(szSupersedeVersion, &vbVersionNew);
|
||||
if(CompareVersion(vbFileVersion,vbVersionNew) >= 0)
|
||||
{
|
||||
siCObject->bSupersede = TRUE;
|
||||
break; /* Found at least one file, so break out of while loop */
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* The file exists, and there's no version to check. set Supersede */
|
||||
siCObject->bSupersede = TRUE;
|
||||
break; /* Found at least one file, so break out of while loop */
|
||||
}
|
||||
}
|
||||
wsprintf(szKey, "SupersedeFile%d", ++dwIndex);
|
||||
GetConfigIniProfileString(siCObject->szReferenceName, szKey, "", szSupersedeFile, sizeof(szSupersedeFile));
|
||||
}
|
||||
}
|
||||
else if(lstrcmpi(szType, "GRE") == 0)
|
||||
{
|
||||
/* save the GRE component */
|
||||
aGre->siCGreComponent = siCObject;
|
||||
|
||||
/* If -fgre is passed in, and the current product to install is !GRE,
|
||||
* and the current component is 'Component GRE' then select and
|
||||
* disable it to force it to be installed regardless of supersede
|
||||
* rules.
|
||||
*
|
||||
* If the product is GRE, then it won't have a 'Component GRE', but
|
||||
* rather a 'Component XPCOM', in which case it will always get
|
||||
* installed */
|
||||
if((gbForceInstallGre) && (lstrcmpi(sgProduct.szProductNameInternal, "GRE") != 0))
|
||||
{
|
||||
siCObject->dwAttributes |= SIC_SELECTED;
|
||||
siCObject->dwAttributes |= SIC_DISABLED;
|
||||
}
|
||||
else
|
||||
ResolveSupersedeGre(siCObject, aGre);
|
||||
}
|
||||
}
|
||||
|
||||
if(siCObject->bSupersede)
|
||||
{
|
||||
siCObject->dwAttributes &= ~SIC_SELECTED;
|
||||
siCObject->dwAttributes |= SIC_DISABLED;
|
||||
siCObject->dwAttributes |= SIC_INVISIBLE;
|
||||
}
|
||||
else
|
||||
/* Make sure to unset the DISABLED bit. If the Setup Type is other than
|
||||
* Custom, then we don't care if it's DISABLED or not because this flag
|
||||
* is only used in the Custom dialogs.
|
||||
*
|
||||
* If the Setup Type is Custom and this component is DISABLED by default
|
||||
* via the config.ini, it's default value will be restored in the
|
||||
* SiCNodeSetItemsSelected() function that called ResolveSupersede(). */
|
||||
siCObject->dwAttributes &= ~SIC_DISABLED;
|
||||
}
|
||||
return(siCObject->bSupersede);
|
||||
}
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _supersede_h
|
||||
#define _supersede_h
|
||||
|
||||
#include "setup.h"
|
||||
#include "version.h"
|
||||
|
||||
typedef struct structGreVer grever;
|
||||
struct structGreVer
|
||||
{
|
||||
char greHomePath[MAX_BUF];
|
||||
char greInstaller[MAX_BUF];
|
||||
char greUserAgent[MAX_BUF_TINY];
|
||||
verBlock version;
|
||||
grever *next;
|
||||
};
|
||||
|
||||
typedef struct structGreInfo greInfo;
|
||||
struct structGreInfo
|
||||
{
|
||||
char homePath[MAX_BUF];
|
||||
char installerAppPath[MAX_BUF];
|
||||
char userAgent[MAX_BUF_TINY];
|
||||
char uninstallerAppPath[MAX_BUF];
|
||||
verBlock minVersion;
|
||||
verBlock maxVersion;
|
||||
grever *greSupersedeList;
|
||||
grever *greInstalledList;
|
||||
siC *siCGreComponent;
|
||||
};
|
||||
|
||||
grever *CreateGVerNode(void);
|
||||
BOOL ResolveSupersede(siC *siCObject, greInfo *gre);
|
||||
void DeleteGverList(grever *gverHead);
|
||||
|
||||
#endif /* _supersede_h */
|
||||
@ -1,128 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "setup.h"
|
||||
#include "windows.h"
|
||||
#include "extern.h"
|
||||
#include "extra.h"
|
||||
#include "version.h"
|
||||
|
||||
BOOL GetFileVersion(LPSTR szFile, verBlock *vbVersion)
|
||||
{
|
||||
UINT uLen;
|
||||
UINT dwLen;
|
||||
BOOL bRv;
|
||||
DWORD dwHandle;
|
||||
LPVOID lpData;
|
||||
LPVOID lpBuffer;
|
||||
VS_FIXEDFILEINFO *lpBuffer2;
|
||||
|
||||
vbVersion->ullMajor = 0;
|
||||
vbVersion->ullMinor = 0;
|
||||
vbVersion->ullRelease = 0;
|
||||
vbVersion->ullBuild = 0;
|
||||
if(FileExists(szFile))
|
||||
{
|
||||
bRv = TRUE;
|
||||
dwLen = GetFileVersionInfoSize(szFile, &dwHandle);
|
||||
lpData = (LPVOID)malloc(sizeof(long)*dwLen);
|
||||
uLen = 0;
|
||||
|
||||
if(GetFileVersionInfo(szFile, dwHandle, dwLen, lpData) != 0)
|
||||
{
|
||||
if(VerQueryValue(lpData, "\\", &lpBuffer, &uLen) != 0)
|
||||
{
|
||||
lpBuffer2 = (VS_FIXEDFILEINFO *)lpBuffer;
|
||||
vbVersion->ullMajor = HIWORD(lpBuffer2->dwFileVersionMS);
|
||||
vbVersion->ullMinor = LOWORD(lpBuffer2->dwFileVersionMS);
|
||||
vbVersion->ullRelease = HIWORD(lpBuffer2->dwFileVersionLS);
|
||||
vbVersion->ullBuild = LOWORD(lpBuffer2->dwFileVersionLS);
|
||||
}
|
||||
}
|
||||
free(lpData);
|
||||
}
|
||||
else
|
||||
/* File does not exist */
|
||||
bRv = FALSE;
|
||||
|
||||
return(bRv);
|
||||
}
|
||||
|
||||
void TranslateVersionStr(LPSTR szVersion, verBlock *vbVersion)
|
||||
{
|
||||
LPSTR szNum1 = NULL;
|
||||
LPSTR szNum2 = NULL;
|
||||
LPSTR szNum3 = NULL;
|
||||
LPSTR szNum4 = NULL;
|
||||
|
||||
szNum1 = strtok(szVersion, ".");
|
||||
szNum2 = strtok(NULL, ".");
|
||||
szNum3 = strtok(NULL, ".");
|
||||
szNum4 = strtok(NULL, ".");
|
||||
|
||||
vbVersion->ullMajor = _atoi64(szNum1);
|
||||
vbVersion->ullMinor = _atoi64(szNum2);
|
||||
vbVersion->ullRelease = _atoi64(szNum3);
|
||||
vbVersion->ullBuild = _atoi64(szNum4);
|
||||
}
|
||||
|
||||
int CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew)
|
||||
{
|
||||
if(vbVersionOld.ullMajor > vbVersionNew.ullMajor)
|
||||
return(4);
|
||||
else if(vbVersionOld.ullMajor < vbVersionNew.ullMajor)
|
||||
return(-4);
|
||||
|
||||
if(vbVersionOld.ullMinor > vbVersionNew.ullMinor)
|
||||
return(3);
|
||||
else if(vbVersionOld.ullMinor < vbVersionNew.ullMinor)
|
||||
return(-3);
|
||||
|
||||
if(vbVersionOld.ullRelease > vbVersionNew.ullRelease)
|
||||
return(2);
|
||||
else if(vbVersionOld.ullRelease < vbVersionNew.ullRelease)
|
||||
return(-2);
|
||||
|
||||
if(vbVersionOld.ullBuild > vbVersionNew.ullBuild)
|
||||
return(1);
|
||||
else if(vbVersionOld.ullBuild < vbVersionNew.ullBuild)
|
||||
return(-1);
|
||||
|
||||
/* the versions are all the same */
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _version_h
|
||||
#define _version_h
|
||||
|
||||
typedef struct structVer
|
||||
{
|
||||
ULONGLONG ullMajor;
|
||||
ULONGLONG ullMinor;
|
||||
ULONGLONG ullRelease;
|
||||
ULONGLONG ullBuild;
|
||||
} verBlock;
|
||||
|
||||
void TranslateVersionStr(LPSTR szVersion, verBlock *vbVersion);
|
||||
BOOL GetFileVersion(LPSTR szFile, verBlock *vbVersion);
|
||||
int CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew);
|
||||
|
||||
#endif /* _version_h */
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 Navigator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _WIZVERREG_H_
|
||||
#define _WIZVERREG_H_
|
||||
|
||||
int VR_CreateRegistry(char *installation, char *programPath, char *versionStr);
|
||||
int VR_Install(char *component_path, char *filepath, char *version, int bDirectory);
|
||||
int VR_Close(void);
|
||||
|
||||
#endif /* _WIZVERREG_H_ */
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _XPERR_H_
|
||||
#define _XPERR_H_
|
||||
|
||||
char *XpErrorList[] = {"0" , "OK",
|
||||
"-200", "BAD_PACKAGE_NAME",
|
||||
"-201", "UNEXPECTED_ERROR",
|
||||
"-202", "ACCESS_DENIED",
|
||||
"-203", "EXECUTION_ERROR",
|
||||
"-204", "NO_INSTALL_SCRIPT",
|
||||
"-205", "NO_CERTIFICATE",
|
||||
"-206", "NO_MATCHING_CERTIFICATE",
|
||||
"-207", "CANT_READ_ARCHIVE",
|
||||
"-208", "INVALID_ARGUMENTS",
|
||||
"-209", "ILLEGAL_RELATIVE_PATH",
|
||||
"-210", "USER_CANCELLED",
|
||||
"-211", "INSTALL_NOT_STARTED",
|
||||
"-212", "SILENT_MODE_DENIED",
|
||||
"-213", "NO_SUCH_COMPONENT",
|
||||
"-214", "DOES_NOT_EXIST",
|
||||
"-215", "READ_ONLY",
|
||||
"-216", "IS_DIRECTORY",
|
||||
"-217", "NETWORK_FILE_IS_IN_USE",
|
||||
"-218", "APPLE_SINGLE_ERR",
|
||||
"-219", "INVALID_PATH_ERR",
|
||||
"-220", "PATCH_BAD_DIFF",
|
||||
"-221", "PATCH_BAD_CHECKSUM_TARGET",
|
||||
"-222", "PATCH_BAD_CHECKSUM_RESULT",
|
||||
"-223", "UNINSTALL_FAILED",
|
||||
"-224", "PACKAGE_FOLDER_NOT_SET",
|
||||
"-225", "EXTRACTION_FAILED",
|
||||
"-226", "FILENAME_ALREADY_USED",
|
||||
"-227", "ABORT_INSTALL",
|
||||
"-228", "DOWNLOAD_ERROR",
|
||||
"-229", "SCRIPT_ERROR",
|
||||
"-230", "ALREADY_EXISTS",
|
||||
"-231", "IS_FILE",
|
||||
"-232", "SOURCE_DOES_NOT_EXIST",
|
||||
"-233", "SOURCE_IS_DIRECTORY",
|
||||
"-234", "SOURCE_IS_FILE",
|
||||
"-235", "INSUFFICIENT_DISK_SPACE",
|
||||
"-236", "FILENAME_TOO_LONG",
|
||||
"-237", "UNABLE_TO_LOCATE_LIB_FUNCTION",
|
||||
"-238", "UNABLE_TO_LOAD_LIBRARY",
|
||||
"-239", "CHROME_REGISTRY_ERROR",
|
||||
"-240", "MALFORMED_INSTALL",
|
||||
"-241", "KEY_ACCESS_DENIED",
|
||||
"-242", "KEY_DOES_NOT_EXIST",
|
||||
"-243", "VALUE_DOES_NOT_EXIST",
|
||||
"-299", "OUT_OF_MEMORY",
|
||||
"-322", "INIT_STUB_ERROR",
|
||||
"-5550", "GESTALT_UNKNOWN_ERR",
|
||||
"-5551", "GESTALT_INVALID_ARGUMENT",
|
||||
""};
|
||||
|
||||
#endif /* _XPERR_H_ */
|
||||
|
||||
@ -1,492 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
* Ben Goodger <ben@mozilla.org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "extern.h"
|
||||
#include "dialogs.h"
|
||||
#include "extra.h"
|
||||
#include "xpistub.h"
|
||||
#include "xpi.h"
|
||||
#include "xperr.h"
|
||||
#include "logging.h"
|
||||
#include "ifuncns.h"
|
||||
|
||||
#define BDIR_RIGHT 1
|
||||
#define BDIR_LEFT 2
|
||||
|
||||
typedef HRESULT (_cdecl *XpiInit)(const char *, const char *aLogName, pfnXPIProgress);
|
||||
typedef HRESULT (_cdecl *XpiInstall)(const char *, const char *, long);
|
||||
typedef void (_cdecl *XpiExit)(void);
|
||||
typedef BOOL (WINAPI *SetDllPathProc)(const char*);
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
typedef HANDLE (WINAPI *FnCreateActCtxA)(PCACTCTXA pActCtx);
|
||||
typedef BOOL (WINAPI *FnActivateActCtx)(HANDLE hActCtx, ULONG_PTR* lpCookie);
|
||||
typedef BOOL (WINAPI *FnDeactivateActCtx)(DWORD dwFlags, ULONG_PTR ulCookie);
|
||||
typedef VOID (WINAPI *FnReleaseActCtx)(HANDLE hActCtx);
|
||||
|
||||
ACTCTXA actctx;
|
||||
HANDLE hActCtx = INVALID_HANDLE_VALUE;
|
||||
ULONG_PTR ulpActivationCookie;
|
||||
|
||||
static FnCreateActCtxA pfnCreateActCtxA = NULL;
|
||||
static FnActivateActCtx pfnActivateActCtx = NULL;
|
||||
static FnDeactivateActCtx pfnDeactivateActCtx = NULL;
|
||||
static FnReleaseActCtx pfnReleaseActCtx = NULL;
|
||||
#endif
|
||||
|
||||
static XpiInit pfnXpiInit;
|
||||
static XpiInstall pfnXpiInstall;
|
||||
static XpiExit pfnXpiExit;
|
||||
static SetDllPathProc pfnSetDllPath = NULL;
|
||||
|
||||
static long lFileCounter;
|
||||
static long lBarberCounter;
|
||||
static DWORD dwCurrentFile;
|
||||
static DWORD dwTotalFiles;
|
||||
char szStrProcessingFile[MAX_BUF];
|
||||
char szStrCopyingFile[MAX_BUF];
|
||||
char szStrInstalling[MAX_BUF];
|
||||
static char gSavedCwd[MAX_BUF];
|
||||
|
||||
static void UpdateArchiveInstallProgress(int aValue);
|
||||
|
||||
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 *xpinstallPath)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szXPIStubFile[MAX_BUF];
|
||||
char szEGetProcAddress[MAX_BUF];
|
||||
HANDLE hKernel;
|
||||
|
||||
hXPIStubInst = NULL;
|
||||
GetCurrentDirectory(sizeof(gSavedCwd), gSavedCwd);
|
||||
|
||||
if(!GetPrivateProfileString("Messages", "ERROR_GETPROCADDRESS", "", szEGetProcAddress, sizeof(szEGetProcAddress), szFileIniInstall))
|
||||
return(1);
|
||||
|
||||
/* change current directory to where xpistub.dll */
|
||||
SetCurrentDirectory(xpinstallPath);
|
||||
|
||||
/* Windows XP SP1 changed DLL search path strategy, setting current dir */
|
||||
/* is no longer sufficient. Use SetDLLDirectory() if available */
|
||||
if ((hKernel = LoadLibrary("kernel32.dll")) != NULL)
|
||||
{
|
||||
pfnSetDllPath = (SetDllPathProc)GetProcAddress(hKernel, "SetDllDirectoryA");
|
||||
if (pfnSetDllPath)
|
||||
pfnSetDllPath(xpinstallPath);
|
||||
}
|
||||
|
||||
/* build full path to xpistub.dll */
|
||||
lstrcpy(szXPIStubFile, xpinstallPath);
|
||||
AppendBackSlash(szXPIStubFile, sizeof(szXPIStubFile));
|
||||
lstrcat(szXPIStubFile, "xpistub.dll");
|
||||
|
||||
if(FileExists(szXPIStubFile) == FALSE)
|
||||
return(2);
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
/* Windows XP + Visual C++ 8 requires proper
|
||||
* Side by Side configuration, which means
|
||||
* we have to have a manifest to create an
|
||||
* Activation Context so we can locate the
|
||||
* VC8 runtime.
|
||||
*/
|
||||
if (hKernel != NULL &&
|
||||
(pfnCreateActCtxA = (FnCreateActCtxA)GetProcAddress(hKernel, "CreateActCtxA")) != NULL &&
|
||||
(pfnActivateActCtx = (FnActivateActCtx)GetProcAddress(hKernel, "ActivateActCtx")) != NULL &&
|
||||
(pfnDeactivateActCtx = (FnDeactivateActCtx)GetProcAddress(hKernel, "DeactivateActCtx")) != NULL &&
|
||||
(pfnReleaseActCtx = (FnReleaseActCtx)GetProcAddress(hKernel, "ReleaseActCtx")) != NULL)
|
||||
{
|
||||
memset(&actctx, 0, sizeof(actctx));
|
||||
actctx.cbSize = sizeof(actctx);
|
||||
actctx.lpSource = (LPCSTR)szXPIStubFile;
|
||||
actctx.lpResourceName = MAKEINTRESOURCE(17);
|
||||
actctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;
|
||||
|
||||
hActCtx = pfnCreateActCtxA(&actctx);
|
||||
|
||||
if (hActCtx == INVALID_HANDLE_VALUE)
|
||||
return(2); /* XXX: is this a good return value? */
|
||||
|
||||
if (!pfnActivateActCtx(hActCtx, &ulpActivationCookie))
|
||||
{
|
||||
pfnReleaseActCtx(hActCtx);
|
||||
return(2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 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 _MSC_VER >= 1400
|
||||
if (pfnDeactivateActCtx)
|
||||
{
|
||||
pfnDeactivateActCtx(0, ulpActivationCookie);
|
||||
pfnReleaseActCtx(hActCtx);
|
||||
}
|
||||
|
||||
pfnCreateActCtxA = NULL;
|
||||
pfnActivateActCtx = NULL;
|
||||
pfnDeactivateActCtx = NULL;
|
||||
pfnReleaseActCtx = NULL;
|
||||
#endif
|
||||
|
||||
if(hXPIStubInst)
|
||||
FreeLibrary(hXPIStubInst);
|
||||
|
||||
chdir(szSetupDir);
|
||||
if (pfnSetDllPath)
|
||||
pfnSetDllPath(NULL);
|
||||
|
||||
SetCurrentDirectory(gSavedCwd);
|
||||
return(0);
|
||||
}
|
||||
|
||||
void GetTotalArchivesToInstall(void)
|
||||
{
|
||||
DWORD i = 0;
|
||||
siC *siCObject = NULL;
|
||||
|
||||
dwTotalFiles = 0;
|
||||
|
||||
siCObject = SiCNodeGetObject(i, TRUE, AC_ALL);
|
||||
while (siCObject) {
|
||||
if ((siCObject->dwAttributes & SIC_SELECTED) &&
|
||||
!(siCObject->dwAttributes & SIC_LAUNCHAPP))
|
||||
dwTotalFiles += siCObject->iFileCount;
|
||||
|
||||
siCObject = SiCNodeGetObject(++i, TRUE, AC_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
char *GetErrorString(DWORD dwError, char *szErrorString, DWORD dwErrorStringSize)
|
||||
{
|
||||
int i = 0;
|
||||
char szErrorNumber[MAX_BUF];
|
||||
|
||||
ZeroMemory(szErrorString, dwErrorStringSize);
|
||||
itoa(dwError, szErrorNumber, 10);
|
||||
|
||||
/* map the error value to a string */
|
||||
while(TRUE)
|
||||
{
|
||||
if(*XpErrorList[i] == '\0')
|
||||
break;
|
||||
|
||||
if(lstrcmpi(szErrorNumber, XpErrorList[i]) == 0)
|
||||
{
|
||||
if(*XpErrorList[i + 1] != '\0')
|
||||
lstrcpy(szErrorString, XpErrorList[i + 1]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
return(szErrorString);
|
||||
}
|
||||
|
||||
HRESULT SmartUpdateJars(HWND aWizardPanel)
|
||||
{
|
||||
DWORD i = 0;
|
||||
siC *siCObject = NULL;
|
||||
HRESULT hrResult;
|
||||
char szBuf[MAX_BUF];
|
||||
char szEXpiInstall[MAX_BUF];
|
||||
char szArchive[MAX_BUF];
|
||||
char szMsgSmartUpdateStart[MAX_BUF];
|
||||
char szDlgExtractingTitle[MAX_BUF];
|
||||
char xpinstallPath[MAX_BUF];
|
||||
char xpiArgs[MAX_BUF];
|
||||
|
||||
// Save the handle to the dialog window so the installer procedures
|
||||
// can send messages to it.
|
||||
dlgInfo.hWndDlg = aWizardPanel;
|
||||
|
||||
if (!GetPrivateProfileString("Messages", "DLG_EXTRACTING_TITLE",
|
||||
"", szDlgExtractingTitle,
|
||||
sizeof(szDlgExtractingTitle),
|
||||
szFileIniInstall))
|
||||
return 1;
|
||||
|
||||
if (!GetPrivateProfileString("Messages", "STR_PROCESSINGFILE",
|
||||
"", szStrProcessingFile,
|
||||
sizeof(szStrProcessingFile),
|
||||
szFileIniInstall) ||
|
||||
!GetPrivateProfileString("Messages", "STR_INSTALLING",
|
||||
"", szStrInstalling,
|
||||
sizeof(szStrInstalling),
|
||||
szFileIniInstall) ||
|
||||
!GetPrivateProfileString("Messages", "STR_COPYINGFILE",
|
||||
"", szStrCopyingFile,
|
||||
sizeof(szStrCopyingFile),
|
||||
szFileIniInstall))
|
||||
exit(1);
|
||||
|
||||
GetXpinstallPath(xpinstallPath, sizeof(xpinstallPath));
|
||||
if(InitializeXPIStub(xpinstallPath) == WIZ_OK)
|
||||
{
|
||||
LogISXPInstall(W_START);
|
||||
lstrcpy(szBuf, sgProduct.szPath);
|
||||
if(*sgProduct.szSubPath != '\0')
|
||||
{
|
||||
AppendBackSlash(szBuf, sizeof(szBuf));
|
||||
lstrcat(szBuf, sgProduct.szSubPath);
|
||||
}
|
||||
hrResult = pfnXpiInit(szBuf, FILE_INSTALL_LOG, cbXPIProgress);
|
||||
|
||||
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS0, szMsgSmartUpdateStart);
|
||||
|
||||
GetTotalArchivesToInstall();
|
||||
|
||||
SendDlgItemMessage(dlgInfo.hWndDlg, IDC_PROGRESS_ARCHIVE, PBM_SETRANGE,
|
||||
0, MAKELPARAM(0, dwTotalFiles));
|
||||
|
||||
dwCurrentFile = 0;
|
||||
siCObject = SiCNodeGetObject(i, TRUE, AC_ALL);
|
||||
while (siCObject) {
|
||||
if(siCObject->dwAttributes & SIC_SELECTED)
|
||||
/* Since the archive is selected, we need to process the file ops here */
|
||||
ProcessFileOps(T_PRE_ARCHIVE, siCObject->szReferenceName);
|
||||
|
||||
/* launch smartupdate engine for earch jar to be installed */
|
||||
if((siCObject->dwAttributes & SIC_SELECTED) &&
|
||||
!(siCObject->dwAttributes & SIC_LAUNCHAPP) &&
|
||||
!(siCObject->dwAttributes & SIC_DOWNLOAD_ONLY))
|
||||
{
|
||||
lFileCounter = 0;
|
||||
lBarberCounter = 0;
|
||||
dlgInfo.nFileBars = 0;
|
||||
|
||||
// We need to send this message otherwise the progress bars will paint
|
||||
// over the completion page for some unknown reason! -ben
|
||||
SendMessage(aWizardPanel, WM_PAINT, 0, 0);
|
||||
|
||||
lstrcpy(szArchive, sgProduct.szAlternateArchiveSearchPath);
|
||||
AppendBackSlash(szArchive, sizeof(szArchive));
|
||||
lstrcat(szArchive, siCObject->szArchiveName);
|
||||
if((*sgProduct.szAlternateArchiveSearchPath == '\0') || (!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(GetPrivateProfileString("Messages", "ERROR_FILE_NOT_FOUND", "", szEFileNotFound, sizeof(szEFileNotFound), szFileIniInstall))
|
||||
{
|
||||
wsprintf(szBuf, szEFileNotFound, szArchive);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wsprintf(szBuf, szStrInstalling, siCObject->szDescriptionShort);
|
||||
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS0, szBuf);
|
||||
LogISXPInstallComponent(siCObject->szDescriptionShort);
|
||||
|
||||
/* XXX fix: we need to better support passing arguments to .xpi files.
|
||||
* This is a temporary hack to get greType passed to browser.xpi so that
|
||||
* it won't delete GRE files if GRE is installed in the mozilla dir.
|
||||
*
|
||||
* What should be done is have the arguments be described in each
|
||||
* component's section in config.ini and have it passed thru here. */
|
||||
*xpiArgs = '\0';
|
||||
if(lstrcmpi(siCObject->szArchiveName, "gre.xpi") == 0)
|
||||
MozCopyStr(sgProduct.szRegPath, xpiArgs, sizeof(xpiArgs));
|
||||
else if((lstrcmpi(siCObject->szArchiveName, "browser.xpi") == 0) &&
|
||||
(sgProduct.greType == GRE_LOCAL))
|
||||
/* passing -greShared to browser.xpi will tell it to cleanup GRE files
|
||||
* from it's directory if they exist. */
|
||||
MozCopyStr("-greLocal", xpiArgs, sizeof(xpiArgs));
|
||||
|
||||
hrResult = pfnXpiInstall(szArchive, xpiArgs, 0xFFFF);
|
||||
if(hrResult == E_REBOOT)
|
||||
bReboot = TRUE;
|
||||
else if((hrResult != WIZ_OK) &&
|
||||
!(siCObject->dwAttributes & SIC_IGNORE_XPINSTALL_ERROR))
|
||||
{
|
||||
LogMSXPInstallStatus(siCObject->szArchiveName, hrResult);
|
||||
LogISXPInstallComponentResult(hrResult);
|
||||
if(GetPrivateProfileString("Messages", "ERROR_XPI_INSTALL", "", szEXpiInstall, sizeof(szEXpiInstall), szFileIniInstall))
|
||||
{
|
||||
char szErrorString[MAX_BUF];
|
||||
|
||||
GetErrorString(hrResult, szErrorString, sizeof(szErrorString));
|
||||
wsprintf(szBuf, "%s - %s: %d %s", szEXpiInstall, siCObject->szDescriptionShort, hrResult, szErrorString);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
}
|
||||
|
||||
/* break out of the siCObject while loop */
|
||||
break;
|
||||
}
|
||||
|
||||
LogISXPInstallComponentResult(hrResult);
|
||||
|
||||
if((hrResult != WIZ_OK) &&
|
||||
(siCObject->dwAttributes & SIC_IGNORE_XPINSTALL_ERROR))
|
||||
/* reset the result to WIZ_OK if there was an error and the
|
||||
* component's attributes contains SIC_IGNORE_XPINSTALL_ERROR.
|
||||
* This should be done after LogISXPInstallComponentResult()
|
||||
* because we still should log the error value. */
|
||||
hrResult = WIZ_OK;
|
||||
}
|
||||
|
||||
if(siCObject->dwAttributes & SIC_SELECTED)
|
||||
/* Since the archive is selected, we need to do the file ops here */
|
||||
ProcessFileOps(T_POST_ARCHIVE, siCObject->szReferenceName);
|
||||
|
||||
siCObject = SiCNodeGetObject(++i, TRUE, AC_ALL);
|
||||
} /* while(siCObject) */
|
||||
|
||||
//report 100% progress status for successful installs
|
||||
UpdateGREInstallProgress(100);
|
||||
LogMSXPInstallStatus(NULL, hrResult);
|
||||
pfnXpiExit();
|
||||
}
|
||||
|
||||
DeInitializeXPIStub();
|
||||
LogISXPInstall(W_END);
|
||||
|
||||
return(hrResult);
|
||||
}
|
||||
|
||||
void cbXPIStart(const char *URL, const char *UIName)
|
||||
{
|
||||
}
|
||||
|
||||
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max)
|
||||
{
|
||||
char szFilename[MAX_BUF];
|
||||
char szStrProcessingFileBuf[MAX_BUF];
|
||||
char szStrCopyingFileBuf[MAX_BUF];
|
||||
|
||||
if(sgProduct.mode != SILENT)
|
||||
{
|
||||
ParsePath((char *)msg, szFilename, sizeof(szFilename), FALSE, PP_FILENAME_ONLY);
|
||||
|
||||
dlgInfo.nFileBars = 0;
|
||||
|
||||
// XXXben this is a really nasty hack. We shouldn't be parsing the msg value
|
||||
// to find out what sort of progress notification this is. Really, the installer
|
||||
// listener system needs to be rearchitected to send out a message type (int)
|
||||
// and a message value, and the listeners can synthesize a display message if
|
||||
// they want to. As it stands, the strings that are used here are NOT localizable
|
||||
// (hard coded over in mozilla/xpinstall/src), which blows dead goats through
|
||||
// straws.
|
||||
if ((!strncmp(msg, "Installing: ", 12) ||
|
||||
!strncmp(msg, "Replacing: ", 11))
|
||||
&& (max != 0 && val <= max)) {
|
||||
++dwCurrentFile;
|
||||
|
||||
UpdateArchiveInstallProgress((int)dwCurrentFile);
|
||||
UpdateGREInstallProgress((int)dwCurrentFile);
|
||||
}
|
||||
|
||||
ProcessWindowsMessages();
|
||||
}
|
||||
}
|
||||
|
||||
void cbXPIFinal(const char *URL, PRInt32 finalStatus)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Update the Archive Progress Bar to the specified percentage.
|
||||
static void UpdateArchiveInstallProgress(int aValue)
|
||||
{
|
||||
if (sgProduct.mode != SILENT) {
|
||||
SendDlgItemMessage(dlgInfo.hWndDlg, IDC_PROGRESS_ARCHIVE, PBM_SETPOS,
|
||||
(WPARAM)aValue, 0);
|
||||
Sleep(5);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _XPI_H_
|
||||
#define _XPI_H_
|
||||
|
||||
HRESULT InitializeXPIStub(char *xpinstallPath);
|
||||
HRESULT DeInitializeXPIStub(void);
|
||||
HRESULT SmartUpdateJars(HWND aWizardPanel);
|
||||
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);
|
||||
char *GetErrorString(DWORD dwError, char *szErrorString, DWORD dwErrorStringSize);
|
||||
|
||||
#endif /* _XPI_H_ */
|
||||
|
||||
@ -1,134 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
//#include "nsError.h"
|
||||
//#include "prtypes.h"
|
||||
|
||||
#ifdef XP_MAC
|
||||
#include <Files.h>
|
||||
#endif
|
||||
|
||||
#define nsresult long
|
||||
|
||||
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 aXPIStubDir [MAC only] directory of the xpistub shlb off of which
|
||||
* the component manager derives the components directory.
|
||||
* @param aProgramDir 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& aXPIStubDir,
|
||||
const FSSpec& aProgramDir,
|
||||
#else
|
||||
const char* aProgramDir,
|
||||
#endif
|
||||
const char* aLogName,
|
||||
pfnXPIProgress progressCB);
|
||||
|
||||
/** 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
|
||||
*
|
||||
* @returns status Status from the installed archive
|
||||
*/
|
||||
PR_EXTERN(PRInt32) 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
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 Navigator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corp.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _XPNETHOOK_H_
|
||||
#define _XPNETHOOK_H_
|
||||
|
||||
int WGet(char *szUrl,
|
||||
char *szFile,
|
||||
char *szProxyServer,
|
||||
char *szProxyPort,
|
||||
char *szProxyUser,
|
||||
char *szProxyPasswd);
|
||||
int DownloadFiles(char *szInputIniFile,
|
||||
char *szDownloadDir,
|
||||
char *szProxyServer,
|
||||
char *szProxyPort,
|
||||
char *szProxyUser,
|
||||
char *szProxyPasswd,
|
||||
BOOL bShowRetryMsg,
|
||||
BOOL bIgnoreNetworkError,
|
||||
char *szFailedFile,
|
||||
DWORD dwFailedFileSize);
|
||||
|
||||
#endif /* _XPNETHOOK_H_ */
|
||||
|
||||
@ -1,107 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#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 );
|
||||
|
||||
|
||||
/* Test the integrity of every item in this open archive
|
||||
* by verifying each item's checksum against the stored
|
||||
* CRC32 value.
|
||||
*/
|
||||
extern __declspec(dllexport)int ZIP_TestArchive( 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 */
|
||||
@ -1,80 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = setuprsc
|
||||
LIBRARY_NAME = setuprsc
|
||||
RESFILE = setuprsc.res
|
||||
|
||||
USE_STATIC_LIBS = 1
|
||||
|
||||
NO_DIST_INSTALL = 1
|
||||
|
||||
EXPORTS = setuprsc.h
|
||||
|
||||
CPPSRCS = setuprsc.cpp
|
||||
|
||||
GARBAGE += $(DIST)/install/$(SHARED_LIBRARY)
|
||||
GARBAGE_DIRS += $(DIST)/include/$(MODULE)
|
||||
|
||||
FORCE_SHARED_LIB=1
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
DEFINES += -DAPP_ICO=\"$(DIST)/branding/app.ico\" -DWATERMRK_BMP=\"$(DIST)/branding/Watermrk.bmp\" -DHEADER_BMP=\"$(DIST)/branding/Header.bmp\"
|
||||
|
||||
|
||||
# Hack to get around the default rules insisting that .lib should exist
|
||||
$(IMPORT_LIBRARY):
|
||||
touch $@
|
||||
|
||||
export:: $(EXPORTS)
|
||||
$(INSTALL) $< $(DIST)/include/$(MODULE)/
|
||||
|
||||
libs:: $(SHARED_LIBRARY)
|
||||
$(INSTALL) $< $(DIST)/install
|
||||
|
||||
install:: $(SHARED_LIBRARY)
|
||||
$(INSTALL) $< $(DESTDIR)$(mozappdir)/install
|
||||
|
||||
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 206 B |
|
Before Width: | Height: | Size: 206 B |
|
Before Width: | Height: | Size: 206 B |
@ -1,5 +0,0 @@
|
||||
echo "Comparing Resource Headers..."
|
||||
echo off
|
||||
diff -wbu setuprsc.good setuprsc.h > checkrsc.diff
|
||||
notepad checkrsc.diff
|
||||
del checkrsc.diff
|
||||
|
Before Width: | Height: | Size: 76 KiB |
@ -1,44 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
int FAR PASCAL LibMain(HINSTANCE hInstance, WORD wDataSeg, WORD cbHeapSize, LPSTR lpCmdLine)
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
@ -1,163 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by setuprsc.rc
|
||||
//
|
||||
#define IDS_ERROR_FILE_NOT_FOUND 3
|
||||
#define IDRESUME 3
|
||||
#define IDPAUSE 4
|
||||
#define IDS_MSG_RETRIEVE_INSTALLINI 11
|
||||
#define IDI_SETUP 105
|
||||
#define IDI_APP 106
|
||||
#define IDB_BITMAP_WELCOME 108
|
||||
#define DLG_MESSAGE 110
|
||||
#define IDB_BITMAP_BANNER 114
|
||||
#define IDB_QUICK_LAUNCH 115
|
||||
#define IDB_HEADER 116
|
||||
#define IDB_WATERMARK 117
|
||||
#define DLG_SELECT_INSTALL_PATH 118
|
||||
#define DLG_BROWSE_DIR 503
|
||||
#define IDC_STATUS 1001
|
||||
#define IDC_STATUS1 1001
|
||||
#define ID_DELETE 1001
|
||||
#define IDC_STATUS_URL 1001
|
||||
#define IDCONTINUE 1001
|
||||
#define IDC_GAUGE 1002
|
||||
#define IDC_PROGRESS_FILE 1002
|
||||
#define ID_IGNORE 1002
|
||||
#define IDSKIP 1002
|
||||
#define IDC_STATUS2 1003
|
||||
#define IDC_STATUS_URL2 1003
|
||||
#define IDC_STATUS_TO 1003
|
||||
#define IDC_STATUS0 1004
|
||||
#define IDC_STATUS3 1005
|
||||
#define ID_YES_TO_ALL 1005
|
||||
#define IDC_STATUS_URL3 1005
|
||||
#define IDC_PROGRESS_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_CURRENT_SETTINGS 1026
|
||||
#define IDC_LIST_COMPONENTS 1027
|
||||
#define IDC_LIST_SUBCOMPONENTS 1029
|
||||
#define IDC_STATIC_DRIVE_SPACE_REQUIRED 1030
|
||||
#define IDC_SPACE_AVAILABLE 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_STATIC3 1036
|
||||
#define IDC_STATIC4 1037
|
||||
#define IDC_PERCENTAGE 1038
|
||||
#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_MESSAGE2 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 IDC_BUTTON1 1055
|
||||
#define IDC_README 1055
|
||||
#define IDC_BUTTON_SITE_SELECTOR 1055
|
||||
#define IDC_CONNECTION_SETTINGS 1056
|
||||
#define IDC_DOWNLOAD_SIZE 1058
|
||||
#define IDC_SITE_SELECTOR 1059
|
||||
#define IDC_LIST_SITE_SELECTOR 1059
|
||||
#define IDC_CHECK_SAVE_INSTALLER 1061
|
||||
#define IDC_CHECK_SAVE_INSTALLER_FILES 1061
|
||||
#define IDC_EDIT_PROXY_SERVER 1062
|
||||
#define IDC_EDIT_PROXY_PORT 1063
|
||||
#define IDC_TAB1 1064
|
||||
#define IDC_EDIT_PROXY_USER 1064
|
||||
#define IDC_DELETE_PATH 1065
|
||||
#define IDC_EDIT_PROXY_PASSWD 1065
|
||||
#define IDC_LOCAL_INSTALLER_PATH 1066
|
||||
#define IDC_EDIT_LOCAL_INSTALLER_PATH 1066
|
||||
#define IDC_BUTTON_ADDITIONAL_SETTINGS 1067
|
||||
#define IDC_BUTTON_PROXY_SETTINGS 1067
|
||||
#define IDC_STATUS_FILE 1070
|
||||
#define IDC_STATUS_STATUS 1071
|
||||
#define IDC_USE_HTTP 1073
|
||||
#define IDC_USE_FTP 1074
|
||||
#define IDC_DESTINATION 1074
|
||||
#define IDC_CHECK_TURBO_MODE 1075
|
||||
#define IDC_CHECK_RECAPTURE_HOMEPAGE 1076
|
||||
#define IDC_STATIC_MSG1 1079
|
||||
#define IDC_STATIC_TITLE 1080
|
||||
#define IDC_RADIO_ACCEPT 1081
|
||||
#define IDC_RADIO_DECLINE 1082
|
||||
#define IDC_FOLDER_ICON 1083
|
||||
#define IDC_PRIMARY_COMPONENT 1084
|
||||
#define IDC_OPTIONAL_COMPONENTS 1085
|
||||
#define IDC_INSTALL_FOLDER 1086
|
||||
#define IDC_INSTALL_FOLDER_LABEL 1087
|
||||
#define IDC_STATIC_DOWNLOAD_SIZE 1088
|
||||
#define DLG_INSTALL_SUCCESSFUL 1089
|
||||
#define IDC_START_APP 1090
|
||||
#define IDC_MESSAGE_UPGRADE 1091
|
||||
#define IDC_CHECK_SAFE_INSTALL 1092
|
||||
#define IDC_MESSAGE_INFO 1093
|
||||
#define IDC_APP_ICON 1094
|
||||
#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_QUICK_LAUNCH 2010
|
||||
#define DLG_RESTART 10206
|
||||
#define DLG_SITE_SELECTOR 10207
|
||||
#define DLG_ADVANCED_SETTINGS 10207
|
||||
#define DLG_SELECT_ADDITIONAL_COMPONENTS 10208
|
||||
#define DLG_UPGRADE 10209
|
||||
#define DLG_ADDITIONAL_OPTIONS 10210
|
||||
#define DLG_DOWNLOADING 10211
|
||||
#define DLG_START_INSTALL1 10212
|
||||
#define IDB_BOX_CHECKED 10304
|
||||
#define IDB_BOX_UNCHECKED 10306
|
||||
#define IDB_BOX_CHECKED_DISABLED 10307
|
||||
#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
|
||||
#define IDWIZBACK 11013
|
||||
#define IDWIZNEXT 11014
|
||||
#define IDS_MSG_CREATE_DIRECTORY 11015
|
||||
#define IDWIZNEXT2 11015
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 116
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1079
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@ -1,482 +0,0 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include <windows.h>
|
||||
#include "setuprsc.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#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
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
DLG_WELCOME DIALOG DISCARDABLE 51, 56, 317, 193
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL IDB_WATERMARK,IDC_STATIC,"Static",SS_BITMAP,0,0,497,313
|
||||
LTEXT "",IDC_STATIC_TITLE,130,8,180,18,NOT WS_GROUP
|
||||
LTEXT "",IDC_STATIC1,130,58,180,24,NOT WS_GROUP
|
||||
LTEXT "",IDC_STATIC2,130,90,180,37,NOT WS_GROUP
|
||||
LTEXT "",IDC_STATIC3,130,169,180,18
|
||||
LTEXT "",IDC_STATIC0,130,34,180,16,NOT WS_GROUP
|
||||
END
|
||||
|
||||
DLG_SETUP_TYPE DIALOG DISCARDABLE 51, 56, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_RADIO_ST0,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_TABSTOP,21,29,65,12
|
||||
CONTROL "",IDC_RADIO_ST1,"Button",BS_AUTORADIOBUTTON,21,57,65,12
|
||||
LTEXT "",IDC_STATIC_ST0_DESCRIPTION,32,44,263,12
|
||||
LTEXT "",IDC_STATIC_ST1_DESCRIPTION,32,72,263,24
|
||||
LTEXT "",IDC_STATIC_MSG0,11,8,294,17,NOT WS_GROUP
|
||||
END
|
||||
|
||||
DLG_SELECT_COMPONENTS DIALOG DISCARDABLE 51, 56, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LISTBOX IDC_LIST_COMPONENTS,11,28,295,42,LBS_OWNERDRAWFIXED |
|
||||
LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_GROUP | WS_TABSTOP
|
||||
LTEXT "",IDC_MESSAGE0,11,1,295,19,NOT WS_GROUP
|
||||
GROUPBOX "",IDC_STATIC2,11,75,295,37
|
||||
LTEXT "",IDC_STATIC_DESCRIPTION,18,87,282,16,SS_NOPREFIX
|
||||
RTEXT "",IDC_STATIC_DOWNLOAD_SIZE,140,120,164,8
|
||||
END
|
||||
|
||||
DLG_WINDOWS_INTEGRATION DIALOG DISCARDABLE 51, 56, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_CHECK0,"Button",BS_AUTOCHECKBOX | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,21,26,285,10
|
||||
CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,21,43,285,10
|
||||
CONTROL "",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,21,60,285,10
|
||||
LTEXT "",IDC_MESSAGE0,11,11,295,8,NOT WS_GROUP
|
||||
END
|
||||
|
||||
DLG_PROGRAM_FOLDER DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "",IDC_STATIC1,101,54,105,8
|
||||
EDITTEXT IDC_EDIT_PROGRAM_FOLDER,101,64,204,12,ES_AUTOHSCROLL
|
||||
LTEXT "",IDC_STATIC2,101,84,163,8
|
||||
LISTBOX IDC_LIST,101,94,204,79,LBS_SORT | LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "",IDWIZBACK,134,186,53,14
|
||||
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
|
||||
PUSHBUTTON "",IDCANCEL,252,186,53,14
|
||||
LTEXT "",IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP
|
||||
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 DIALOG DISCARDABLE 51, 56, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_RADIO_DECLINE,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_GROUP | WS_TABSTOP,11,122,295,9
|
||||
CONTROL "",IDC_RADIO_ACCEPT,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_TABSTOP,11,109,295,9
|
||||
EDITTEXT IDC_EDIT_LICENSE,11,29,295,72,ES_MULTILINE |
|
||||
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_GROUP
|
||||
LTEXT "",IDC_MESSAGE0,11,8,295,17,NOT WS_GROUP
|
||||
END
|
||||
|
||||
DLG_QUICK_LAUNCH DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_CHECK_TURBO_MODE,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,101,157,204,9
|
||||
PUSHBUTTON "",IDWIZBACK,134,186,53,14
|
||||
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
|
||||
PUSHBUTTON "",IDCANCEL,252,186,53,14
|
||||
LTEXT "",IDC_MESSAGE0,101,14,204,18,NOT WS_GROUP
|
||||
LTEXT "",IDC_MESSAGE1,101,50,204,20,NOT WS_GROUP
|
||||
LTEXT "",IDC_MESSAGE2,101,127,204,18,NOT WS_GROUP
|
||||
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
|
||||
CONTROL 115,IDC_STATIC,"Static",SS_BITMAP,102,76,20,20
|
||||
END
|
||||
|
||||
DLG_BROWSE_DIR DIALOG DISCARDABLE 147, 23, 190, 143
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "",1092,8,6,92,9
|
||||
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_NOREDRAW |
|
||||
LBS_OWNERDRAWFIXED | LBS_HASSTRINGS |
|
||||
LBS_DISABLENOSCROLL | WS_VSCROLL | WS_HSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "",1091,8,108,92,9
|
||||
COMBOBOX 1137,8,118,121,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
|
||||
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
DEFPUSHBUTTON "",1,135,43,50,14,WS_GROUP
|
||||
PUSHBUTTON "",IDCANCEL,135,63,50,14,WS_GROUP
|
||||
END
|
||||
|
||||
DLG_RESTART DIALOG FIXED IMPURE 133, 69, 255, 111
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "",202,10,10,236,36,SS_NOPREFIX
|
||||
CONTROL "",IDC_RADIO_YES,"Button",BS_AUTORADIOBUTTON,26,52,220,
|
||||
12
|
||||
CONTROL "",IDC_RADIO_NO,"Button",BS_AUTORADIOBUTTON,26,68,223,12
|
||||
DEFPUSHBUTTON "",IDOK,189,88,50,14,WS_GROUP
|
||||
END
|
||||
|
||||
DLG_MESSAGE DIALOG DISCARDABLE 0, 0, 236, 34
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CTEXT "",IDC_MESSAGE,0,0,236,34,SS_CENTERIMAGE
|
||||
END
|
||||
|
||||
DLG_EXTRACTING DIALOG DISCARDABLE 0, 0, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_STATUS0,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX |
|
||||
WS_GROUP,11,72,295,8
|
||||
CONTROL "Progress1",IDC_PROGRESS_ARCHIVE,"msctls_progress32",
|
||||
WS_BORDER,11,85,295,11
|
||||
END
|
||||
|
||||
DLG_ADVANCED_SETTINGS DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDIT_PROXY_SERVER,165,57,134,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_PROXY_PORT,165,74,134,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_PROXY_USER,165,101,134,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_PROXY_PASSWD,165,118,134,12,ES_PASSWORD |
|
||||
ES_AUTOHSCROLL
|
||||
CONTROL "",IDC_USE_FTP,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
101,148,205,9
|
||||
CONTROL "",IDC_USE_HTTP,"Button",BS_AUTORADIOBUTTON,101,161,205,
|
||||
9
|
||||
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
|
||||
PUSHBUTTON "",IDCANCEL,252,186,53,14
|
||||
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
|
||||
RTEXT "",IDC_STATIC1,108,59,52,9
|
||||
RTEXT "",IDC_STATIC2,108,75,52,9
|
||||
GROUPBOX "",IDC_STATIC,101,44,206,94
|
||||
LTEXT "",IDC_MESSAGE0,101,11,204,29,NOT WS_GROUP
|
||||
RTEXT "",IDC_STATIC3,108,102,52,9
|
||||
RTEXT "",IDC_STATIC4,108,120,52,9
|
||||
END
|
||||
|
||||
DLG_SELECT_ADDITIONAL_COMPONENTS DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "",IDC_STATIC1,101,32,125,8
|
||||
LISTBOX IDC_LIST_COMPONENTS,101,42,204,67,LBS_OWNERDRAWFIXED |
|
||||
LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "",IDWIZBACK,134,186,53,14
|
||||
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
|
||||
PUSHBUTTON "",IDCANCEL,252,186,53,14
|
||||
LTEXT "",IDC_MESSAGE0,101,10,204,19,NOT WS_GROUP
|
||||
GROUPBOX "",IDC_STATIC2,101,115,204,22
|
||||
LTEXT "",IDC_STATIC_DESCRIPTION,106,124,195,8,SS_NOPREFIX
|
||||
GROUPBOX "",IDC_STATIC,101,140,204,33
|
||||
LTEXT "",IDC_DOWNLOAD_SIZE,105,160,92,8,NOT WS_GROUP
|
||||
LTEXT "",IDC_SPACE_AVAILABLE,206,160,94,8,NOT WS_GROUP
|
||||
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
|
||||
LTEXT "",IDC_STATIC,241,32,63,8,0,WS_EX_RIGHT
|
||||
LTEXT "",IDC_STATIC3,105,148,92,9
|
||||
LTEXT "",IDC_STATIC4,206,148,94,9
|
||||
END
|
||||
|
||||
DLG_UPGRADE DIALOG DISCARDABLE 51, 56, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "",IDC_MESSAGE_UPGRADE,11,1,295,9,NOT WS_GROUP
|
||||
CONTROL "",IDC_EDIT_DESTINATION,"Static",SS_LEFTNOWORDWRAP |
|
||||
WS_GROUP,43,24,205,9
|
||||
ICON "",IDC_FOLDER_ICON,28,22,20,20
|
||||
CONTROL "",IDC_CHECK_SAFE_INSTALL,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,21,71,285,10
|
||||
LTEXT "",IDC_MESSAGE_INFO,33,87,271,30
|
||||
END
|
||||
|
||||
DLG_ADDITIONAL_OPTIONS DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_CHECK_RECAPTURE_HOMEPAGE,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,100,56,202,8
|
||||
LTEXT "",IDC_MESSAGE1,100,76,204,33,NOT WS_GROUP
|
||||
CONTROL "",IDC_CHECK_SAVE_INSTALLER_FILES,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,100,112,204,9
|
||||
EDITTEXT IDC_EDIT_LOCAL_INSTALLER_PATH,100,124,204,12,
|
||||
ES_AUTOHSCROLL | ES_READONLY
|
||||
PUSHBUTTON "",IDC_BUTTON_PROXY_SETTINGS,221,159,84,14
|
||||
PUSHBUTTON "",IDWIZBACK,134,186,53,14
|
||||
DEFPUSHBUTTON "",IDWIZNEXT,188,186,53,14
|
||||
PUSHBUTTON "",IDCANCEL,252,186,53,14
|
||||
LTEXT "",IDC_MESSAGE0,100,20,204,33,NOT WS_GROUP
|
||||
CONTROL 108,-1,"Static",SS_BITMAP,11,11,83,162,WS_EX_CLIENTEDGE
|
||||
CONTROL "",-1,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
DLG_DOWNLOADING DIALOG DISCARDABLE 0, 0, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "",IDPAUSE,256,106,50,14,WS_GROUP
|
||||
LTEXT "",IDC_MESSAGE0,9,39,293,23
|
||||
LTEXT "",IDC_STATIC1,11,108,37,8,SS_NOPREFIX
|
||||
CONTROL "",IDC_STATUS_STATUS,"Static",SS_LEFTNOWORDWRAP |
|
||||
SS_NOPREFIX | WS_GROUP,51,108,198,8
|
||||
LTEXT "",IDC_STATIC2,11,72,37,8,SS_NOPREFIX
|
||||
CONTROL "",IDC_STATUS_FILE,"Static",SS_LEFTNOWORDWRAP |
|
||||
SS_NOPREFIX | WS_GROUP,51,72,254,8
|
||||
LTEXT "",IDC_PERCENTAGE,283,115,20,8,SS_NOPREFIX
|
||||
CONTROL "",IDC_PROGRESS_FILE,"msctls_progress32",WS_BORDER,11,85,
|
||||
295,11
|
||||
END
|
||||
|
||||
DLG_START_INSTALL DIALOG DISCARDABLE 51, 56, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CLASS "MozillaSetupDlg"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "",IDC_MESSAGE0,11,1,295,8,NOT WS_GROUP
|
||||
LTEXT "",IDC_MESSAGE1,11,130,295,8
|
||||
PUSHBUTTON "",IDC_CONNECTION_SETTINGS,250,103,56,14
|
||||
LTEXT "",IDC_MESSAGE2,11,103,232,19
|
||||
LTEXT "",IDC_PRIMARY_COMPONENT,36,16,270,8,NOT WS_GROUP
|
||||
LTEXT "",IDC_OPTIONAL_COMPONENTS,41,31,265,28,NOT WS_GROUP
|
||||
LTEXT "",IDC_INSTALL_FOLDER,36,81,270,8,NOT WS_GROUP
|
||||
LTEXT "",IDC_INSTALL_FOLDER_LABEL,11,66,295,8,NOT WS_GROUP
|
||||
ICON "",IDC_APP_ICON,21,14,20,20
|
||||
ICON "",IDC_FOLDER_ICON,21,77,20,20
|
||||
END
|
||||
|
||||
DLG_SELECT_INSTALL_PATH DIALOG DISCARDABLE 0, 0, 315, 143
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_EDIT_DESTINATION,"Static",SS_LEFTNOWORDWRAP |
|
||||
WS_GROUP,43,24,205,9
|
||||
PUSHBUTTON "",IDC_BUTTON_BROWSE,260,22,46,14
|
||||
LTEXT "",IDC_STATIC_MSG0,11,1,295,9
|
||||
ICON "",IDC_FOLDER_ICON,28,22,20,20
|
||||
END
|
||||
|
||||
DLG_INSTALL_SUCCESSFUL DIALOG DISCARDABLE 0, 0, 317, 193
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL IDB_WATERMARK,IDC_STATIC,"Static",SS_BITMAP,0,0,497,313
|
||||
LTEXT "",IDC_STATIC_TITLE,130,8,180,18,NOT WS_GROUP
|
||||
LTEXT "",IDC_STATIC1,130,169,180,15
|
||||
LTEXT "",IDC_STATIC0,130,34,180,16,NOT WS_GROUP
|
||||
CONTROL "",IDC_START_APP,"Button",BS_AUTOCHECKBOX | BS_NOTIFY |
|
||||
WS_TABSTOP,130,139,180,10
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_SETUP ICON DISCARDABLE "setup.ico"
|
||||
IDI_APP ICON DISCARDABLE APP_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"
|
||||
IDB_BOX_CHECKED_DISABLED BITMAP FIXED IMPURE "box_ch_d.bmp"
|
||||
IDB_BITMAP_BANNER BITMAP DISCARDABLE "downloadLogo.bmp"
|
||||
IDB_QUICK_LAUNCH BITMAP DISCARDABLE "turbo-systray.bmp"
|
||||
IDB_HEADER BITMAP DISCARDABLE HEADER_BMP
|
||||
IDB_WATERMARK BITMAP DISCARDABLE WATERMRK_BMP
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
DLG_WELCOME, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 315
|
||||
END
|
||||
|
||||
DLG_EXTRACTING, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 312
|
||||
BOTTOMMARGIN, 142
|
||||
END
|
||||
|
||||
DLG_UPGRADE, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 310
|
||||
BOTTOMMARGIN, 142
|
||||
END
|
||||
|
||||
DLG_DOWNLOADING, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 310
|
||||
END
|
||||
|
||||
DLG_START_INSTALL, DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 138
|
||||
END
|
||||
|
||||
DLG_SELECT_INSTALL_PATH, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 308
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 136
|
||||
END
|
||||
|
||||
DLG_INSTALL_SUCCESSFUL, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 310
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 184
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ERROR_FILE_NOT_FOUND "File not found: %s"
|
||||
IDS_MSG_RETRIEVE_INSTALLINI
|
||||
"Please wait while Setup is attempting to retrieve install.ini, required by Setup, from the Web..."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB |
@ -1,84 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (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/MPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = uninstall
|
||||
PROGRAM = uninstall$(BIN_SUFFIX)
|
||||
RESFILE = uninstall.res
|
||||
REQUIRES = $(ZLIB_REQUIRES)
|
||||
USE_STATIC_LIBS = 1
|
||||
|
||||
EXPORTS = logkeys.h
|
||||
|
||||
CSRCS = \
|
||||
uninstall.c \
|
||||
extra.c \
|
||||
dialogs.c \
|
||||
parser.c \
|
||||
ifuncns.c \
|
||||
rdi.c \
|
||||
process.c \
|
||||
$(NULL)
|
||||
|
||||
MOZ_WINCONSOLE = 0
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir)
|
||||
|
||||
ifdef GNU_CC
|
||||
OS_LIBS += -lshell32 -lversion
|
||||
else
|
||||
OS_LIBS += shell32.lib version.lib ole32.lib
|
||||
endif
|
||||
|
||||
NO_DIST_INSTALL = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
libs:: $(PROGRAM)
|
||||
$(INSTALL) $(PROGRAM) $(DIST)/bin/uninstall
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(INSTALL) $(PROGRAM) $(DESTDIR)$(mozappdir)/bin/uninstall
|
||||
|
||||
clean clobber realclean clobber_all::
|
||||
$(RM) $(DIST)/bin/uninstall/$(PROGRAM)
|
||||
@ -1,603 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "extern.h"
|
||||
#include "extra.h"
|
||||
#include "dialogs.h"
|
||||
#include "ifuncns.h"
|
||||
#include "parser.h"
|
||||
#include "rdi.h"
|
||||
#include "shlobj.h"
|
||||
|
||||
#define MOZ_HWND_BROADCAST_MSG_TIMEOUT 5000
|
||||
#define MOZ_CLIENT_BROWSER_KEY "Software\\Clients\\StartMenuInternet"
|
||||
#define MOZ_CLIENT_MAIL_KEY "Software\\Clients\\Mail"
|
||||
|
||||
void SetDefault()
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szRegKey[MAX_BUF];
|
||||
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientTypeName", "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
wsprintf(szRegKey, "SOFTWARE\\Clients\\%s", szBuf);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientProductKey", "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
|
||||
SetWinReg(HKEY_LOCAL_MACHINE, szRegKey, "", REG_SZ, szBuf, lstrlen(szBuf));
|
||||
}
|
||||
|
||||
void ParseDefaultsInfo()
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szIniKey[MAX_BUF];
|
||||
char szStorageDir[MAX_BUF];
|
||||
char szShortcutPath[MAX_BUF];
|
||||
char szStoredShortcutPath[MAX_BUF];
|
||||
char szRegKey[MAX_BUF];
|
||||
char szClientTypeName[MAX_BUF];
|
||||
char szClientProductKey[MAX_BUF];
|
||||
int iIndex;
|
||||
DWORD dwIconsVisible;
|
||||
|
||||
// If szAppPath is a null string, i.e. we cannot find where the app has been installed:
|
||||
// - HIDEICONS will still remove the shortcuts but
|
||||
// - SHOWICONS will do nothing because we won't be able to find the shortcuts to display.
|
||||
ParsePath(ugUninstall.szAppPath, szStorageDir, MAX_BUF, PP_PATH_ONLY);
|
||||
lstrcat(szStorageDir, "defaults\\shortcuts\\");
|
||||
|
||||
// CLEANUP ISSUE: For all of the SHOWICON and HIDEICONS blocks below, there is a lot of
|
||||
// redundancy:
|
||||
// - Right now I'm just trying to create icons and, if I can't, trying under the PERSONAL
|
||||
// key instead. I would be cleaner to check for restricted access once, and then just
|
||||
// create the appropriate key each time.
|
||||
// - Creating a ShowIcon() and a HideIcon() function would rid us much of the redundency.
|
||||
|
||||
|
||||
// Deal with Desktop Icons
|
||||
iIndex = 0;
|
||||
wsprintf(szIniKey, "DesktopShortcut%d", iIndex);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
while(szBuf[0] != '\0')
|
||||
{
|
||||
strcpy(szShortcutPath, "COMMON_DESKTOP");
|
||||
DecryptVariable(szShortcutPath, MAX_BUF);
|
||||
|
||||
if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0'))
|
||||
{
|
||||
wsprintf(szStoredShortcutPath, "%s%s", szStorageDir, szBuf);
|
||||
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
|
||||
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
|
||||
{
|
||||
strcpy(szShortcutPath, "PERSONAL_DESKTOP");
|
||||
DecryptVariable(szShortcutPath, MAX_BUF);
|
||||
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ugUninstall.mode == HIDEICONS)
|
||||
{
|
||||
AppendBackSlash(szShortcutPath, MAX_BUF);
|
||||
lstrcat(szShortcutPath, szBuf);
|
||||
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
|
||||
{
|
||||
strcpy(szShortcutPath, "PERSONAL_DESKTOP");
|
||||
DecryptVariable(szShortcutPath, MAX_BUF);
|
||||
AppendBackSlash(szShortcutPath, MAX_BUF);
|
||||
lstrcat(szShortcutPath, szBuf);
|
||||
}
|
||||
|
||||
FileDelete(szShortcutPath);
|
||||
}
|
||||
|
||||
iIndex++;
|
||||
wsprintf(szIniKey, "DesktopShortcut%d", iIndex);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
}
|
||||
|
||||
// Deal with StartMenu Icons
|
||||
iIndex = 0;
|
||||
wsprintf(szIniKey, "StartMenuShortcut%d", iIndex);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
while(szBuf[0] != '\0')
|
||||
{
|
||||
strcpy(szShortcutPath, "COMMON_STARTMENU");
|
||||
DecryptVariable(szShortcutPath, MAX_BUF);
|
||||
|
||||
if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0'))
|
||||
{
|
||||
lstrcpy(szStoredShortcutPath, szStorageDir);
|
||||
lstrcat(szStoredShortcutPath, szBuf);
|
||||
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
|
||||
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
|
||||
{
|
||||
strcpy(szShortcutPath, "PERSONAL_STARTMENU");
|
||||
DecryptVariable(szShortcutPath, MAX_BUF);
|
||||
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ugUninstall.mode == HIDEICONS)
|
||||
{
|
||||
AppendBackSlash(szShortcutPath, MAX_BUF);
|
||||
lstrcat(szShortcutPath, szBuf);
|
||||
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
|
||||
{
|
||||
strcpy(szShortcutPath, "PERSONAL_STARTMENU");
|
||||
DecryptVariable(szShortcutPath, MAX_BUF);
|
||||
AppendBackSlash(szShortcutPath, MAX_BUF);
|
||||
lstrcat(szShortcutPath, szBuf);
|
||||
}
|
||||
|
||||
FileDelete(szShortcutPath);
|
||||
}
|
||||
|
||||
iIndex++;
|
||||
wsprintf(szIniKey, "StartMenuShortcut%d", iIndex);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
}
|
||||
|
||||
// Deal with QuickLaunch Bar Icons
|
||||
iIndex = 0;
|
||||
wsprintf(szIniKey, "QuickLaunchBarShortcut%d", iIndex);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
while(szBuf[0] != '\0')
|
||||
{
|
||||
GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", szShortcutPath, MAX_BUF);
|
||||
lstrcat(szShortcutPath, "\\Microsoft\\Internet Explorer\\Quick Launch");
|
||||
|
||||
if((ugUninstall.mode == SHOWICONS) && (szStorageDir[0] != '\0'))
|
||||
{
|
||||
wsprintf(szStoredShortcutPath, "%s%s", szStorageDir, szBuf);
|
||||
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
|
||||
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
|
||||
{
|
||||
GetWinReg(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups", "Quick Launch", szShortcutPath, MAX_BUF);
|
||||
FileCopy(szStoredShortcutPath, szShortcutPath, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ugUninstall.mode == HIDEICONS)
|
||||
{
|
||||
AppendBackSlash(szShortcutPath, MAX_BUF);
|
||||
lstrcat(szShortcutPath, szBuf);
|
||||
if( (!FileExists(szShortcutPath)) && (!(ulOSType & OS_WIN9x)) )
|
||||
{
|
||||
GetWinReg(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\GrpConv\\MapGroups", "Quick Launch", szShortcutPath, MAX_BUF);
|
||||
AppendBackSlash(szShortcutPath, MAX_BUF);
|
||||
lstrcat(szShortcutPath, szBuf);
|
||||
}
|
||||
|
||||
FileDelete(szShortcutPath);
|
||||
}
|
||||
|
||||
++iIndex;
|
||||
wsprintf(szIniKey, "QuickLaunchBarShortcut%d", iIndex);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, szIniKey, "", szBuf, MAX_BUF, szFileIniDefaultsInfo);
|
||||
}
|
||||
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientTypeName", "", szClientTypeName, MAX_BUF, szFileIniDefaultsInfo);
|
||||
GetPrivateProfileString(ugUninstall.szDefaultComponent, "ClientProductKey", "", szClientProductKey, MAX_BUF, szFileIniDefaultsInfo);
|
||||
wsprintf(szRegKey, "SOFTWARE\\Clients\\%s\\%s\\InstallInfo", szClientTypeName, szClientProductKey);
|
||||
|
||||
if (ugUninstall.mode == SHOWICONS)
|
||||
dwIconsVisible = 1;
|
||||
else
|
||||
dwIconsVisible = 0;
|
||||
|
||||
SetWinRegNumValue(HKEY_LOCAL_MACHINE, szRegKey, "IconsVisible", dwIconsVisible);
|
||||
}
|
||||
|
||||
void ParseAllUninstallLogs()
|
||||
{
|
||||
char szFileInstallLog[MAX_BUF];
|
||||
char szKey[MAX_BUF];
|
||||
sil *silFile;
|
||||
DWORD dwFileFound;
|
||||
DWORD dwRv = 0;
|
||||
|
||||
UndoDesktopIntegration();
|
||||
CleanupMailIntegration();
|
||||
dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog));
|
||||
while(dwFileFound)
|
||||
{
|
||||
if((silFile = InitSilNodes(szFileInstallLog)) != NULL)
|
||||
{
|
||||
FileDelete(szFileInstallLog);
|
||||
dwRv = Uninstall(silFile);
|
||||
DeInitSilNodes(&silFile);
|
||||
if(dwRv == WTD_CANCEL)
|
||||
break;
|
||||
}
|
||||
|
||||
dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog));
|
||||
}
|
||||
|
||||
if(dwRv != WTD_CANCEL)
|
||||
{
|
||||
lstrcpy(szFileInstallLog, ugUninstall.szLogPath);
|
||||
AppendBackSlash(szFileInstallLog, MAX_BUF);
|
||||
lstrcat(szFileInstallLog, ugUninstall.szLogFilename);
|
||||
if(FileExists(szFileInstallLog))
|
||||
{
|
||||
if((silFile = InitSilNodes(szFileInstallLog)) != NULL)
|
||||
{
|
||||
FileDelete(szFileInstallLog);
|
||||
Uninstall(silFile);
|
||||
DeInitSilNodes(&silFile);
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up the uninstall windows registry key */
|
||||
lstrcpy(szKey, "Software\\Microsoft\\Windows\\CurrentVersion\\uninstall\\");
|
||||
lstrcat(szKey, ugUninstall.szUninstallKeyDescription);
|
||||
RegDeleteKey(HKEY_LOCAL_MACHINE, szKey);
|
||||
|
||||
// Calling SHChangeNotify() will update the file association icons
|
||||
// in case they had been reset.
|
||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
|
||||
|
||||
// Note completion of the uninstall process.
|
||||
gbUninstallCompleted = TRUE;
|
||||
}
|
||||
|
||||
/* Broadcast message only if the windows registry keys exist
|
||||
* in case they were changed during uninstallation. If they
|
||||
* were, then the broadcast will alert the OS to update the appropriate UIs.
|
||||
* This needs to be done regardless if the user canceled the uninstall
|
||||
* process or not.
|
||||
*/
|
||||
if(WinRegKeyExists(HKEY_LOCAL_MACHINE, MOZ_CLIENT_BROWSER_KEY))
|
||||
{
|
||||
SendMessageTimeout(HWND_BROADCAST,
|
||||
WM_SETTINGCHANGE,
|
||||
0,
|
||||
(LPARAM)MOZ_CLIENT_BROWSER_KEY,
|
||||
SMTO_NORMAL|SMTO_ABORTIFHUNG,
|
||||
MOZ_HWND_BROADCAST_MSG_TIMEOUT,
|
||||
NULL);
|
||||
}
|
||||
if(WinRegKeyExists(HKEY_LOCAL_MACHINE, MOZ_CLIENT_MAIL_KEY))
|
||||
{
|
||||
SendMessageTimeout(HWND_BROADCAST,
|
||||
WM_SETTINGCHANGE,
|
||||
0,
|
||||
(LPARAM)MOZ_CLIENT_MAIL_KEY,
|
||||
SMTO_NORMAL|SMTO_ABORTIFHUNG,
|
||||
MOZ_HWND_BROADCAST_MSG_TIMEOUT,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
RECT rDlg;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SetWindowText(hDlg, diUninstall.szTitle);
|
||||
wsprintf(szBuf, diUninstall.szMessage0, ugUninstall.szDescription);
|
||||
SetDlgItemText(hDlg, IDC_MESSAGE0, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "Yes", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, IDWIZNEXT, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "No", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, IDCANCEL, szBuf);
|
||||
SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, IDWIZNEXT, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, IDCANCEL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
|
||||
if(GetClientRect(hDlg, &rDlg))
|
||||
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
|
||||
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDWIZNEXT:
|
||||
EnableWindow(GetDlgItem(hDlg, IDWIZNEXT), FALSE);
|
||||
EnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE);
|
||||
ParseAllUninstallLogs();
|
||||
// skip directory nuking for now (bug 233625) but may come back
|
||||
// if the issues can be resolved in a better way by bug 281235
|
||||
// VerifyAndDeleteInstallationFolder();
|
||||
DestroyWindow(hDlg);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
DestroyWindow(hDlg);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK DlgProcWhatToDo(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
RECT rDlg;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
GetPrivateProfileString("Messages", "DLG_REMOVE_FILE_TITLE", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetWindowText(hDlg, szBuf);
|
||||
|
||||
if((LPSTR)lParam != NULL)
|
||||
SetDlgItemText(hDlg, IDC_STATIC_SHARED_FILENAME, (LPSTR)lParam);
|
||||
|
||||
GetPrivateProfileString("Dialog Uninstall", "Message1", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, IDC_MESSAGE0, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "Message2", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, IDC_MESSAGE1, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "FileName", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, IDC_STATIC, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "No", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, ID_NO, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "NoToAll", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, ID_NO_TO_ALL, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "Yes", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, ID_YES, szBuf);
|
||||
GetPrivateProfileString("Dialog Uninstall", "YesToAll", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, ID_YES_TO_ALL, szBuf);
|
||||
|
||||
SendDlgItemMessage (hDlg, IDC_MESSAGE0, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, IDC_MESSAGE1, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, IDC_STATIC, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, IDC_STATIC_SHARED_FILENAME, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, ID_NO, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, ID_NO_TO_ALL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, ID_YES, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
SendDlgItemMessage (hDlg, ID_YES_TO_ALL, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
|
||||
if(GetClientRect(hDlg, &rDlg))
|
||||
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
|
||||
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case ID_NO:
|
||||
EndDialog(hDlg, WTD_NO);
|
||||
break;
|
||||
|
||||
case ID_NO_TO_ALL:
|
||||
EndDialog(hDlg, WTD_NO_TO_ALL);
|
||||
break;
|
||||
|
||||
case ID_YES:
|
||||
EndDialog(hDlg, WTD_YES);
|
||||
break;
|
||||
|
||||
case ID_YES_TO_ALL:
|
||||
EndDialog(hDlg, WTD_YES_TO_ALL);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
RECT rDlg;
|
||||
HWND hSTMessage = GetDlgItem(hDlg, IDC_MESSAGE); /* handle to the Static Text message window */
|
||||
HDC hdcSTMessage;
|
||||
SIZE sizeString;
|
||||
LOGFONT logFont;
|
||||
HFONT hfontTmp;
|
||||
HFONT hfontOld;
|
||||
int i;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SendDlgItemMessage (hDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)ugUninstall.definedFont, 0L);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDC_MESSAGE:
|
||||
hdcSTMessage = GetWindowDC(hSTMessage);
|
||||
|
||||
SystemParametersInfo(SPI_GETICONTITLELOGFONT,
|
||||
sizeof(logFont),
|
||||
(PVOID)&logFont,
|
||||
0);
|
||||
hfontTmp = CreateFontIndirect(&logFont);
|
||||
|
||||
if(hfontTmp)
|
||||
hfontOld = SelectObject(hdcSTMessage, hfontTmp);
|
||||
|
||||
GetTextExtentPoint32(hdcSTMessage, (LPSTR)lParam, lstrlen((LPSTR)lParam), &sizeString);
|
||||
SelectObject(hdcSTMessage, hfontOld);
|
||||
DeleteObject(hfontTmp);
|
||||
ReleaseDC(hSTMessage, hdcSTMessage);
|
||||
|
||||
SetWindowPos(hDlg, HWND_TOP,
|
||||
(dwScreenX/2)-((sizeString.cx + 40)/2), (dwScreenY/2)-((sizeString.cy + 40)/2),
|
||||
sizeString.cx + 40, sizeString.cy + 40,
|
||||
SWP_SHOWWINDOW);
|
||||
|
||||
if(GetClientRect(hDlg, &rDlg))
|
||||
SetWindowPos(hSTMessage,
|
||||
HWND_TOP,
|
||||
rDlg.left,
|
||||
rDlg.top,
|
||||
rDlg.right,
|
||||
rDlg.bottom,
|
||||
SWP_SHOWWINDOW);
|
||||
|
||||
for(i = 0; i < lstrlen((LPSTR)lParam); i++)
|
||||
{
|
||||
if((((LPSTR)lParam)[i] == '\r') || (((LPSTR)lParam)[i] == '\n'))
|
||||
((LPSTR)lParam)[i] = ' ';
|
||||
}
|
||||
|
||||
SetDlgItemText(hDlg, IDC_MESSAGE, (LPSTR)lParam);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
// This dialog proc must be used in conjunction with DLG_MESSAGE_CHK.
|
||||
LRESULT CALLBACK DlgProcComplete(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
RECT rDlg;
|
||||
char text[256];
|
||||
LRESULT result = 0;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SetWindowText(hDlg, diUninstall.szTitle);
|
||||
|
||||
GetPrivateProfileString("Dialog Uninstall", "OK", "",
|
||||
text, sizeof(text), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, IDOK, text);
|
||||
|
||||
GetPrivateProfileString("Messages", "MSG_UNINSTALL_COMPLETE", "",
|
||||
text, sizeof(text), szFileIniUninstall);
|
||||
SetDlgItemText(hDlg, IDC_MESSAGE, text);
|
||||
|
||||
GetPrivateProfileString("Messages", "MSG_UNINSTALL_SURVEY", "",
|
||||
text, sizeof(text), szFileIniUninstall);
|
||||
if (text[0])
|
||||
{
|
||||
SetDlgItemText(hDlg, IDC_CHECKBOX, text);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide the checkbox control if there is not survey text.
|
||||
ShowWindow(GetDlgItem(hDlg, IDC_CHECKBOX), SW_HIDE);
|
||||
}
|
||||
|
||||
if(GetClientRect(hDlg, &rDlg))
|
||||
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
|
||||
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
if (SendDlgItemMessage(hDlg, IDC_CHECKBOX, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||
{
|
||||
EndDialog(hDlg, ID_YES_TO_ALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
EndDialog(hDlg, IDOK);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, IDOK);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void ProcessWindowsMessages()
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ShowMessage(LPSTR szMessage, BOOL bShow)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(ugUninstall.mode != SILENT)
|
||||
{
|
||||
if((bShow) && (hDlgMessage == NULL))
|
||||
{
|
||||
ZeroMemory(szBuf, sizeof(szBuf));
|
||||
GetPrivateProfileString("Messages", "MB_MESSAGE_STR", "", szBuf, sizeof(szBuf), szFileIniUninstall);
|
||||
hDlgMessage = InstantiateDialog(hWndMain, DLG_MESSAGE, szBuf, DlgProcMessage);
|
||||
SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage);
|
||||
}
|
||||
else if(!bShow && hDlgMessage)
|
||||
{
|
||||
DestroyWindow(hDlgMessage);
|
||||
hDlgMessage = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
HWND hDlg = NULL;
|
||||
|
||||
if((hDlg = CreateDialog(hInst, MAKEINTRESOURCE(dwDlgID), hParent, wpDlgProc)) == NULL)
|
||||
{
|
||||
char szEDialogCreate[MAX_BUF];
|
||||
|
||||
if(GetPrivateProfileString("Messages", "ERROR_DIALOG_CREATE", "", szEDialogCreate, sizeof(szEDialogCreate), szFileIniUninstall))
|
||||
{
|
||||
wsprintf(szBuf, szEDialogCreate, szTitle);
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
}
|
||||
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
|
||||
return(hDlg);
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _DIALOGS_H_
|
||||
#define _DIALOGS_H_
|
||||
|
||||
LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcWhatToDo(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcComplete(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
|
||||
void ParseAllUninstallLogs();
|
||||
void ParseDefaultsInfo();
|
||||
void SetDefault();
|
||||
HWND InstantiateDialog(HWND hParent, DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
|
||||
void ShowMessage(LPSTR szMessage, BOOL bShow);
|
||||
void ProcessWindowsMessages(void);
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (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/MPL/
|
||||
*
|
||||
* 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 the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _EXTERN_H_
|
||||
#define _EXTERN_H_
|
||||
|
||||
#include "uninstall.h"
|
||||
|
||||
/* external global variables */
|
||||
extern HINSTANCE hInst;
|
||||
extern HANDLE hAccelTable;
|
||||
|
||||
extern HWND hDlgUninstall;
|
||||
extern HWND hDlgMessage;
|
||||
extern HWND hWndMain;
|
||||
|
||||
extern LPSTR szEGlobalAlloc;
|
||||
extern LPSTR szEStringLoad;
|
||||
extern LPSTR szEDllLoad;
|
||||
extern LPSTR szEStringNull;
|
||||
extern LPSTR szTempSetupPath;
|
||||
|
||||
extern LPSTR szClassName;
|
||||
extern LPSTR szUninstallDir;
|
||||
extern LPSTR szTempDir;
|
||||
extern LPSTR szOSTempDir;
|
||||
extern LPSTR szFileIniUninstall;
|
||||
extern LPSTR szFileIniDefaultsInfo;
|
||||
extern LPSTR gszSharedFilename;
|
||||
|
||||
extern ULONG ulOSType;
|
||||
extern DWORD dwScreenX;
|
||||
extern DWORD dwScreenY;
|
||||
|
||||
extern DWORD gdwWhatToDo;
|
||||
|
||||
extern BOOL gbAllowMultipleInstalls;
|
||||
|
||||
extern uninstallGen ugUninstall;
|
||||
extern diU diUninstall;
|
||||
|
||||
extern DWORD dwParentPID;
|
||||
|
||||
extern BOOL gbUninstallCompleted;
|
||||
|
||||
#endif
|
||||