Compare commits
1 Commits
feature_te
...
SSU_PERSON
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc3781c667 |
@@ -1,6 +0,0 @@
|
||||
# List clobbering rationale in this file. Please include bug numbers whenever possible.
|
||||
- 20070619: and now libxul is back on again
|
||||
- 20070618: clobbering for bug 345517 (enable libxul), after it was backed out for Mac
|
||||
- 20070612: clobbering for bug 345517 (enable libxul). Again, after fixing mozconfig
|
||||
- 20070612: clobbering for bug 345517 (enable libxul)
|
||||
- 20070529: CLOBBER to get symbols uploaded for the first time
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
## hostname: bm-xservex11.build.mozilla.org
|
||||
## uname: Darwin bm-xserve11.build.mozilla.org 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 i386
|
||||
#
|
||||
|
||||
. $topsrcdir/build/macosx/universal/mozconfig
|
||||
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j4"
|
||||
mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging mozilla/tools/codesighs"
|
||||
mk_add_options MOZ_CO_PROJECT="browser"
|
||||
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build/universal
|
||||
mk_add_options MOZ_MAKE_FLAGS="MOZ_ENABLE_NEW_TEXT_FRAME=1"
|
||||
|
||||
ac_add_options --enable-application=browser
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
ac_add_options --enable-optimize="-O2 -g"
|
||||
ac_add_options --disable-debug
|
||||
ac_add_options --disable-tests
|
||||
ac_add_options --enable-update-packaging
|
||||
|
||||
# ac_add_options --enable-official-branding
|
||||
ac_add_app_options ppc --enable-prebinding
|
||||
ac_add_options --enable-svg
|
||||
ac_add_options --enable-canvas
|
||||
|
||||
ac_add_options --enable-codesighs
|
||||
@@ -1,257 +0,0 @@
|
||||
#
|
||||
## hostname: bm-xservex11.build.mozilla.org
|
||||
## uname: Darwin bm-xserve11.build.mozilla.org 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 i386
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{NO_EM_RESTART} = "1";
|
||||
$ENV{DYLD_NO_FIX_PREBINDING} = "1";
|
||||
$ENV{LD_PREBIND_ALLOW_OVERLAP} = "1";
|
||||
$ENV{CVS_RSH} = "ssh";
|
||||
|
||||
$MacUniversalBinary = 1;
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
#$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = 'Minefield';
|
||||
$VendorName = "";
|
||||
|
||||
$RunMozillaTests = 1; # Allow turning off of all tests if needed.
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
#$JavaTest = 0;
|
||||
#$ViewerTest = 0;
|
||||
#$BloatTest = 0; # warren memory bloat test
|
||||
#$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
#$DomToTextConversionTest = 0;
|
||||
#$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
#$MailBloatTest = 0;
|
||||
#$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 1; # Tp
|
||||
$LayoutPerformanceLocalTest = 0; # Tp2
|
||||
$DHTMLPerformanceTest = 1; # Tdhtml
|
||||
#$QATest = 0;
|
||||
$XULWindowOpenTest = 1; # Txul
|
||||
$StartupPerformanceTest = 1; # Ts
|
||||
|
||||
$TestsPhoneHome = 1; # Should test report back to server?
|
||||
|
||||
$GraphNameOverride = 'xserve11.build.mozilla.org_TextFrame';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
#$pageload_server = "spider"; # localhost
|
||||
$pageload_server = "pageload.build.mozilla.org"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
$AliveTestTimeout = 10;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
#$LayoutPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceLocalTestTimeout = 1200; # entire test, seconds
|
||||
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 15; # seconds
|
||||
#$XULWindowOpenTestTimeout = 150; # seconds
|
||||
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
#$Make = 'gmake'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
#$blat = 'c:/nstools/bin/blat';
|
||||
#$use_blat = 0;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
#$moz_cvsroot = $ENV{CVSROOT};
|
||||
$moz_cvsroot = ":ext:cltbld\@cvs.mozilla.org:/cvsroot";
|
||||
#$moz_cvsroot = "/builds/cvs.hourly/cvsroot";
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
$ObjDir = '../build/universal';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'TextFrame';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
$BuildTree = 'MozillaExperimental';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox-bin';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
# Release build options
|
||||
$ReleaseBuild = 1;
|
||||
$shiptalkback = 0;
|
||||
#$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
|
||||
#$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = "4";
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
#$ssh_user = "cltbld";
|
||||
#$ssh_server = "stage.mozilla.org";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly/experimental/textframe";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/experimental/textframe";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = "build-announce\@mozilla.org";
|
||||
$stub_installer = 0;
|
||||
$sea_installer = 0;
|
||||
$archive = 1;
|
||||
#$push_raw_xpis = 1;
|
||||
$update_package = 1;
|
||||
$update_product = "Firefox";
|
||||
$update_version = "trunk";
|
||||
$update_platform = "Darwin_Universal-gcc3";
|
||||
$update_hash = "md5";
|
||||
$update_filehost = "ftp.mozilla.org";
|
||||
$update_ver_file = 'browser/config/version.txt';
|
||||
$update_pushinfo = 0;
|
||||
$crashreporter_buildsymbols = 0;
|
||||
$crashreporter_pushsymbols = 0;
|
||||
$ENV{SYMBOL_SERVER_HOST} = 'stage.mozilla.org';
|
||||
$ENV{SYMBOL_SERVER_USER} = 'ffxbld';
|
||||
$ENV{SYMBOL_SERVER_PATH} = '/mnt/netapp/breakpad/symbols_ffx/';
|
||||
$ENV{SYMBOL_SERVER_SSH_KEY} = "$ENV{HOME}/.ssh/ffxbld_dsa";
|
||||
$ENV{MOZ_SYMBOLS_EXTRA_BUILDID} = 'textframe';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
@@ -1,5 +0,0 @@
|
||||
# List clobbering rationale in this file. Please include bug numbers whenever possible.
|
||||
- 2007/06/12: clobbering for bug 345517 (enable libxul). Again, after fixing mozconfig
|
||||
- 2007/06/12: clobbering for bug 345517 (enable libxul)
|
||||
- 2007/05/28: clobbering for bug 382141 to get symbols uploaded
|
||||
- 2007/05/22: clobbering a win32 trunk build to test aus2 migration (see http://wiki.mozilla.org/WeeklyUpdates/2007-05-21#Build and http://weblogs.mozillazine.org/preed/2007/05/aus2s_a_movin_can_you_help_us.html)
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
## hostname: fxexp-win32-tbox
|
||||
## uname: CYGWIN_NT-5.2 fx-win32-tbox 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
|
||||
#
|
||||
|
||||
# . $topsrcdir/browser/config/mozconfig
|
||||
|
||||
mk_add_options MOZ_CO_PROJECT=browser
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j5"
|
||||
mk_add_options MOZ_MAKE_FLAGS="MOZ_ENABLE_NEW_TEXT_FRAME=1"
|
||||
mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging"
|
||||
mk_add_options MOZ_PACKAGE_NSIS=1
|
||||
|
||||
ac_add_options --enable-application=browser
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
ac_add_options --enable-optimize
|
||||
ac_add_options --disable-debug
|
||||
# ac_add_options --enable-codesighs
|
||||
ac_add_options --disable-tests
|
||||
# ac_add_options --enable-official-branding
|
||||
ac_add_options --enable-svg
|
||||
ac_add_options --enable-canvas
|
||||
ac_add_options --enable-default-toolkit=cairo-windows
|
||||
ac_add_options --enable-update-packaging
|
||||
@@ -1,253 +0,0 @@
|
||||
#
|
||||
## hostname: fx-win32-tbox
|
||||
## uname: CYGWIN_NT-5.2 fx-win32-tbox 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{MOZ_INSTALLER_USE_7ZIP} = '1';
|
||||
$ENV{NO_EM_RESTART} = '1';
|
||||
$ENV{MOZ_PACKAGE_NSIS} = '1';
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
#$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = "Firefox";
|
||||
$VendorName = "Mozilla";
|
||||
|
||||
$RunMozillaTests = 1; # Allow turning off of all tests if needed.
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
$JavaTest = 0;
|
||||
$ViewerTest = 0;
|
||||
$BloatTest = 0; # warren memory bloat test
|
||||
$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
$DomToTextConversionTest = 0;
|
||||
$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
$MailBloatTest = 0;
|
||||
$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 0; # Tp
|
||||
$DHTMLPerformanceTest = 0; # Tdhtml
|
||||
$QATest = 0;
|
||||
$XULWindowOpenTest = 0; # Txul
|
||||
$StartupPerformanceTest = 0; # Ts
|
||||
$NeckoUnitTest = 0;
|
||||
$RenderPerformanceTest = 0; # Tgfx
|
||||
|
||||
$TestsPhoneHome = 0; # Should test report back to server?
|
||||
$GraphNameOverride = 'fx-win32-tbox';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
$pageload_server = "pageload.build.mozilla.org"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
#$AliveTestTimeout = 30;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
$LayoutPerformanceTestTimeout = 800; # entire test, seconds
|
||||
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 20; # seconds
|
||||
#$XULWindowOpenTestTimeout = 90; # seconds
|
||||
#$NeckoUnitTestTimeout = 30; # seconds
|
||||
$RenderPerformanceTestTimeout = 1800; # seconds
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
$Make = 'make'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
$blat = 'd:/moztools/bin/blat';
|
||||
$use_blat = 0;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
#$moz_cvsroot = $ENV{CVSROOT};
|
||||
$moz_cvsroot = ':ext:cltbld@cvs.mozilla.org:/cvsroot';
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
#XXX: this breaks talkback currently
|
||||
#$ObjDir = 'fx-trunk';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'TextFrame';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
#$BuildTree = 'MozillaTest';
|
||||
$BuildTree = 'MozillaExperimental';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox.exe';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
# Release build options
|
||||
$ReleaseBuild = 1;
|
||||
$shiptalkback = 0;
|
||||
$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
|
||||
$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = "7";
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
#$ssh_user = "cltbld";
|
||||
#$ssh_server = "stage.mozilla.org";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly/experimental/textframe";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/experimental/textframe";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = 'build-announce@mozilla.org';
|
||||
$stub_installer = 0;
|
||||
$sea_installer = 1;
|
||||
$archive = 1;
|
||||
$push_raw_xpis = 1;
|
||||
$update_package = 1;
|
||||
$update_product = "Firefox";
|
||||
$update_version = "trunk";
|
||||
$update_platform = "WINNT_x86-msvc";
|
||||
$update_hash = "sha1";
|
||||
$update_filehost = "ftp.mozilla.org";
|
||||
$update_ver_file = 'browser/config/version.txt';
|
||||
$update_pushinfo = 0;
|
||||
$crashreporter_buildsymbols = 0;
|
||||
$crashreporter_pushsymbols = 0;
|
||||
$ENV{SYMBOL_SERVER_HOST} = 'stage.mozilla.org';
|
||||
$ENV{SYMBOL_SERVER_USER} = 'ffxbld';
|
||||
$ENV{SYMBOL_SERVER_PATH} = '/mnt/netapp/breakpad/symbols_ffx/';
|
||||
$ENV{SYMBOL_SERVER_SSH_KEY} = "$ENV{HOME}/.ssh/ffxbld_dsa";
|
||||
$ENV{MOZ_SYMBOLS_EXTRA_BUILDID} = 'textframe';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
80
mozilla/xpinstall/packager/windows/browser.jst
Normal file
@@ -0,0 +1,80 @@
|
||||
function updateWinReg()
|
||||
{
|
||||
//Notes:
|
||||
// can't use a double backslash before subkey - Windows already puts it in.
|
||||
// subkeys have to exist before values can be put in.
|
||||
var winreg = getWinRegistry();
|
||||
var subkey; //the name of the subkey you are poking around in
|
||||
var valname; // the name of the value you want to look at
|
||||
var value; //the data in the value you want to look at.
|
||||
|
||||
if(winreg != null)
|
||||
{
|
||||
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
|
||||
subkey = "SOFTWARE\\Netscape\\Netscape Seamonkey";
|
||||
winreg.createKey(subkey,"");
|
||||
valname = "CurrentVersion";
|
||||
value = "$UserAgent$";
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
subkey = "SOFTWARE\\Netscape\\Netscape Seamonkey\\$UserAgent$\\Main";
|
||||
winreg.createKey(subkey,"");
|
||||
valname = "Install Directory";
|
||||
value = communicatorFolder;
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
// set the App Paths key here
|
||||
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\mozilla.exe";
|
||||
winreg.createKey(subkey,"");
|
||||
valname = "";
|
||||
value = communicatorFolder + "\\mozilla.exe";
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
valname = "Path";
|
||||
value = communicatorFolder;
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
}
|
||||
}
|
||||
|
||||
// main
|
||||
var srDest;
|
||||
var err;
|
||||
var communicatorFolder;
|
||||
var fWindowsSystem;
|
||||
var fileComponentRegStr;
|
||||
var fileComponentReg;
|
||||
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla Seamonkey", "", "$Version$");
|
||||
logComment("startInstall: " + err);
|
||||
|
||||
communicatorFolder = getFolder("Communicator");
|
||||
fWindowsSystem = getFolder("Win System");
|
||||
logComment("communicatorFolder: " + communicatorFolder);
|
||||
|
||||
if(verifyDiskSpace(communicatorFolder, srDest) == true)
|
||||
{
|
||||
err = addDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // dir name in jar to extract
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to communicatorFolder
|
||||
true); // Force Flag
|
||||
logComment("addDirectory() of Program returned: " + err);
|
||||
|
||||
// check return value
|
||||
if(!checkError(err))
|
||||
{
|
||||
fileComponentRegStr = communicatorFolder + "\\component.reg";
|
||||
fileComponentReg = getFolder("file:///", fileComponentRegStr);
|
||||
err = fileDelete(fileComponentReg);
|
||||
logComment("fileDelete() returned: " + err);
|
||||
|
||||
updateWinReg();
|
||||
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
// end main
|
||||
451
mozilla/xpinstall/packager/windows/config.it
Normal file
@@ -0,0 +1,451 @@
|
||||
[General]
|
||||
; Run Mode values:
|
||||
; Normal - Shows all dialogs. Requires user input.
|
||||
; Auto - Shows some dialogs, but none requiring user input. It will
|
||||
; automatically install the product using default values.
|
||||
; Silent - Show no dialogs at all. It will install product using default
|
||||
; values.
|
||||
Run Mode=Normal
|
||||
|
||||
Product Name=Mozilla Seamonkey
|
||||
|
||||
; Destination Path values:
|
||||
; PROGRAMFILESDIR
|
||||
; WINDISK
|
||||
; WINDIR
|
||||
; WINSYSDIR
|
||||
Path=[PROGRAMFILESDIR]\Netscape\Seamonkey
|
||||
|
||||
; Program Folder Path values:
|
||||
; COMMON_STARTUP
|
||||
; COMMON_PROGRAMS
|
||||
; COMMON_STARTMENU
|
||||
; COMMON_DESKTOP
|
||||
;
|
||||
; PERSONAL_STARTUP
|
||||
; PERSONAL_PROGRAMS
|
||||
; PERSONAL_STARTMENU
|
||||
; PERSONAL_DESKTOP
|
||||
;
|
||||
; PERSONAL_APPDATA
|
||||
; PERSONAL_CACHE
|
||||
; PERSONAL_COOKIES
|
||||
; PERSONAL_FAVORITES
|
||||
; PERSONAL_FONTS
|
||||
; PERSONAL_HISTORY
|
||||
; PERSONAL_NETHOOD
|
||||
; PERSONAL_PERSONAL
|
||||
; PERSONAL_PRINTHOOD (supported only under Windows NT)
|
||||
; PERSONAL_RECENT
|
||||
; PERSONAL_SENDTO
|
||||
; PERSONAL_TEMPLATES
|
||||
;
|
||||
; PROGRAMFILESDIR
|
||||
; COMMONFILESDIR
|
||||
; MEDIAPATH
|
||||
; CONFIGPATH (supported only under Windows95 and Windows98)
|
||||
; DEVICEPATH
|
||||
Program Folder Name=Mozilla Seamonkey
|
||||
Program Folder Path=[COMMON_PROGRAMS]
|
||||
|
||||
; Default Setup Type values:
|
||||
; Setup Type 0 - first radio button (default)
|
||||
; Setup Type 1 - second radio button
|
||||
; Setup Type 2 - third radio button
|
||||
; Setup Type 3 - fourth radio button (usually the Custom option)
|
||||
Default Setup Type=Setup Type 0
|
||||
|
||||
Setup Title0=Mozilla Seamonkey Setup
|
||||
Setup Title1=Build $Version$
|
||||
Setup Title2=
|
||||
|
||||
; HKey: valid decryptable setup keys are [Mozilla Seamonkey CurrentVersion]
|
||||
; and [Mozilla Seamonkey CurrentVersion].
|
||||
; Decrypt HKey: there are times when '[' and ']' are valid part of windows registry key names.
|
||||
; Contains Filename: tells setup that the path contains filename needed to be removed before
|
||||
; using it as a path.
|
||||
; Verify Existance: FILE or PATH
|
||||
;
|
||||
[Locate Previous Product Path0]
|
||||
HRoot=HKEY_LOCAL_MACHINE
|
||||
HKey=[Netscape Seamonkey CurrentVersion]\Main
|
||||
Name=Install Directory
|
||||
Decrypt HKey=TRUE
|
||||
Contains Filename=FALSE
|
||||
Verify Existance=
|
||||
|
||||
; This section checks for legacy files.
|
||||
; If the file(s), indicated by the Filename= key, is found to have a version of less than the value
|
||||
; indicated by the Version= key, then display the string in the Message= key.
|
||||
[Legacy Check0]
|
||||
Filename=[SETUP PATH]\mozilla.exe
|
||||
Version=6.0.0.0
|
||||
Message=Setup has detected an old version of Mozilla in the chosen destination path that may pose compatibility issues. It is highly recommended that a different destination path be used. Would you like to chose a different path?
|
||||
|
||||
[Dialog Welcome]
|
||||
Show Dialog=TRUE
|
||||
Title=Welcome
|
||||
Message0=Welcome to %s Setup.
|
||||
Message1=It is strongly recommended that you exit all Windows programs before running this Setup program.
|
||||
Message2=Click Cancel to quit Setup and then close any programs you have running. Click Next to continue the Setup Program.
|
||||
|
||||
[Dialog License]
|
||||
Show Dialog=FALSE
|
||||
Title=Software License Agreement
|
||||
License File=license.txt
|
||||
Message0=Please read the following license agreement. Use the scroll bar to view the rest of this agreement.
|
||||
Message1=Click Accept if you accept the terms of the preceeding license agreement. If No is clicked, setup will quit.
|
||||
|
||||
[Dialog Setup Type]
|
||||
Show Dialog=TRUE
|
||||
Title=Setup Type
|
||||
Message0=Click the type of Setup you prefer, then click Next.
|
||||
Readme Filename=readme.txt
|
||||
Readme App=notepad.exe
|
||||
|
||||
; at least one Setup Type needs to be set, and up to 4 can be
|
||||
; set (Setup Type0, Setup Type1, Setup Type2, Setup Type3).
|
||||
[Setup Type0]
|
||||
Description Short=B&ase
|
||||
Description Long=Program will be installed with the minimal options.
|
||||
|
||||
; List of components to install/enable for this Setup Type.
|
||||
; All other components not listed here will be disabled if
|
||||
; this Setup Type is selected.
|
||||
C0=Component0
|
||||
C1=Component1
|
||||
|
||||
[Setup Type1]
|
||||
Description Short=C&omplete
|
||||
Description Long=Program will be installed with the most common options.
|
||||
|
||||
; List of components to install/enable for this Setup Type.
|
||||
; All other components not listed here will be disabled if
|
||||
; this Setup Type is selected.
|
||||
C0=Component0
|
||||
C1=Component1
|
||||
C2=Component2
|
||||
|
||||
[Setup Type2]
|
||||
Description Short=C&ustom
|
||||
Description Long=You may choose the options you want to install. Recommended for advanced users.
|
||||
;Description Short=&Pro
|
||||
;Description Long=Program will be installed with all the options available.
|
||||
|
||||
; List of components to install/enable for this Setup Type.
|
||||
; All other components not listed here will be disabled if
|
||||
; this Setup Type is selected.
|
||||
C0=Component0
|
||||
C1=Component1
|
||||
C2=Component2
|
||||
|
||||
;[Setup Type3]
|
||||
;Description Short=C&ustom
|
||||
;Description Long=You may choose the options you want to install. Recommended for advanced users.
|
||||
|
||||
; List of components to install/enable for this Setup Type.
|
||||
; All other components not listed here will be disabled if
|
||||
; this Setup Type is selected.
|
||||
;C0=Component0
|
||||
;C1=Component1
|
||||
;C2=Component2
|
||||
;C3=Component3
|
||||
|
||||
[Dialog Select Components]
|
||||
Show Dialog=TRUE
|
||||
Title=Select Components
|
||||
Message0=
|
||||
|
||||
[Dialog Windows Integration]
|
||||
Show Dialog=FALSE
|
||||
Title=Windows Integration
|
||||
Message0=Check the Mozilla Preference options you would like Setup to perform.
|
||||
Message1=These settings allow you to set default Internet preferences for browsing and searching. They affect browsers installed on your machine, including Mozilla Communicator and Microsoft Internet Explorer.
|
||||
|
||||
; Only a maximum of 4 "Windows Integration-Item"s are allowded. Each Item
|
||||
; shows up as a checkbox in the Windows Integration dialog.
|
||||
[Windows Integration-Item0]
|
||||
CheckBoxState=FALSE
|
||||
Description=Make Mozilla Communicator my default Internet browser
|
||||
Archive=
|
||||
|
||||
[Windows Integration-Item1]
|
||||
CheckBoxState=FALSE
|
||||
Description=Make Mozilla Netcenter my home page
|
||||
Archive=
|
||||
|
||||
[Windows Integration-Item2]
|
||||
CheckBoxState=FALSE
|
||||
Description=Use Mozilla Netcenter to search the Web
|
||||
Archive=
|
||||
|
||||
[Dialog Program Folder]
|
||||
Show Dialog=TRUE
|
||||
Title=Program Folder
|
||||
Message0=Setup will add program icons to the Program Folder listed below. You may type a new folder name, or select one from the existing folder list. Click Next to continue.
|
||||
|
||||
[Dialog Start Install]
|
||||
Show Dialog=TRUE
|
||||
Title=Start Install
|
||||
Message0=Setup has enough information to start copying the program files. If you want to review or change settings, click Back. If you are satisfied with the current settings, click Install to begin copying files.
|
||||
|
||||
[Dialog Reboot]
|
||||
; Show Dialog values are:
|
||||
; TRUE - Always show
|
||||
; FALSE - Don't show unless at least one component has its reboot show value set
|
||||
; to TRUE. This will not show even if some files were in use and a reboot
|
||||
; is necessary.
|
||||
; AUTO - Don't show unless a component has its reboot show value set to
|
||||
; TRUE or there was at least one file in use and a reboot is
|
||||
; is required for the file to be replaced correctly.
|
||||
Show Dialog=AUTO
|
||||
|
||||
; These SmartDownload sections contain information to configure SmartDownload.
|
||||
; The info is applied to all components to be downloaded.
|
||||
[SmartDownload-Netscape Install]
|
||||
;core_file=base.zip
|
||||
;core_dir=[SETUP PATH]
|
||||
no_ads=true
|
||||
silent=false
|
||||
execution=false
|
||||
confirm_install=false
|
||||
;extract_msg=Uncompressing Seamonkey. Please wait...
|
||||
|
||||
[SmartDownload-Proxy]
|
||||
|
||||
[SmartDownload-Execution]
|
||||
exe=
|
||||
exe_param=
|
||||
|
||||
[Check Instance0]
|
||||
Class Name=NetscapeWindowClass
|
||||
Window Name=
|
||||
Message=Setup has detected that an instance of Seamonkey is currently running. Please quit Seamonkey before continuing Setup.
|
||||
|
||||
[Check Instance1]
|
||||
Process Name=psm.exe
|
||||
Message=Setup has detected that an instance of Personal Security Manager is currently running. Personal Security Manager will quit by itself when there are no other applications running that require it. A reboot might be necessary. Setup will then be able to continue.
|
||||
|
||||
; These are the components to be offered to the user (shown in the Select
|
||||
; Components dialog) for installation.
|
||||
; There is no limit to the number of components to install.
|
||||
[Component0]
|
||||
Description Short=Mozilla Xpinstall Engine
|
||||
Description Long=Install Engine
|
||||
Archive=core.xpi
|
||||
$InstallSize$:core
|
||||
$InstallSizeSystem$
|
||||
$InstallSizeArchive$:core.xpi
|
||||
; Attributes can be the following values:
|
||||
; SELECTED - the component is selected to be installed by default.
|
||||
; INVISIBLE - the component is not shown in the Select Components dialog.
|
||||
Attributes=SELECTED|INVISIBLE
|
||||
; url keys can be as many as needed. url0 is attempted first. if it fails,
|
||||
; the next url key is tried in sequential order.
|
||||
; The url should not contain the filename. Setup will assemble the complete url
|
||||
; using the url keys and the Archive key.
|
||||
url0=$URLPath$
|
||||
|
||||
[Component1]
|
||||
Description Short=Mozilla Seamonkey
|
||||
Description Long=Browser software for the internet
|
||||
Archive=browser.xpi
|
||||
$InstallSize$:browser
|
||||
$InstallSizeSystem$
|
||||
$InstallSizeArchive$:browser.xpi
|
||||
Dependency0=Mozilla Xpinstall Engine
|
||||
; Attributes can be the following values:
|
||||
; SELECTED - the component is selected to be installed by default.
|
||||
; INVISIBLE - the component is not shown in the Select Components dialog.
|
||||
Attributes=SELECTED|INVISIBLE
|
||||
; url keys can be as many as needed. url0 is attempted first. if it fails,
|
||||
; the next url key is tried in sequential order.
|
||||
; The url should not contain the filename. Setup will assemble the complete url
|
||||
; using the url keys and the Archive key.
|
||||
url0=$URLPath$
|
||||
|
||||
[Component2]
|
||||
Description Short=Mail & News
|
||||
Description Long=Seamonkey Mail & News
|
||||
Archive=mail.xpi
|
||||
$InstallSize$:mail
|
||||
$InstallSizeSystem$
|
||||
$InstallSizeArchive$:mail.xpi
|
||||
Dependency0=Mozilla Xpinstall Engine
|
||||
; Attributes can be the following values:
|
||||
; SELECTED - the component is selected to be installed by default.
|
||||
; INVISIBLE - the component is not shown in the Select Components dialog.
|
||||
Attributes=SELECTED
|
||||
Parameter=
|
||||
; url keys can be as many as needed. url0 is attempted first. if it fails,
|
||||
; the next url key is tried in sequential order.
|
||||
; The url should not contain the filename. Setup will assemble the complete url
|
||||
; using the url keys and the Archive key.
|
||||
url0=$URLPath$
|
||||
|
||||
[Core]
|
||||
Source=[XPI PATH]\core.xpi
|
||||
Destination=[TEMP]\core.ns
|
||||
$InstallSize$:core
|
||||
Cleanup=TRUE
|
||||
Message=Preparing Install, please wait...
|
||||
|
||||
; The Timing key needs to be one of the following values:
|
||||
; pre download - process before any files have been downloaded.
|
||||
; post download - process after all files have been downloaded.
|
||||
; pre core - process before the core file has been uncompressed.
|
||||
; post core - process after the core file has been uncompressed.
|
||||
; pre smartupdate - process before the smartupdate engine has been launched.
|
||||
; post smartupdate - process after the smartupdate engine has been launched.
|
||||
; pre launchapp - process before the launching of executables.
|
||||
; post launchapp - process after the launching of executables.
|
||||
; depend reboot - process depending on if a reboot is necessary or not.
|
||||
; if reboot is necessary, installer can set it up so
|
||||
; the app runs once upon windows reboot.
|
||||
|
||||
;Uncompress FileX sections
|
||||
;[Uncompress File0]
|
||||
;Timing=post download
|
||||
;Source=[XPI PATH]\core.xpi
|
||||
;Destination=[SETUP PATH]
|
||||
;Message=Configuring Seamonkey, please wait...
|
||||
|
||||
;[Uncompress File1]
|
||||
;Timing=post download
|
||||
;Source=[XPI PATH]\extratest.xpi
|
||||
;Destination=[SETUP PATH]
|
||||
;Message=Configuring Extra test files, please wait...
|
||||
|
||||
;Move FileX sections
|
||||
;[Move File0]
|
||||
;Timing=post download
|
||||
;Source=[SETUP PATH]\bin\*
|
||||
;Destination=[SETUP PATH]\program
|
||||
|
||||
;[Move File1]
|
||||
;Timing=post download
|
||||
;Source=[SETUP PATH]\ftmain\*
|
||||
;Destination=[SETUP PATH]\program
|
||||
|
||||
;Copy FileX sections
|
||||
[Copy File0]
|
||||
Timing=post launchapp
|
||||
Source=[JRE BIN PATH]\npjava*.dll
|
||||
Destination=[SETUP PATH]\Plugins
|
||||
Fail If Exists=FALSE
|
||||
|
||||
;[Copy File1]
|
||||
;Timing=post launchapp
|
||||
;Source=[TEMP]\xtratest\bin\*.*
|
||||
;Destination=[SETUP PATH]
|
||||
;Fail If Exists=FALSE
|
||||
|
||||
;[Copy File1]
|
||||
;Timing=post download
|
||||
;Source=[SETUP PATH]\bin\*.exe
|
||||
;Destination=[TEMP]
|
||||
;Fail If Exists=
|
||||
|
||||
;Create DirectoryX sections
|
||||
[Create Directory0]
|
||||
Timing=post download
|
||||
Destination=[SETUP PATH]\Plugins
|
||||
|
||||
;[Create Directory1]
|
||||
;Timing=post download
|
||||
;Destination=[TEMP]\Test\temp
|
||||
|
||||
;Delete FileX sections
|
||||
[Delete File0]
|
||||
Timing=post download
|
||||
Destination=[COMMON_PROGRAMS]\Mozilla Seamonkey\Mozilla AppRunner.lnk
|
||||
|
||||
;Remove DirectoryX sections
|
||||
;[Remove Directory0]
|
||||
;Timing=post launchapp
|
||||
;Destination=[TEMP]\xtratest
|
||||
;Remove subdirs=TRUE
|
||||
|
||||
;RunAppX sections
|
||||
[RunApp0]
|
||||
Timing=depend reboot
|
||||
Wait=FALSE
|
||||
Target=[SETUP PATH]\mozilla.exe
|
||||
Parameters=-installer
|
||||
WorkingDir=[SETUP PATH]
|
||||
|
||||
; Values for Show Folder:
|
||||
; HIDE Hides the window and activates another window.
|
||||
; MAXIMIZE Maximizes the specified window.
|
||||
; MINIMIZE Minimizes the specified window and activates the next
|
||||
; top-level window in the z-order.
|
||||
; RESTORE Activates and displays the window. If the window is
|
||||
; minimized or maximized, Windows restores it to its
|
||||
; original size and position. An application should specify
|
||||
; this flag when restoring a minimized window.
|
||||
; SHOW Activates the window and displays it in its current size
|
||||
; and position.
|
||||
; SHOWMAXIMIZED Activates the window and displays it as a maximized
|
||||
; window.
|
||||
; SHOWMINIMIZED Activates the window and displays it as a minimized
|
||||
; window.
|
||||
; SHOWMINNOACTIVE Displays the window as a minimized window. The active
|
||||
; window remains active.
|
||||
; SHOWNA Displays the window in its current state. The active
|
||||
; window remains active.
|
||||
; SHOWNOACTIVATE Displays a window in its most recent size and position.
|
||||
; The active window remains active.
|
||||
; SHOWNORMAL Activates and displays a window. If the window is
|
||||
; minimized or maximized, Windows restores it to its
|
||||
; original size and position. An application should specify
|
||||
; this flag when displaying the window for the first time.
|
||||
[Program Folder0]
|
||||
Timing=post download
|
||||
Show Folder=SHOW
|
||||
Program Folder=[Default Folder]
|
||||
|
||||
[Program Folder0-Shortcut0]
|
||||
File=[SETUP PATH]\mozilla.exe
|
||||
Arguments=
|
||||
Working Dir=[SETUP PATH]
|
||||
Description=Mozilla Seamonkey
|
||||
Icon Path=[SETUP PATH]\mozilla.exe
|
||||
Icon Id=0
|
||||
|
||||
;[Program Folder0-Shortcut1]
|
||||
;File=[SETUP PATH]\bin\viewer.exe
|
||||
;Arguments=
|
||||
;Working Dir=[SETUP PATH]
|
||||
;Description=Mozilla Viewer
|
||||
;Icon Path=[SETUP PATH]\bin\viewer.exe
|
||||
;Icon Id=0
|
||||
|
||||
;[Program Folder0-Shortcut2]
|
||||
;File=[SETUP PATH]\bin\Net2fone.exe
|
||||
;Arguments=
|
||||
;Working Dir=[SETUP PATH]
|
||||
;Description=Net2Fone
|
||||
;Icon Path=[SETUP PATH]\bin\Net2fone.exe
|
||||
;Icon Id=0
|
||||
|
||||
;[Program Folder1]
|
||||
;Timing=post download
|
||||
;Show Folder=SHOW
|
||||
;Program Folder=[Default Folder]\lala land
|
||||
|
||||
;[Program Folder1-Shortcut0]
|
||||
;File=c:\bin\getver.exe
|
||||
;Arguments=
|
||||
;Working Dir=[TEMP]
|
||||
;Description=Getver Test
|
||||
;Icon Path=[WINDISK]\4nt\4nt.exe
|
||||
;Icon Id=0
|
||||
|
||||
;[Program Folder1-Shortcut1]
|
||||
;File=c:\perl\bin\perl.exe
|
||||
;Arguments=
|
||||
;Working Dir=[WINSYS]
|
||||
;Description=Perl
|
||||
;Icon Path=c:\perl\bin\perl.exe
|
||||
;Icon Id=0
|
||||
|
||||
40
mozilla/xpinstall/packager/windows/core.jst
Normal file
@@ -0,0 +1,40 @@
|
||||
// main
|
||||
var srDest;
|
||||
var err;
|
||||
var communicatorFolder;
|
||||
var fWindowsSystem;
|
||||
var fileComponentRegStr;
|
||||
var fileComponentReg;
|
||||
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla Xpinstall Engine", "", "$Version$");
|
||||
logComment("startInstall: " + err);
|
||||
|
||||
communicatorFolder = getFolder("Communicator");
|
||||
fWindowsSystem = getFolder("Win System");
|
||||
logComment("communicatorFolder: " + communicatorFolder);
|
||||
|
||||
if(verifyDiskSpace(communicatorFolder, srDest) == true)
|
||||
{
|
||||
err = addDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // dir name in jar to extract
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to communicatorFolder
|
||||
true); // Force Flag
|
||||
logComment("addDirectory() of Program returned: " + err);
|
||||
|
||||
// check return value
|
||||
if(!checkError(err))
|
||||
{
|
||||
fileComponentRegStr = communicatorFolder + "\\component.reg";
|
||||
fileComponentReg = getFolder("file:///", fileComponentRegStr);
|
||||
err = fileDelete(fileComponentReg);
|
||||
logComment("fileDelete() returned: " + err);
|
||||
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
// end main
|
||||
18
mozilla/xpinstall/packager/windows/editor.jst
Normal file
@@ -0,0 +1,18 @@
|
||||
var err = StartInstall("Mozilla Editor", "Seamonkey", "$Version$");
|
||||
LogComment("StartInstall: " + err);
|
||||
|
||||
var communicatorFolder = Install.GetFolder("Communicator");
|
||||
LogComment("communicatorFolder: " + communicatorFolder);
|
||||
|
||||
err = AddDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // fileName in jar,
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // fileName in jar,
|
||||
true); // Force Flag
|
||||
|
||||
LogComment("AddDirectory() returned: " + err);
|
||||
|
||||
err = FinalizeInstall();
|
||||
LogComment("FinalizeInstall() returned: " + err);
|
||||
|
||||
33
mozilla/xpinstall/packager/windows/mail.jst
Normal file
@@ -0,0 +1,33 @@
|
||||
// main
|
||||
var srDest;
|
||||
var err;
|
||||
var communicatorFolder;
|
||||
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla Mail", "", "$Version$");
|
||||
logComment("startInstall: " + err);
|
||||
// check return value
|
||||
checkError(err);
|
||||
|
||||
communicatorFolder = getFolder("Communicator");
|
||||
logComment("communicatorFolder: " + communicatorFolder);
|
||||
|
||||
if(verifyDiskSpace(communicatorFolder, srDest) == true)
|
||||
{
|
||||
err = addDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // dir name in jar to extract
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to communicatorFolder
|
||||
true); // Force Flag
|
||||
logComment("addDirectory() returned: " + err);
|
||||
|
||||
// check return value
|
||||
if(!checkError(err))
|
||||
{
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
// end main
|
||||
134
mozilla/xpinstall/packager/windows/makeall.pl
Normal file
@@ -0,0 +1,134 @@
|
||||
#!c:\perl\bin\perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
#
|
||||
|
||||
#
|
||||
# This perl script builds the xpi, config.ini, and js files.
|
||||
#
|
||||
|
||||
# Make sure there are at least four arguments
|
||||
if($#ARGV < 3)
|
||||
{
|
||||
die "usage: $0 <default version> <URL path> <staging path> <dist install path>
|
||||
|
||||
default version : julian based date version
|
||||
ie: 5.0.0.99257
|
||||
|
||||
URL path : URL path to where the .xpi files will be staged at.
|
||||
Either ftp:// or http:// can be used. Nothing will be
|
||||
copied to there by this script. It is used for config.ini.
|
||||
|
||||
staging path : full path to where the components are staged at
|
||||
|
||||
dist install path : full path to where the mozilla/dist/win32_o.obj/install is at.
|
||||
\n";
|
||||
}
|
||||
|
||||
$inDefaultVersion = $ARGV[0];
|
||||
$inURLPath = $ARGV[1];
|
||||
$inStagePath = $ARGV[2];
|
||||
$inDistPath = $ARGV[3];
|
||||
$seiFileNameGeneric = "nsinstall.exe";
|
||||
$seiFileNameSpecific = "mozilla-win32-installer.exe";
|
||||
$userAgent = "5.0b1 (en)";
|
||||
|
||||
# Check for existance of staging path
|
||||
if(!(-e "$inStagePath"))
|
||||
{
|
||||
die "invalid path: $inStagePath\n";
|
||||
}
|
||||
|
||||
# Make sure inDestPath exists
|
||||
if(!(-e "$inDistPath"))
|
||||
{
|
||||
mkdir ("$inDestPath",0775);
|
||||
}
|
||||
|
||||
# Make .js files
|
||||
MakeJsFile("core");
|
||||
MakeJsFile("browser");
|
||||
MakeJsFile("mail");
|
||||
|
||||
# Make .xpi files
|
||||
MakeXpiFile("core");
|
||||
MakeXpiFile("browser");
|
||||
MakeXpiFile("mail");
|
||||
|
||||
MakeConfigFile();
|
||||
|
||||
if(-e "$inDistPath\\setup")
|
||||
{
|
||||
unlink <$inDistPath\\setup\\*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$inDistPath\\setup",0775);
|
||||
}
|
||||
|
||||
# Copy the setup files to the dist setup directory.
|
||||
system("xcopy /f config.ini $inDistPath\\");
|
||||
system("xcopy /f config.ini $inDistPath\\setup\\");
|
||||
system("xcopy /f $inDistPath\\setup.exe $inDistPath\\setup\\");
|
||||
system("xcopy /f $inDistPath\\setuprsc.dll $inDistPath\\setup\\");
|
||||
|
||||
# build the self-extracting .exe file.
|
||||
print "\nbuilding self-extracting installer ($seiFileNameSpecific)...\n";
|
||||
system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecific");
|
||||
system("$inDistPath\\nszip.exe $inDistPath\\$seiFileNameSpecific $inDistPath\\setup\\*.* $inDistPath\\xpi\\*.*");
|
||||
|
||||
print " done!\n";
|
||||
|
||||
# end of script
|
||||
exit(0);
|
||||
|
||||
sub MakeConfigFile
|
||||
{
|
||||
# Make config.ini file
|
||||
if(system("perl makecfgini.pl config.it $inDefaultVersion $inStagePath $inDistPath\\xpi $inURLPath") != 0)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
sub MakeJsFile
|
||||
{
|
||||
my($componentName) = @_;
|
||||
|
||||
# Make .js file
|
||||
if(system("perl makejs.pl $componentName.jst $inDefaultVersion \"$userAgent\" $inStagePath\\$componentName") != 0)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
sub MakeXpiFile
|
||||
{
|
||||
my($componentName) = @_;
|
||||
|
||||
# Make .xpi file
|
||||
if(system("perl makexpi.pl $componentName $inStagePath $inDistPath\\xpi") != 0)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
207
mozilla/xpinstall/packager/windows/makecfgini.pl
Normal file
@@ -0,0 +1,207 @@
|
||||
#!c:\perl\bin\perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
#
|
||||
|
||||
#
|
||||
# This perl script parses the input file for special variables
|
||||
# in the format of $Variable$ and replace it with the appropriate
|
||||
# value(s).
|
||||
#
|
||||
# Input: .it file
|
||||
# - which is a .ini template
|
||||
# version
|
||||
# - version to display on the blue background
|
||||
# Path to staging area
|
||||
# - path on where the seamonkey built bits are staged to
|
||||
# xpi path
|
||||
# - path on where xpi files will be located at
|
||||
# URL path
|
||||
# - path to where the .xpi files are staged. can be
|
||||
# either ftp:// or http://
|
||||
#
|
||||
# ie: perl makecfgini.pl config.it 5.0.0.1999120608 z:\exposed\windows\32bit\en\5.0 d:\builds\mozilla\dist\win32_0.obj\install\xpi ftp://sweetlou/products/client/seamonkey/windows/32bit/x86/1999-09-13-10-M10
|
||||
#
|
||||
|
||||
# Make sure there are at least two arguments
|
||||
if($#ARGV < 4)
|
||||
{
|
||||
die "usage: $0 <.it file> <version> <staging path> <.xpi path> <URL path>
|
||||
|
||||
.it file : input ini template file
|
||||
version : version to be shown in setup. Typically the same version
|
||||
as show in mozilla.exe.
|
||||
staging path : path to where the components are staged at
|
||||
.xpi path : path to where the .xpi files have been built to
|
||||
URL path : URL path to where the .xpi files will be staged at.
|
||||
Either ftp:// or http:// can be used
|
||||
\n";
|
||||
}
|
||||
|
||||
$inItFile = $ARGV[0];
|
||||
$inVersion = $ARGV[1];
|
||||
$inStagePath = $ARGV[2];
|
||||
$inXpiPath = $ARGV[3];
|
||||
$inURLPath = $ARGV[4];
|
||||
|
||||
# Get the name of the file replacing the .it extension with a .ini extension
|
||||
@inItFileSplit = split(/\./,$inItFile);
|
||||
$outIniFile = $inItFileSplit[0];
|
||||
$outIniFile .= ".ini";
|
||||
|
||||
# Open the input file
|
||||
open(fpInIt, $inItFile) || die "\ncould not open $ARGV[0]: $!\n";
|
||||
|
||||
# Open the output file
|
||||
open(fpOutIni, ">$outIniFile") || die "\nCould not open $outIniFile: $!\n";
|
||||
|
||||
print "\n Making $outIniFile...\n";
|
||||
|
||||
# While loop to read each line from input file
|
||||
while($line = <fpInIt>)
|
||||
{
|
||||
# For each line read, search and replace $InstallSize$ with the calculated size
|
||||
if($line =~ /\$InstallSize\$/i)
|
||||
{
|
||||
$installSize = 0;
|
||||
$installSizeSystem = 0;
|
||||
|
||||
# split read line by ":" deliminator
|
||||
@colonSplit = split(/:/, $line);
|
||||
if($#colonSplit >= 0)
|
||||
{
|
||||
$componentName = $colonSplit[1];
|
||||
chop($componentName);
|
||||
|
||||
$installSize = OutputInstallSize("$inStagePath\\$componentName");
|
||||
|
||||
# special oji consideration here. Since it's an installer that
|
||||
# seamonkey installer will be calling, the disk space allocation
|
||||
# needs to be adjusted by an expansion factor of 3.62.
|
||||
if($componentName =~ /oji/i)
|
||||
{
|
||||
$installSize = int($installSize * 3.62);
|
||||
}
|
||||
}
|
||||
|
||||
# Read the next line to calculate for the "Install Size System="
|
||||
if($line = <fpInIt>)
|
||||
{
|
||||
if($line =~ /\$InstallSizeSystem\$/i)
|
||||
{
|
||||
$installSizeSystem = OutputInstallSizeSystem($line, "$inStagePath\\$componentName");
|
||||
}
|
||||
}
|
||||
|
||||
$installSize -= $installSizeSystem;
|
||||
print fpOutIni "Install Size=$installSize\n";
|
||||
print fpOutIni "Install Size System=$installSizeSystem\n";
|
||||
}
|
||||
elsif($line =~ /\$InstallSizeArchive\$/i)
|
||||
{
|
||||
$installSizeArchive = 0;
|
||||
|
||||
# split read line by ":" deliminator
|
||||
@colonSplit = split(/:/, $line);
|
||||
if($#colonSplit >= 0)
|
||||
{
|
||||
$componentName = $colonSplit[1];
|
||||
chop($componentName);
|
||||
|
||||
$installSizeArchive = OutputInstallSizeArchive("$inXpiPath\\$componentName");
|
||||
}
|
||||
|
||||
print fpOutIni "Install Size Archive=$installSizeArchive\n";
|
||||
}
|
||||
elsif($line =~ /\$Version\$/i)
|
||||
{
|
||||
# For each line read, search and replace $Version$ with the version passed in
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
print fpOutIni $line;
|
||||
}
|
||||
else
|
||||
{
|
||||
# For each line read, search and replace $InstallSizeSystem$ with the calculated size
|
||||
$line =~ s/\$URLPath\$/$inURLPath/i;
|
||||
print fpOutIni $line;
|
||||
}
|
||||
}
|
||||
|
||||
print " done!\n";
|
||||
|
||||
# end of script
|
||||
exit(0);
|
||||
|
||||
sub OutputInstallSize()
|
||||
{
|
||||
my($inPath) = @_;
|
||||
my($installSize);
|
||||
|
||||
print " calculating size for $inPath\n";
|
||||
$installSize = `ds32.exe /D /L0 /A /S /C 32768 $inPath`;
|
||||
$installSize += 32768; # take into account install.js
|
||||
$installSize = int($installSize / 1024);
|
||||
$installSize += 1;
|
||||
return($installSize);
|
||||
}
|
||||
|
||||
sub OutputInstallSizeArchive()
|
||||
{
|
||||
my($inPath) = @_;
|
||||
my($installSizeArchive);
|
||||
my($dev, $ino, $mode, $nlink, $uid, $gui, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks);
|
||||
|
||||
print " calculating size for $inPath\n";
|
||||
($dev, $ino, $mode, $nlink, $uid, $gui, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat $inPath;
|
||||
$installSizeArchive += 32768; # take into account install.js
|
||||
$installSizeArchive = int($size / 1024);
|
||||
$installSizeArchive += 1;
|
||||
return($installSizeArchive);
|
||||
}
|
||||
|
||||
sub OutputInstallSizeSystem()
|
||||
{
|
||||
my($inLine, $inPath) = @_;
|
||||
my($installSizeSystem) = 0;
|
||||
|
||||
# split read line by ":" deliminator
|
||||
@colonSplit = split(/:/, $inLine);
|
||||
if($#colonSplit >= 0)
|
||||
{
|
||||
# split line by "," deliminator
|
||||
@commaSplit = split(/\,/, $colonSplit[1]);
|
||||
if($#commaSplit >= 0)
|
||||
{
|
||||
foreach(@commaSplit)
|
||||
{
|
||||
# calculate the size of component installed using ds32.exe in Kbytes
|
||||
print " calculating size for $inPath\\$_";
|
||||
$installSizeSystem += `ds32.exe /D /L0 /A /S /C 32768 $inPath\\$_`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$installSizeSystem = int($installSizeSystem / 1024);
|
||||
$installSizeSystem += 1;
|
||||
return($installSizeSystem);
|
||||
}
|
||||
|
||||
122
mozilla/xpinstall/packager/windows/makejs.pl
Normal file
@@ -0,0 +1,122 @@
|
||||
#!c:\perl\bin\perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
#
|
||||
|
||||
#
|
||||
# This perl script parses the input file for special variables
|
||||
# in the format of $Variable$ and replace it with the appropriate
|
||||
# value(s).
|
||||
#
|
||||
# Input: .jst file - which is a .js template
|
||||
# default version - a julian date in the form of:
|
||||
# major.minor.release.yydoy
|
||||
# ie: 5.0.0.99256
|
||||
# user agent - user agent of product
|
||||
# component staging path - path to where the components are staged at
|
||||
#
|
||||
# ie: perl makejs.pl core.jst 5.0.0.99256
|
||||
#
|
||||
|
||||
# Make sure there are at least two arguments
|
||||
if($#ARGV < 3)
|
||||
{
|
||||
die "usage: $0 <.jst file> <default version> <UserAgent> <staging path>
|
||||
|
||||
.jst file : .js template input file
|
||||
default version : default julian base version number to use in the
|
||||
form of: major.minor.release.yydoy
|
||||
ie: 5.0.0.99256
|
||||
user agent : user agent of product (5.0b1 [en])
|
||||
component staging path : path to where this component is staged at
|
||||
ie: z:\\stage\\windows\\32bit\\en\\5.0\\core
|
||||
\n";
|
||||
}
|
||||
|
||||
$inJstFile = $ARGV[0];
|
||||
$inVersion = $ARGV[1];
|
||||
$inUserAgent = $ARGV[2];
|
||||
$inStagePath = $ARGV[3];
|
||||
|
||||
# Get the name of the file replacing the .jst extension with a .js extension
|
||||
@inJstFileSplit = split(/\./,$inJstFile);
|
||||
$outJsFile = $inJstFileSplit[0];
|
||||
$outJsFile .= ".js";
|
||||
$outTempFile = $inJstFileSplit[0];
|
||||
$outTempFile .= ".template";
|
||||
|
||||
system("copy ..\\common\\share.t $outTempFile");
|
||||
system("cat $inJstFile >> $outTempFile");
|
||||
|
||||
# Open the input .template file
|
||||
open(fpInTemplate, $outTempFile) || die "\ncould not open $outTempFile: $!\n";
|
||||
|
||||
# Open the output .js file
|
||||
open(fpOutJs, ">$outJsFile") || die "\nCould not open $outJsFile: $!\n";
|
||||
|
||||
# While loop to read each line from input file
|
||||
while($line = <fpInTemplate>)
|
||||
{
|
||||
# For each line read, search and replace $Version$ with the version passed in
|
||||
if($line =~ /\$Version\$/i)
|
||||
{
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
}
|
||||
elsif($line =~ /\$UserAgent\$/i)
|
||||
{
|
||||
$line =~ s/\$UserAgent\$/$inUserAgent/i;
|
||||
}
|
||||
elsif($line =~ /\$SpaceRequired\$/i) # For each line read, search and replace $InstallSize$ with the calculated size
|
||||
{
|
||||
$spaceRequired = 0;
|
||||
|
||||
# split read line by ":" deliminator
|
||||
@colonSplit = split(/:/, $line);
|
||||
if($#colonSplit > 0)
|
||||
{
|
||||
@semiColonSplit = split(/;/, $colonSplit[1]);
|
||||
$subDir = $semiColonSplit[0];
|
||||
$spaceRequired = GetSpaceRequired("$inStagePath\\$subDir");
|
||||
$line =~ s/\$SpaceRequired\$:$subDir/$spaceRequired/i;
|
||||
}
|
||||
else
|
||||
{
|
||||
$spaceRequired = GetSpaceRequired("$inStagePath");
|
||||
$line =~ s/\$SpaceRequired\$/$spaceRequired/i;
|
||||
}
|
||||
}
|
||||
|
||||
print fpOutJs $line;
|
||||
}
|
||||
|
||||
sub GetSpaceRequired()
|
||||
{
|
||||
my($inPath) = @_;
|
||||
my($spaceRequired);
|
||||
|
||||
print " calulating size for $inPath\n";
|
||||
$spaceRequired = `ds32.exe /D /L0 /A /S /C 32768 $inPath`;
|
||||
$spaceRequired = int($spaceRequired / 1024);
|
||||
$spaceRequired += 1;
|
||||
return($spaceRequired);
|
||||
}
|
||||
|
||||
114
mozilla/xpinstall/packager/windows/makexpi.pl
Normal file
@@ -0,0 +1,114 @@
|
||||
#!c:\perl\bin\perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
#
|
||||
|
||||
#
|
||||
# This perl script creates .xpi files given component input name
|
||||
#
|
||||
# Input: component name
|
||||
# - name of the component directory located in the staging path
|
||||
# staging path
|
||||
# - path to where the built files are staged at
|
||||
# dest path
|
||||
# - path to where the .xpi files are are to be created at.
|
||||
# ** MUST BE AN ABSOLUTE PATH, NOT A RELATIVE PATH **
|
||||
#
|
||||
# ie: perl makexpi.pl core z:\exposed\windows\32bit\en\5.0 d:\build\mozilla\dist\win32_o.obj\install\working
|
||||
#
|
||||
|
||||
use File::Copy;
|
||||
use Cwd;
|
||||
|
||||
# Make sure there are at least three arguments
|
||||
if($#ARGV < 2)
|
||||
{
|
||||
die "usage: $0 <component name> <staging path> <dest path>
|
||||
|
||||
component name : name of component directory within staging path
|
||||
staging path : path to where the components are staged at
|
||||
dest path : path to where the .xpi files are to be created at
|
||||
\n";
|
||||
}
|
||||
|
||||
$inComponentName = $ARGV[0];
|
||||
$inStagePath = $ARGV[1];
|
||||
$inDestPath = $ARGV[2];
|
||||
|
||||
# check for existance of staging component path
|
||||
if(!(-e "$inStagePath\\$inComponentName"))
|
||||
{
|
||||
die "invalid path: $inStagePath\\$inComponentName\n";
|
||||
}
|
||||
|
||||
# check for existance of .js script
|
||||
if(!(-e "$inComponentName.js"))
|
||||
{
|
||||
die "missing .js script: $inComponentName.js\n";
|
||||
}
|
||||
|
||||
# delete component .xpi file
|
||||
if(-e "$inDestPath\\$inComponentName.xpi")
|
||||
{
|
||||
unlink("$inDestPath\\$inComponentName.xpi");
|
||||
}
|
||||
if(-e "$inStagePath\\$incomponentName\\$inComponentName.xpi")
|
||||
{
|
||||
unlink("$inDestPath\\$inComponentName.xpi");
|
||||
}
|
||||
|
||||
# delete install.js
|
||||
if(-e "install.js")
|
||||
{
|
||||
unlink("install.js");
|
||||
}
|
||||
|
||||
# make sure inDestPath exists
|
||||
if(!(-e "$inDestPath"))
|
||||
{
|
||||
system("mkdir $inDestPath");
|
||||
}
|
||||
|
||||
print "\n Making $inComponentName.xpi...\n";
|
||||
|
||||
$saveCwdir = cwd();
|
||||
|
||||
# change directory to where the files are, else zip will store
|
||||
# unwanted path information.
|
||||
chdir("$inStagePath\\$inComponentName");
|
||||
system("zip -r $inDestPath\\$inComponentName.xpi *");
|
||||
chdir("$saveCwdir");
|
||||
|
||||
copy("$inComponentName.js", "install.js");
|
||||
system("zip -g $inDestPath\\$inComponentName.xpi install.js");
|
||||
|
||||
# delete install.js
|
||||
if(-e "install.js")
|
||||
{
|
||||
unlink("install.js");
|
||||
}
|
||||
|
||||
print " done!\n";
|
||||
|
||||
# end of script
|
||||
exit(0);
|
||||
|
||||
111
mozilla/xpinstall/packager/windows/rdir.pl
Normal file
@@ -0,0 +1,111 @@
|
||||
#!c:\perl\bin\perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
#
|
||||
|
||||
use Cwd;
|
||||
|
||||
if($#ARGV < 0)
|
||||
{
|
||||
print_usage();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
print "removing directory:\n";
|
||||
for($i = 0; $i <= $#ARGV; $i++)
|
||||
{
|
||||
print " $ARGV[$i]";
|
||||
remove_dir_structure($ARGV[$i]);
|
||||
print "\n";
|
||||
}
|
||||
|
||||
exit(0);
|
||||
# end
|
||||
|
||||
sub remove_dir_structure
|
||||
{
|
||||
my($curr_dir) = @_;
|
||||
$save_cwd = cwd();
|
||||
$save_cwd =~ s/\//\\/g;
|
||||
if((-e "$curr_dir") && (-d "$curr_dir"))
|
||||
{
|
||||
remove_all_dir($curr_dir);
|
||||
chdir($save_cwd);
|
||||
remove_directory($curr_dir);
|
||||
print " done!";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(-e "$curr_dir"))
|
||||
{
|
||||
print "\n";
|
||||
print "$curr_dir does not exist!";
|
||||
}
|
||||
elsif(!(-d "$curr_dir"))
|
||||
{
|
||||
print "\n";
|
||||
print "$curr_dir is not a valid directory!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub remove_all_dir
|
||||
{
|
||||
my($curr_dir) = @_;
|
||||
my(@dirlist);
|
||||
my($dir);
|
||||
|
||||
chdir("$curr_dir");
|
||||
@dirlist = <*>;
|
||||
foreach $dir (@dirlist)
|
||||
{
|
||||
if(-d "$dir")
|
||||
{
|
||||
print ".";
|
||||
remove_all_dir($dir);
|
||||
}
|
||||
}
|
||||
chdir("..");
|
||||
remove_directory($curr_dir);
|
||||
}
|
||||
|
||||
sub remove_directory
|
||||
{
|
||||
my($directory) = @_;
|
||||
my($save_cwd);
|
||||
|
||||
$save_cwd = cwd();
|
||||
$save_cwd =~ s/\//\\/g;
|
||||
|
||||
if(-e "$directory")
|
||||
{
|
||||
chdir($directory);
|
||||
unlink <*>; # remove files
|
||||
chdir($save_cwd);
|
||||
rmdir $directory; # remove directory
|
||||
}
|
||||
}
|
||||
|
||||
sub print_usage
|
||||
{
|
||||
print "usage: $0 <dir1> [dir2 dir3...]\n";
|
||||
}
|
||||
233
mozilla/xpinstall/wizard/windows/builder/build.pl
Normal file
@@ -0,0 +1,233 @@
|
||||
#!c:\perl\bin\perl
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
|
||||
#
|
||||
# Purpose:
|
||||
# To build the mozilla self-extracting installer and its corresponding .xpi files
|
||||
# given a mozilla build on a local system.
|
||||
#
|
||||
# Requirements:
|
||||
# 1. perl needs to be installed correctly on the build system because cwd.pm is used.
|
||||
# 2. mozilla\xpinstall\wizard\windows needs to be built.
|
||||
# a. to build it, MFC must be installed with VC
|
||||
# b. set MOZ_MFC=1 in the build environment
|
||||
# c. run nmake -f makefile.win from the above directory
|
||||
#
|
||||
|
||||
if($ENV{MOZ_SRC} eq "")
|
||||
{
|
||||
print "Error: MOZ_SRC not set!";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$DEPTH = "$ENV{MOZ_SRC}\\mozilla";
|
||||
$cwdBuilder = "$DEPTH\\xpinstall\\wizard\\windows\\builder";
|
||||
$cwdBuilder =~ s/\//\\/g; # convert slashes to backslashes for Dos commands to work
|
||||
$cwdDist = GetCwd("dist", $DEPTH, $cwdBuilder);
|
||||
$cwdDistWin = GetCwd("distwin", $DEPTH, $cwdBuilder);
|
||||
$cwdInstall = GetCwd("install", $DEPTH, $cwdBuilder);
|
||||
$cwdPackager = GetCwd("packager", $DEPTH, $cwdBuilder);
|
||||
$verPartial = "5.0.0.";
|
||||
$ver = $verPartial . GetVersion($DEPTH);
|
||||
$ftpStr = "ftp://not.needed.com/because/the/xpi/files/will/be/located/in/the/same/dir/as/the/installer";
|
||||
|
||||
if(-e "$cwdDist\\stage")
|
||||
{
|
||||
system("perl $cwdPackager\\windows\\rdir.pl $cwdDist\\stage");
|
||||
}
|
||||
|
||||
mkdir("$cwdDist\\stage", 775);
|
||||
system("perl $cwdPackager\\pkgcp.pl -s $cwdDistWin -d $cwdDist\\stage -f $cwdPackager\\packages-win -o dos -v");
|
||||
|
||||
chdir("$cwdPackager\\windows");
|
||||
system("perl makeall.pl $ver $ftpStr $cwdDist\\stage $cwdDistWin\\install");
|
||||
chdir($cwdBuilder);
|
||||
|
||||
# Copy the .xpi files to the same directory as setup.exe.
|
||||
# This is so that setup.exe can find the .xpi files
|
||||
# in the same directory and use them.
|
||||
#
|
||||
# Mozilla-win32-install.exe (a self extracting file) will use the .xpi
|
||||
# files from its current directory as well, but it is not a requirement
|
||||
# that they exist because it already contains the .xpi files within itself.
|
||||
system("xcopy /f $cwdDistWin\\install\\xpi\\*.* $cwdDistWin\\install");
|
||||
|
||||
print "\n";
|
||||
print "**\n";
|
||||
print "*\n";
|
||||
print "* A self-extracting installer has been built and delivered:\n";
|
||||
print "*\n";
|
||||
print "* $cwdDistWin\\install\\mozilla-win32-install.exe\n";
|
||||
print "*\n";
|
||||
print "**\n";
|
||||
print "\n";
|
||||
|
||||
exit(0);
|
||||
|
||||
sub GetCwd
|
||||
{
|
||||
my($whichPath, $depthPath, $returnCwd) = @_;
|
||||
my($distCwd);
|
||||
my($distWinPathName);
|
||||
my($distPath);
|
||||
|
||||
# determine if build is debug or optimized
|
||||
if($ENV{MOZ_DEBUG} eq "")
|
||||
{
|
||||
$distWinPathName = "Win32_o.obj";
|
||||
}
|
||||
else
|
||||
{
|
||||
$distWinPathName = "Win32_d.obj";
|
||||
}
|
||||
|
||||
if($whichPath eq "dist")
|
||||
{
|
||||
# verify the existance of path
|
||||
if(!(-e "$depthPath\\dist"))
|
||||
{
|
||||
print "path not found: $depthPath\\dist\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$distPath = "$depthPath\\dist";
|
||||
}
|
||||
elsif($whichPath eq "distwin")
|
||||
{
|
||||
# verify the existance of path
|
||||
if(!(-e "$depthPath\\dist\\$distWinPathName"))
|
||||
{
|
||||
print "path not found: $depthPath\\dist\\$distWinPathName\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$distPath = "$depthPath\\dist\\$distWinPathName";
|
||||
}
|
||||
elsif($whichPath eq "install")
|
||||
{
|
||||
# verify the existance of path
|
||||
if(!(-e "$depthPath\\dist\\$distWinPathName\\install"))
|
||||
{
|
||||
print "path not found: $depthPath\\dist\\$distWinPathName\\install\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$distPath = "$depthPath\\dist\\$distWinPathName\\install";
|
||||
}
|
||||
elsif($whichPath eq "packager")
|
||||
{
|
||||
# verify the existance of path
|
||||
if(!(-e "$depthPath\\xpinstall\\packager"))
|
||||
{
|
||||
print "path not found: $depthPath\\xpinstall\\packager\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$distPath = "$depthPath\\xpinstall\\packager";
|
||||
}
|
||||
|
||||
$distPath =~ s/\//\\/g; # convert slashes to backslashes for Dos commands to work
|
||||
return($distPath);
|
||||
}
|
||||
|
||||
sub GetVersion
|
||||
{
|
||||
my($depthPath) = @_;
|
||||
my($fileMozilla);
|
||||
my($fileMozillaVer);
|
||||
my($distWinPathName);
|
||||
my($monAdjusted);
|
||||
my($yy);
|
||||
my($mm);
|
||||
my($dd);
|
||||
my($hh);
|
||||
|
||||
# determine if build is debug or optimized
|
||||
if($ENV{MOZ_DEBUG} eq "")
|
||||
{
|
||||
$distWinPathName = "Win32_o.obj";
|
||||
}
|
||||
else
|
||||
{
|
||||
$distWinPathName = "Win32_d.obj";
|
||||
}
|
||||
|
||||
$fileMozilla = "$depthPath\\dist\\$distWinPathName\\bin\\mozilla.exe";
|
||||
# verify the existance of file
|
||||
if(!(-e "$fileMozilla"))
|
||||
{
|
||||
print "file not found: $fileMozilla\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat $fileMozilla;
|
||||
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($mtime);
|
||||
|
||||
# calculate year
|
||||
# localtime() returns year 2000 as 100, we mod 100 to get at the last 2 digits
|
||||
$yy = $year % 100;
|
||||
if($yy < 10)
|
||||
{
|
||||
$yy = "200$yy";
|
||||
}
|
||||
else
|
||||
{
|
||||
$yy = "20$yy";
|
||||
}
|
||||
|
||||
# calculate month
|
||||
$monAdjusted = $mon + 1;
|
||||
if(($monAdjusted) < 10)
|
||||
{
|
||||
$mm = "0$monAdjusted";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mm = "$mon";
|
||||
}
|
||||
|
||||
# calculate month day
|
||||
if(($mday) < 10)
|
||||
{
|
||||
$dd = "0$mday";
|
||||
}
|
||||
else
|
||||
{
|
||||
$dd = "$mday";
|
||||
}
|
||||
|
||||
# calculate day hour
|
||||
if(($hour) < 10)
|
||||
{
|
||||
$hh = "0$hour";
|
||||
}
|
||||
else
|
||||
{
|
||||
$hh = "$hour";
|
||||
}
|
||||
|
||||
$fileMozillaVer = "$yy$mm$dd$hh";
|
||||
print "y2k compliant version string for $fileMozilla: $fileMozillaVer\n";
|
||||
return($fileMozillaVer);
|
||||
}
|
||||
|
||||
54
mozilla/xpinstall/wizard/windows/builder/readme.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
The contents of this file are subject to the Netscape 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/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code,
|
||||
released March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape Communications
|
||||
Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Sean Su <ssu@netscape.com>
|
||||
|
||||
|
||||
Purpose:
|
||||
To build the mozilla self-extracting installer and its corresponding .xpi files
|
||||
given a mozilla build on a local system.
|
||||
|
||||
Requirements:
|
||||
1. Perl needs to be installed correctly on the build system because cwd.pm is used.
|
||||
Preferably, perl version 5.004 or newer should be used.
|
||||
|
||||
2. Mozilla\xpinstall\wizard\windows needs to be built.
|
||||
a. to build it, MFC must be installed with VC6
|
||||
b. set MOZ_MFC=1 in the build environment
|
||||
c. run nmake -f makefile.win from the above directory
|
||||
|
||||
|
||||
Build.pl requires no parameters. When it finishes, it will have created a
|
||||
temporary staging area in mozilla\dist\stage to build the .xpi archives from.
|
||||
The self-extracting installer (mozilla-win32-installer.exe) will be delivered to:
|
||||
mozilla\dist\win32_o.obj\install
|
||||
|
||||
The .xpi archives will be delivered to:
|
||||
mozilla\dist\win32_o.obj\install\xpi
|
||||
|
||||
Mozilla-win32-installer.exe does not require the .xpi archives once its been created
|
||||
because they have been packaged up in the .exe file.
|
||||
|
||||
The .xpi archives will also be copied to:
|
||||
mozilla\dist\win32_o.obj\install
|
||||
|
||||
This is so setup.exe can install them. Setup.exe is usually run when debugging the
|
||||
installer code. This makes it easier to debug.
|
||||
|
||||
33
mozilla/xpinstall/wizard/windows/makefile.win
Normal file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
DIRS=$(DIRS) nsinstall \
|
||||
!if "$(WINOS)"=="WINNT"
|
||||
nsztool \
|
||||
!endif
|
||||
setup \
|
||||
setuprsc \
|
||||
ren8dot3
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
61
mozilla/xpinstall/wizard/windows/nsinstall/makefile.win
Normal file
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = EXE
|
||||
USE_NON_MT_LIBS = 1
|
||||
|
||||
MODULE = nsinstall
|
||||
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
|
||||
RESFILE = $(MODULE).res
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\nsinstall.obj \
|
||||
.\$(OBJDIR)\adler32.obj \
|
||||
.\$(OBJDIR)\infblock.obj \
|
||||
.\$(OBJDIR)\infcodes.obj \
|
||||
.\$(OBJDIR)\inffast.obj \
|
||||
.\$(OBJDIR)\inflate.obj \
|
||||
.\$(OBJDIR)\inftrees.obj \
|
||||
.\$(OBJDIR)\infutil.obj \
|
||||
.\$(OBJDIR)\uncompr.obj \
|
||||
.\$(OBJDIR)\zutil.obj \
|
||||
$(NULL)
|
||||
|
||||
LCFLAGS= -UMOZILLA_CLIENT
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
docopy:
|
||||
$(MAKE_INSTALL) $(DEPTH)\modules\zlib\src\*.h .
|
||||
$(MAKE_INSTALL) $(DEPTH)\modules\zlib\src\*.c .
|
||||
|
||||
export:: docopy
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\install
|
||||
|
||||
clobber_all::
|
||||
$(RM) inf*.* adler32.c uncompr.c z*.* trees.c deflate.* compr* gzio* example.c crc* mini*
|
||||
$(RM) $(DIST)\install\$(MODULE).exe
|
||||
|
||||
564
mozilla/xpinstall/wizard/windows/nsinstall/nsinstall.cpp
Normal file
@@ -0,0 +1,564 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "zlib.h"
|
||||
|
||||
#define BAR_MARGIN 1
|
||||
#define BAR_SPACING 2
|
||||
#define BAR_WIDTH 6
|
||||
#define MAX_BUF 4096
|
||||
|
||||
char szTitle[4096];
|
||||
HINSTANCE hInst;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Global Declarations
|
||||
|
||||
static DWORD nTotalBytes = 0; // sum of all the FILE resources
|
||||
|
||||
struct ExtractFilesDlgInfo {
|
||||
HWND hWndDlg;
|
||||
int nMaxBars; // maximum number of bars that can be displayed
|
||||
int nBars; // current number of bars to display
|
||||
} dlgInfo;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Utility Functions
|
||||
|
||||
// This function is similar to GetFullPathName except instead of
|
||||
// using the current drive and directory it uses the path of the
|
||||
// directory designated for temporary files
|
||||
static BOOL
|
||||
GetFullTempPathName(LPCTSTR lpszFileName, DWORD dwBufferLength, LPTSTR lpszBuffer)
|
||||
{
|
||||
DWORD dwLen;
|
||||
|
||||
dwLen = GetTempPath(dwBufferLength, lpszBuffer);
|
||||
if (lpszBuffer[dwLen - 1] != '\\')
|
||||
strcat(lpszBuffer, "\\");
|
||||
strcat(lpszBuffer, lpszFileName);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// this function appends a backslash at the end of a string,
|
||||
// if one does not already exists.
|
||||
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize)
|
||||
{
|
||||
if(szInput != NULL)
|
||||
{
|
||||
if(szInput[strlen(szInput) - 1] != '\\')
|
||||
{
|
||||
if(((DWORD)lstrlen(szInput) + 1) < dwInputSize)
|
||||
{
|
||||
lstrcat(szInput, "\\");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This function removes a directory and its subdirectories
|
||||
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs)
|
||||
{
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fdFile;
|
||||
char szDestTemp[MAX_BUF];
|
||||
BOOL bFound;
|
||||
|
||||
if(GetFileAttributes(szDestination) == -1)
|
||||
return(0);
|
||||
|
||||
if(bRemoveSubdirs == TRUE)
|
||||
{
|
||||
lstrcpy(szDestTemp, szDestination);
|
||||
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
|
||||
lstrcat(szDestTemp, "*");
|
||||
|
||||
bFound = TRUE;
|
||||
hFile = FindFirstFile(szDestTemp, &fdFile);
|
||||
while((hFile != INVALID_HANDLE_VALUE) && (bFound == TRUE))
|
||||
{
|
||||
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
|
||||
{
|
||||
/* create full path */
|
||||
lstrcpy(szDestTemp, szDestination);
|
||||
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
|
||||
lstrcat(szDestTemp, fdFile.cFileName);
|
||||
|
||||
if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
DirectoryRemove(szDestTemp, bRemoveSubdirs);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteFile(szDestTemp);
|
||||
}
|
||||
}
|
||||
|
||||
bFound = FindNextFile(hFile, &fdFile);
|
||||
}
|
||||
|
||||
FindClose(hFile);
|
||||
}
|
||||
|
||||
RemoveDirectory(szDestination);
|
||||
return(0);
|
||||
}
|
||||
|
||||
// Centers the specified window over the desktop. Assumes the window is
|
||||
// smaller both horizontally and vertically than the desktop
|
||||
static void
|
||||
CenterWindow(HWND hWndDlg)
|
||||
{
|
||||
RECT rect;
|
||||
int iLeft, iTop;
|
||||
|
||||
GetWindowRect(hWndDlg, &rect);
|
||||
iLeft = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
||||
iTop = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
||||
|
||||
SetWindowPos(hWndDlg, NULL, iLeft, iTop, -1, -1,
|
||||
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Extract Files Dialog
|
||||
|
||||
// This routine updates the status string in the extracting dialog
|
||||
static void
|
||||
SetStatusLine(LPCTSTR lpszStatus)
|
||||
{
|
||||
HWND hWndLabel = GetDlgItem(dlgInfo.hWndDlg, IDC_STATUS);
|
||||
|
||||
SetWindowText(hWndLabel, lpszStatus);
|
||||
UpdateWindow(hWndLabel);
|
||||
}
|
||||
|
||||
// This routine will update the progress bar to the specified percentage
|
||||
// (value between 0 and 100)
|
||||
static void
|
||||
UpdateProgressBar(unsigned value)
|
||||
{
|
||||
int nBars;
|
||||
|
||||
// Figure out how many bars should be displayed
|
||||
nBars = dlgInfo.nMaxBars * value / 100;
|
||||
|
||||
// Only paint if we need to display more bars
|
||||
if (nBars > dlgInfo.nBars) {
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE);
|
||||
RECT rect;
|
||||
|
||||
// Update the gauge state before painting
|
||||
dlgInfo.nBars = nBars;
|
||||
|
||||
// Only invalidate the part that needs updating
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
rect.left = BAR_MARGIN + (nBars - 1) * (BAR_WIDTH + BAR_SPACING);
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
|
||||
// Update the whole extracting dialog. We do this because we don't
|
||||
// have a message loop to process WM_PAINT messages in case the
|
||||
// extracting dialog was exposed
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
}
|
||||
|
||||
// Window proc for dialog
|
||||
BOOL APIENTRY
|
||||
DialogProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
// Center the dialog over the desktop
|
||||
CenterWindow(hWndDlg);
|
||||
return FALSE;
|
||||
|
||||
case WM_COMMAND:
|
||||
DestroyWindow(hWndDlg);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE; // didn't handle the message
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Resource Callback Functions
|
||||
|
||||
BOOL APIENTRY
|
||||
DeleteTempFilesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
|
||||
{
|
||||
char szTmpFile[MAX_PATH];
|
||||
|
||||
// Get the path to the file in the temp directory
|
||||
GetFullTempPathName(lpszName, sizeof(szTmpFile), szTmpFile);
|
||||
|
||||
// Delete the file
|
||||
DeleteFile(szTmpFile);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
SizeOfResourcesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
|
||||
{
|
||||
HRSRC hResInfo;
|
||||
|
||||
// Find the resource
|
||||
hResInfo = FindResource((HINSTANCE)hModule, lpszName, lpszType);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (!hResInfo) {
|
||||
char buf[512];
|
||||
|
||||
wsprintf(buf, "Error '%d' when loading FILE resource: %s", GetLastError(), lpszName);
|
||||
MessageBox(NULL, buf, szTitle, MB_OK | MB_ICONEXCLAMATION);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Add its size to the total size. Note that the return value is subject
|
||||
// to alignment rounding, but it's close enough for our purposes
|
||||
nTotalBytes += SizeofResource(NULL, hResInfo);
|
||||
|
||||
// Release the resource
|
||||
FreeResource(hResInfo);
|
||||
return TRUE; // keep enumerating
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
ExtractFilesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
|
||||
{
|
||||
char szTmpFile[MAX_PATH];
|
||||
char szArcLstFile[MAX_PATH];
|
||||
HRSRC hResInfo;
|
||||
HGLOBAL hGlobal;
|
||||
LPBYTE lpBytes;
|
||||
LPBYTE lpBytesUnCmp;
|
||||
HANDLE hFile;
|
||||
char szStatus[128];
|
||||
char szText[4096];
|
||||
|
||||
// Update the UI
|
||||
LoadString(hInst, IDS_STATUS_EXTRACTING, szText, sizeof(szText));
|
||||
wsprintf(szStatus, szText, lpszName);
|
||||
SetStatusLine(szStatus);
|
||||
|
||||
// Create a file in the temp directory
|
||||
GetFullTempPathName(lpszName, sizeof(szTmpFile), szTmpFile);
|
||||
|
||||
// Extract the file
|
||||
hResInfo = FindResource((HINSTANCE)hModule, lpszName, lpszType);
|
||||
hGlobal = LoadResource((HINSTANCE)hModule, hResInfo);
|
||||
lpBytes = (LPBYTE)LockResource(hGlobal);
|
||||
|
||||
// Create the file
|
||||
hFile = CreateFile(szTmpFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_TEMPORARY, NULL);
|
||||
|
||||
if (hFile != INVALID_HANDLE_VALUE) {
|
||||
DWORD dwSize;
|
||||
DWORD dwSizeUnCmp;
|
||||
DWORD dwTemp;
|
||||
|
||||
GetFullTempPathName("Archive.lst", sizeof(szArcLstFile), szArcLstFile);
|
||||
WritePrivateProfileString("Archives", lpszName, "TRUE", szArcLstFile);
|
||||
|
||||
lpBytesUnCmp = (LPBYTE)malloc((*(LPDWORD)(lpBytes + sizeof(DWORD))) + 1);
|
||||
dwSizeUnCmp = *(LPDWORD)(lpBytes + sizeof(DWORD));
|
||||
|
||||
// Copy the file. The first DWORD specifies the size of the file
|
||||
dwSize = *(LPDWORD)lpBytes;
|
||||
lpBytes += (sizeof(DWORD) * 2);
|
||||
|
||||
dwTemp = uncompress(lpBytesUnCmp, &dwSizeUnCmp, lpBytes, dwSize);
|
||||
|
||||
while (dwSizeUnCmp > 0)
|
||||
{
|
||||
DWORD dwBytesToWrite, dwBytesWritten;
|
||||
|
||||
dwBytesToWrite = dwSizeUnCmp > 4096 ? 4096 : dwSizeUnCmp;
|
||||
if (!WriteFile(hFile, lpBytesUnCmp, dwBytesToWrite, &dwBytesWritten, NULL))
|
||||
{
|
||||
char szBuf[512];
|
||||
|
||||
LoadString(hInst, IDS_STATUS_EXTRACTING, szText, sizeof(szText));
|
||||
wsprintf(szBuf, szText, szTmpFile);
|
||||
MessageBox(NULL, szBuf, szTitle, MB_OK | MB_ICONEXCLAMATION);
|
||||
FreeResource(hResInfo);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dwSizeUnCmp -= dwBytesWritten;
|
||||
lpBytesUnCmp += dwBytesWritten;
|
||||
|
||||
// Update the UI to reflect the total number of bytes written
|
||||
static DWORD nBytesWritten = 0;
|
||||
|
||||
nBytesWritten += dwBytesWritten;
|
||||
UpdateProgressBar(nBytesWritten * 100 / nTotalBytes);
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
|
||||
// Release the resource
|
||||
FreeResource(hResInfo);
|
||||
|
||||
return TRUE; // keep enumerating
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Progress bar
|
||||
|
||||
// Draws a recessed border around the gauge
|
||||
static void
|
||||
DrawGaugeBorder(HWND hWnd)
|
||||
{
|
||||
HDC hDC = GetWindowDC(hWnd);
|
||||
RECT rect;
|
||||
int cx, cy;
|
||||
HPEN hShadowPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
|
||||
HGDIOBJ hOldPen;
|
||||
|
||||
GetWindowRect(hWnd, &rect);
|
||||
cx = rect.right - rect.left;
|
||||
cy = rect.bottom - rect.top;
|
||||
|
||||
// Draw a dark gray line segment
|
||||
hOldPen = SelectObject(hDC, (HGDIOBJ)hShadowPen);
|
||||
MoveToEx(hDC, 0, cy - 1, NULL);
|
||||
LineTo(hDC, 0, 0);
|
||||
LineTo(hDC, cx - 1, 0);
|
||||
|
||||
// Draw a white line segment
|
||||
SelectObject(hDC, GetStockObject(WHITE_PEN));
|
||||
MoveToEx(hDC, 0, cy - 1, NULL);
|
||||
LineTo(hDC, cx - 1, cy - 1);
|
||||
LineTo(hDC, cx - 1, 0);
|
||||
|
||||
SelectObject(hDC, hOldPen);
|
||||
DeleteObject(hShadowPen);
|
||||
ReleaseDC(hWnd, hDC);
|
||||
}
|
||||
|
||||
// Draws the blue progress bar
|
||||
static void
|
||||
DrawProgressBar(HWND hWnd)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC = BeginPaint(hWnd, &ps);
|
||||
RECT rect;
|
||||
HBRUSH hBlueBrush = CreateSolidBrush(RGB(0, 0, 128));
|
||||
|
||||
// Draw the bars
|
||||
GetClientRect(hWnd, &rect);
|
||||
rect.left = rect.top = BAR_MARGIN;
|
||||
rect.bottom -= BAR_MARGIN;
|
||||
rect.right = rect.left + BAR_WIDTH;
|
||||
|
||||
for (int i = 0; i < dlgInfo.nBars; i++) {
|
||||
RECT dest;
|
||||
|
||||
if (IntersectRect(&dest, &ps.rcPaint, &rect))
|
||||
FillRect(hDC, &rect, hBlueBrush);
|
||||
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
|
||||
}
|
||||
|
||||
DeleteObject(hBlueBrush);
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
|
||||
// Adjusts the width of the gauge based on the maximum number of bars
|
||||
static void
|
||||
SizeToFitGauge(HWND hWnd)
|
||||
{
|
||||
RECT rect;
|
||||
int cx;
|
||||
|
||||
// Get the window size in pixels
|
||||
GetWindowRect(hWnd, &rect);
|
||||
|
||||
// Size the width to fit
|
||||
cx = 2 * GetSystemMetrics(SM_CXBORDER) + 2 * BAR_MARGIN +
|
||||
dlgInfo.nMaxBars * BAR_WIDTH + (dlgInfo.nMaxBars - 1) * BAR_SPACING;
|
||||
|
||||
SetWindowPos(hWnd, NULL, -1, -1, cx, rect.bottom - rect.top,
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
// Window proc for gauge
|
||||
LRESULT APIENTRY
|
||||
GaugeWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DWORD dwStyle;
|
||||
RECT rect;
|
||||
|
||||
switch (msg) {
|
||||
case WM_NCCREATE:
|
||||
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
|
||||
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
|
||||
return TRUE;
|
||||
|
||||
case WM_CREATE:
|
||||
// Figure out the maximum number of bars that can be displayed
|
||||
GetClientRect(hWnd, &rect);
|
||||
dlgInfo.nBars = 0;
|
||||
dlgInfo.nMaxBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) /
|
||||
(BAR_WIDTH + BAR_SPACING);
|
||||
|
||||
// Size the gauge to exactly fit the maximum number of bars
|
||||
SizeToFitGauge(hWnd);
|
||||
return TRUE;
|
||||
|
||||
case WM_NCPAINT:
|
||||
DrawGaugeBorder(hWnd);
|
||||
return TRUE;
|
||||
|
||||
case WM_PAINT:
|
||||
DrawProgressBar(hWnd);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return DefWindowProc(hWnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// WinMain
|
||||
|
||||
static BOOL
|
||||
RunInstaller(LPSTR lpCmdLine)
|
||||
{
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO sti;
|
||||
char szCmdLine[MAX_PATH];
|
||||
BOOL bRet;
|
||||
char szText[256];
|
||||
char szTempPath[4096];
|
||||
char szTmp[MAX_PATH];
|
||||
char szCurrentDirectory[MAX_PATH];
|
||||
char szBuf[MAX_PATH];
|
||||
|
||||
// Update UI
|
||||
UpdateProgressBar(100);
|
||||
LoadString(hInst, IDS_STATUS_LAUNCHING_SETUP, szText, sizeof(szText));
|
||||
SetStatusLine(szText);
|
||||
|
||||
memset(&sti,0,sizeof(sti));
|
||||
sti.cb = sizeof(STARTUPINFO);
|
||||
|
||||
// Setup program is in the directory specified for temporary files
|
||||
GetFullTempPathName("SETUP.EXE", sizeof(szCmdLine), szCmdLine);
|
||||
GetTempPath(4096, szTempPath);
|
||||
GetCurrentDirectory(MAX_PATH, szCurrentDirectory);
|
||||
GetShortPathName(szCurrentDirectory, szBuf, MAX_PATH);
|
||||
|
||||
lstrcat(szCmdLine, " -a");
|
||||
lstrcat(szCmdLine, szBuf);
|
||||
|
||||
if((lpCmdLine != NULL) && (*lpCmdLine != '\0'))
|
||||
{
|
||||
lstrcat(szCmdLine, " ");
|
||||
lstrcat(szCmdLine, lpCmdLine);
|
||||
}
|
||||
|
||||
// Launch the installer
|
||||
bRet = CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, szTempPath, &sti, &pi);
|
||||
|
||||
if (!bRet)
|
||||
return FALSE;
|
||||
|
||||
CloseHandle(pi.hThread);
|
||||
|
||||
// Wait for the InstallShield UI to appear before taking down the dialog box
|
||||
WaitForInputIdle(pi.hProcess, 3000); // wait up to 3 seconds
|
||||
DestroyWindow(dlgInfo.hWndDlg);
|
||||
|
||||
// Wait for the installer to complete
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
CloseHandle(pi.hProcess);
|
||||
|
||||
// That was just the installer bootstrapper. Now we need to wait for the
|
||||
// installer itself. We can find the process ID by looking for a window of
|
||||
// class ISINSTALLSCLASS
|
||||
HWND hWnd = FindWindow("ISINSTALLSCLASS", NULL);
|
||||
|
||||
if (hWnd) {
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
|
||||
// Get the associated process handle and wait for it to terminate
|
||||
GetWindowThreadProcessId(hWnd, &dwProcessId);
|
||||
|
||||
// We need the process handle to use WaitForSingleObject
|
||||
hProcess = OpenProcess(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE, FALSE, dwProcessId);
|
||||
|
||||
if (hProcess) {
|
||||
WaitForSingleObject(hProcess, INFINITE);
|
||||
CloseHandle(hProcess);
|
||||
}
|
||||
}
|
||||
// Delete the files from the temp directory
|
||||
EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)DeleteTempFilesProc, 0);
|
||||
|
||||
// delete archive.lst file in the temp directory
|
||||
GetFullTempPathName("Archive.lst", sizeof(szTmp), szTmp);
|
||||
DeleteFile(szTmp);
|
||||
GetFullTempPathName("core.ns", sizeof(szTmp), szTmp);
|
||||
DirectoryRemove(szTmp, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int APIENTRY
|
||||
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
hInst = hInstance;
|
||||
LoadString(hInst, IDS_TITLE, szTitle, sizeof(szTitle));
|
||||
|
||||
// Figure out the total size of the resources
|
||||
EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)SizeOfResourcesProc, 0);
|
||||
|
||||
// Register a class for the gauge
|
||||
memset(&wc, 0, sizeof(wc));
|
||||
wc.lpfnWndProc = (WNDPROC)GaugeWndProc;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
|
||||
wc.lpszClassName = "NSGauge";
|
||||
RegisterClass(&wc);
|
||||
|
||||
// Display the dialog box
|
||||
dlgInfo.hWndDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXTRACTING),
|
||||
NULL, (DLGPROC)DialogProc);
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
|
||||
// Extract the files
|
||||
EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)ExtractFilesProc, 0);
|
||||
|
||||
// Launch the install program and wait for it to finish
|
||||
RunInstaller(lpCmdLine);
|
||||
return 0;
|
||||
}
|
||||
BIN
mozilla/xpinstall/wizard/windows/nsinstall/nsinstall.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
125
mozilla/xpinstall/wizard/windows/nsinstall/nsinstall.rc
Normal file
@@ -0,0 +1,125 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include "resource.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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_EXTRACTING DIALOG DISCARDABLE 0, 0, 193, 61
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Extracting..."
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "",IDC_STATUS,9,13,159,8
|
||||
CONTROL "",IDC_GAUGE,"NSGauge",0x0,9,31,175,11
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
1 ICON DISCARDABLE "nsinstall.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_STATUS_EXTRACTING "Extracting %s"
|
||||
IDS_STATUS_LAUNCHING_SETUP "Launching Setup..."
|
||||
IDS_ERROR_FILE_WRITE "Unable to write file %s"
|
||||
IDS_TITLE "Netscape Communicator Installation"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
52
mozilla/xpinstall/wizard/windows/nsinstall/resource.h
Normal file
@@ -0,0 +1,52 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by nsinstall.rc
|
||||
//
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include "winuser.h"
|
||||
#include "winresrc.h"
|
||||
|
||||
#define IDS_PROMPT 1
|
||||
#define IDS_STATUS_EXTRACTING 2
|
||||
#define IDS_STATUS_LAUNCHING_SETUP 3
|
||||
#define IDS_ERROR_FILE_WRITE 4
|
||||
#define IDS_TITLE 5
|
||||
#define IDD_EXTRACTING 101
|
||||
#define IDC_STATUS 1001
|
||||
#define IDC_GAUGE 1002
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1003
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#define _APS_NO_MFC 1
|
||||
#endif
|
||||
#endif
|
||||
109
mozilla/xpinstall/wizard/windows/nszip/mainfrm.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// mainfrm.cpp : implementation of the CMainFrame class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "nszip.h"
|
||||
|
||||
#include "mainfrm.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char BASED_CODE THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
|
||||
//{{AFX_MSG_MAP(CMainFrame)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// arrays of IDs used to initialize control bars
|
||||
|
||||
static UINT BASED_CODE indicators[] =
|
||||
{
|
||||
ID_SEPARATOR, // status line indicator
|
||||
ID_INDICATOR_CAPS,
|
||||
ID_INDICATOR_NUM,
|
||||
ID_INDICATOR_SCRL,
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame construction/destruction
|
||||
|
||||
CMainFrame::CMainFrame()
|
||||
{
|
||||
// TODO: add member initialization code here
|
||||
|
||||
}
|
||||
|
||||
CMainFrame::~CMainFrame()
|
||||
{
|
||||
}
|
||||
|
||||
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
if (!m_wndStatusBar.Create(this) ||
|
||||
!m_wndStatusBar.SetIndicators(indicators,
|
||||
sizeof(indicators)/sizeof(UINT)))
|
||||
{
|
||||
TRACE0("Failed to create status bar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMainFrame::AssertValid() const
|
||||
{
|
||||
CFrameWnd::AssertValid();
|
||||
}
|
||||
|
||||
void CMainFrame::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CFrameWnd::Dump(dc);
|
||||
}
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame message handlers
|
||||
68
mozilla/xpinstall/wizard/windows/nszip/mainfrm.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// mainfrm.h : interface of the CMainFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class CMainFrame : public CFrameWnd
|
||||
{
|
||||
protected: // create from serialization only
|
||||
CMainFrame();
|
||||
DECLARE_DYNCREATE(CMainFrame)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMainFrame)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMainFrame();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected: // control bar embedded members
|
||||
CStatusBar m_wndStatusBar;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMainFrame)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
55
mozilla/xpinstall/wizard/windows/nszip/makefile.win
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = EXE
|
||||
USE_STATIC_LIBS = 1
|
||||
|
||||
MODULE = nszip
|
||||
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
|
||||
RESFILE = $(MODULE).res
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\nszip.obj \
|
||||
.\$(OBJDIR)\mainfrm.obj \
|
||||
.\$(OBJDIR)\nszipdoc.obj \
|
||||
.\$(OBJDIR)\nszipvw.obj \
|
||||
.\$(OBJDIR)\stdafx.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\zlib_s.lib \
|
||||
$(NULL)
|
||||
|
||||
LLFLAGS= \
|
||||
/subsystem:windows \
|
||||
/machine:i386 \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\install
|
||||
|
||||
clobber_all::
|
||||
$(RM) $(DIST)\install\$(MODULE).exe
|
||||
|
||||
202
mozilla/xpinstall/wizard/windows/nszip/nszip.cpp
Normal file
@@ -0,0 +1,202 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// nszip.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "nszip.h"
|
||||
|
||||
#include "mainfrm.h"
|
||||
#include "nszipdoc.h"
|
||||
#include "nszipvw.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char BASED_CODE THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNsZipApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CNsZipApp)
|
||||
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG_MAP
|
||||
// Standard file based document commands
|
||||
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
|
||||
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipApp construction
|
||||
|
||||
CNsZipApp::CNsZipApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CNsZipApp object
|
||||
|
||||
CNsZipApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipApp initialization
|
||||
|
||||
void CNsZipApp::ProcessCmdLine()
|
||||
{
|
||||
// Make a copy of the command line since we will change it while parsing
|
||||
CString strCmdLine(m_lpCmdLine);
|
||||
|
||||
// Get the name of the archive
|
||||
LPSTR lpArchive = strtok((LPSTR)(LPCSTR)strCmdLine, " ");
|
||||
|
||||
if (lpArchive) {
|
||||
char szPath[MAX_PATH], szExtension[_MAX_EXT];
|
||||
LPSTR lpFiles;
|
||||
CDocTemplate* pTemplate;
|
||||
CNsZipDoc* pDoc;
|
||||
|
||||
// ASSERT(m_templateList.GetCount() == 1);
|
||||
// pTemplate = (CDocTemplate*)m_templateList.GetHead();
|
||||
|
||||
POSITION pos = GetFirstDocTemplatePosition();
|
||||
|
||||
pTemplate = (CDocTemplate*)GetNextDocTemplate(pos);
|
||||
ASSERT(pTemplate);
|
||||
ASSERT(pTemplate->IsKindOf(RUNTIME_CLASS(CDocTemplate)));
|
||||
|
||||
// Create a new document
|
||||
VERIFY(pDoc = (CNsZipDoc*)pTemplate->CreateNewDocument());
|
||||
|
||||
// We need a fully qualified pathname
|
||||
::GetFullPathName(lpArchive, sizeof(szPath), szPath, NULL);
|
||||
|
||||
// Make sure it ends with .EXE
|
||||
_splitpath(szPath, NULL, NULL, NULL, szExtension);
|
||||
if (stricmp(szExtension, ".exe") != 0)
|
||||
strcat(szPath, ".exe");
|
||||
|
||||
// Now go ahead and create the archive
|
||||
pDoc->OnNewDocument(szPath);
|
||||
|
||||
// Process the files. These can be wildcards
|
||||
while (lpFiles = strtok(NULL, " "))
|
||||
pDoc->AddFiles(lpFiles);
|
||||
// while (lpFiles = strtok(lpArchive, " "))
|
||||
// pDoc->AddFiles(lpFiles);
|
||||
|
||||
pDoc->OnSaveDocument(szPath);
|
||||
delete pDoc;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CNsZipApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
Enable3dControls();
|
||||
|
||||
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
|
||||
|
||||
// Register the application's document templates. Document templates
|
||||
// serve as the connection between documents, frame windows and views.
|
||||
CSingleDocTemplate* pDocTemplate;
|
||||
pDocTemplate = new CSingleDocTemplate(
|
||||
IDR_MAINFRAME,
|
||||
RUNTIME_CLASS(CNsZipDoc),
|
||||
RUNTIME_CLASS(CMainFrame), // main SDI frame window
|
||||
RUNTIME_CLASS(CNsZipView));
|
||||
AddDocTemplate(pDocTemplate);
|
||||
|
||||
if (m_lpCmdLine[0] != '\0') {
|
||||
ProcessCmdLine();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// create a new (empty) document
|
||||
OnFileNew();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
//}}AFX_DATA
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
// App command to run the dialog
|
||||
void CNsZipApp::OnAppAbout()
|
||||
{
|
||||
CAboutDlg aboutDlg;
|
||||
aboutDlg.DoModal();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipApp commands
|
||||
|
||||
66
mozilla/xpinstall/wizard/windows/nszip/nszip.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// nszip.h : main header file for the NSZIP application
|
||||
//
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
#include "zlib.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipApp:
|
||||
// See nszip.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CNsZipApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CNsZipApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CNsZipApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
void ProcessCmdLine();
|
||||
|
||||
//{{AFX_MSG(CNsZipApp)
|
||||
afx_msg void OnAppAbout();
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
305
mozilla/xpinstall/wizard/windows/nszip/nszip.rc
Normal file
@@ -0,0 +1,305 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
//Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""res\\nszip.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"\r\n"
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"#include ""afxres.rc"" \011// Standard components\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\nszip.ico"
|
||||
IDR_NSZIPTYPE ICON DISCARDABLE "res\\nszipdoc.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&New Archive...\tCtrl+N", ID_FILE_NEW
|
||||
MENUITEM "&Open Archive...\tCtrl+O", ID_FILE_OPEN
|
||||
MENUITEM "&Close Archive\tCtrl+L", ID_FILE_CLOSE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", ID_APP_EXIT
|
||||
END
|
||||
POPUP "&Actions"
|
||||
BEGIN
|
||||
MENUITEM "Add...\tCtrl+A", ID_ACTIONS_ADD
|
||||
MENUITEM "&Delete\tCtrl+D", ID_ACTIONS_DELETE
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About NsZip...", ID_APP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
|
||||
BEGIN
|
||||
"N", ID_FILE_NEW, VIRTKEY, CONTROL
|
||||
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
|
||||
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
|
||||
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
|
||||
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
|
||||
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
|
||||
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
|
||||
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
|
||||
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
|
||||
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
|
||||
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
|
||||
VK_F6, ID_NEXT_PANE, VIRTKEY
|
||||
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 34, 22, 217, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About nszip"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||
LTEXT "nszip Version 1.0",IDC_STATIC,40,10,119,8
|
||||
LTEXT "Copyright \251 1995",IDC_STATIC,40,25,119,8
|
||||
DEFPUSHBUTTON "OK",IDOK,176,6,32,14,WS_GROUP
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "NSZIP MFC Application\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "NSZIP\0"
|
||||
VALUE "LegalCopyright", "Copyright \251 1995\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "NSZIP.EXE\0"
|
||||
VALUE "ProductName", "NSZIP Application\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAINFRAME "nszip\n\nNszip\n\n\nNszip.Document\nNszip Document"
|
||||
END
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_APP_TITLE "nszip"
|
||||
AFX_IDS_IDLEMESSAGE "Ready"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_INDICATOR_EXT "EXT"
|
||||
ID_INDICATOR_CAPS "CAP"
|
||||
ID_INDICATOR_NUM "NUM"
|
||||
ID_INDICATOR_SCRL "SCRL"
|
||||
ID_INDICATOR_OVR "OVR"
|
||||
ID_INDICATOR_REC "REC"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_FILE_NEW "Create a new archive\nNew"
|
||||
ID_FILE_OPEN "Open an existing archive\nOpen"
|
||||
ID_FILE_CLOSE "Close the active archive\nClose"
|
||||
ID_FILE_SAVE "Save the active document\nSave"
|
||||
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
|
||||
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_FILE_MRU_FILE1 "Open this document"
|
||||
ID_FILE_MRU_FILE2 "Open this document"
|
||||
ID_FILE_MRU_FILE3 "Open this document"
|
||||
ID_FILE_MRU_FILE4 "Open this document"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
|
||||
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_EDIT_CLEAR "Erase the selection\nErase"
|
||||
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
|
||||
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
|
||||
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
|
||||
ID_EDIT_FIND "Find the specified text\nFind"
|
||||
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
|
||||
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
|
||||
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
|
||||
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
|
||||
ID_EDIT_UNDO "Undo the last action\nUndo"
|
||||
ID_EDIT_REDO "Redo the previously undone action\nRedo"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCSIZE "Change the window size"
|
||||
AFX_IDS_SCMOVE "Change the window position"
|
||||
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
|
||||
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
|
||||
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
|
||||
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
|
||||
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCRESTORE "Restore the window to normal size"
|
||||
AFX_IDS_SCTASKLIST "Activate Task List"
|
||||
END
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#include "res\nszip.rc2" // non-Microsoft Visual C++ edited resources
|
||||
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
#include "afxres.rc" // Standard components
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
264
mozilla/xpinstall/wizard/windows/nszip/nszipdoc.cpp
Normal file
@@ -0,0 +1,264 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// nszipdoc.cpp : implementation of the CNsZipDoc class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "nszip.h"
|
||||
|
||||
#include "nszipdoc.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char BASED_CODE THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipDoc
|
||||
|
||||
IMPLEMENT_DYNCREATE(CNsZipDoc, CDocument)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNsZipDoc, CDocument)
|
||||
//{{AFX_MSG_MAP(CNsZipDoc)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipDoc construction/destruction
|
||||
|
||||
CNsZipDoc::CNsZipDoc()
|
||||
{
|
||||
m_hUpdateFile = NULL;
|
||||
}
|
||||
|
||||
CNsZipDoc::~CNsZipDoc()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CNsZipDoc::OnNewDocument(LPCTSTR lpszPathName)
|
||||
{
|
||||
char szStub[MAX_PATH];
|
||||
|
||||
// If we were doing a resource update, discard any changes
|
||||
if (m_hUpdateFile) {
|
||||
VERIFY(::EndUpdateResource(m_hUpdateFile, TRUE));
|
||||
|
||||
// Delete the archive
|
||||
DeleteFile(m_strPathName);
|
||||
}
|
||||
|
||||
if (!CDocument::OnNewDocument())
|
||||
return FALSE;
|
||||
|
||||
// Set the pathname
|
||||
SetPathName(lpszPathName);
|
||||
|
||||
// Copy the stub executable and make it the basis of the archive
|
||||
::GetModuleFileName(NULL, szStub, sizeof(szStub));
|
||||
strcpy(strrchr(szStub, '\\') + 1, "Nsinstall.exe");
|
||||
::CopyFile(szStub, m_strPathName, FALSE); // overwrite an existing file
|
||||
|
||||
// Get a handle we can use with UpdateResource()
|
||||
VERIFY(m_hUpdateFile = ::BeginUpdateResource(m_strPathName, FALSE));
|
||||
return m_hUpdateFile != NULL;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipDoc serialization
|
||||
|
||||
void CNsZipDoc::Serialize(CArchive& ar)
|
||||
{
|
||||
if (ar.IsStoring())
|
||||
{
|
||||
// TODO: add storing code here
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: add loading code here
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipDoc diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CNsZipDoc::AssertValid() const
|
||||
{
|
||||
CDocument::AssertValid();
|
||||
}
|
||||
|
||||
void CNsZipDoc::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CDocument::Dump(dc);
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipDoc commands
|
||||
|
||||
void CNsZipDoc::OnCloseDocument()
|
||||
{
|
||||
// If we were doing a resource update, discard any changes
|
||||
if (m_hUpdateFile) {
|
||||
VERIFY(::EndUpdateResource(m_hUpdateFile, TRUE));
|
||||
m_hUpdateFile = NULL;
|
||||
|
||||
// Delete the archive
|
||||
DeleteFile(m_strPathName);
|
||||
}
|
||||
|
||||
CDocument::OnCloseDocument();
|
||||
}
|
||||
|
||||
BOOL CNsZipDoc::OnOpenDocument(LPCTSTR lpszPathName)
|
||||
{
|
||||
// If we were doing a resource update, discard any changes
|
||||
if (m_hUpdateFile) {
|
||||
VERIFY(::EndUpdateResource(m_hUpdateFile, TRUE));
|
||||
|
||||
// Delete the archive
|
||||
DeleteFile(m_strPathName);
|
||||
}
|
||||
|
||||
DeleteContents();
|
||||
|
||||
// ZZZ: Get a list of all the FILE resources
|
||||
ASSERT(FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CNsZipDoc::DeleteContents()
|
||||
{
|
||||
m_hUpdateFile = NULL;
|
||||
CDocument::DeleteContents();
|
||||
}
|
||||
|
||||
BOOL CNsZipDoc::OnSaveDocument(LPCTSTR lpszPathName)
|
||||
{
|
||||
// If we were doing a resource update, save any changes
|
||||
if (m_hUpdateFile) {
|
||||
BOOL bRet = ::EndUpdateResource(m_hUpdateFile, FALSE);
|
||||
|
||||
ASSERT(bRet);
|
||||
m_hUpdateFile = NULL;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Add a single file to the archive
|
||||
BOOL CNsZipDoc::AddFile(LPCTSTR lpszFile)
|
||||
{
|
||||
HANDLE hFile;
|
||||
LPBYTE lpBuf;
|
||||
LPBYTE lpBufCmp;
|
||||
DWORD dwBytesRead;
|
||||
DWORD dwFileSize;
|
||||
DWORD dwFileSizeCmp;
|
||||
|
||||
// Check if we are trying to add the archive file itself
|
||||
// (this could happen if the user passes *.* as a file spec)
|
||||
if (m_strPathName.CompareNoCase(lpszFile) == 0)
|
||||
return FALSE;
|
||||
|
||||
// Open the file
|
||||
hFile = ::CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return FALSE;
|
||||
|
||||
// Figure out how big the file is
|
||||
dwFileSize = GetFileSize(hFile, NULL);
|
||||
|
||||
// Allocate enough space for the file contents and a DWORD header that
|
||||
// contains the size of the file
|
||||
lpBuf = (LPBYTE)malloc(dwFileSize);
|
||||
lpBufCmp = (LPBYTE)malloc(dwFileSize + (sizeof(DWORD) * 2));
|
||||
dwFileSizeCmp = dwFileSize;
|
||||
|
||||
if (lpBuf) {
|
||||
CString strResourceName = strrchr(lpszFile, '\\') + 1;
|
||||
|
||||
// It's really important that the resource name be UPPERCASE
|
||||
strResourceName.MakeUpper();
|
||||
|
||||
// *(LPDWORD)lpBuf = dwFileSize;
|
||||
::ReadFile(hFile, lpBuf, dwFileSize, &dwBytesRead, NULL);
|
||||
ASSERT(dwBytesRead == dwFileSize);
|
||||
|
||||
if(compress((lpBufCmp + (sizeof(DWORD) * 2)), &dwFileSizeCmp, (const Bytef*)lpBuf, dwFileSize) != Z_OK)
|
||||
return(FALSE);
|
||||
|
||||
// The first DWORD holds the total size of the file to be stored in the
|
||||
// resource (in this case, it's the compressed size)
|
||||
// The second DWORD holds the original uncompressed size of the file.
|
||||
*(LPDWORD)lpBufCmp = dwFileSizeCmp;
|
||||
*(LPDWORD)(lpBufCmp + sizeof(DWORD)) = dwFileSize;
|
||||
|
||||
VERIFY(::UpdateResource(m_hUpdateFile, "FILE", strResourceName,
|
||||
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), lpBufCmp, dwFileSizeCmp + (sizeof(DWORD) * 2)));
|
||||
}
|
||||
|
||||
free(lpBuf);
|
||||
::CloseHandle(hFile);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Add one or more files to the archive (lpszFiles can be a wildcard)
|
||||
void CNsZipDoc::AddFiles(LPCTSTR lpszFiles)
|
||||
{
|
||||
ASSERT(m_hUpdateFile);
|
||||
ASSERT(lpszFiles);
|
||||
|
||||
if (lpszFiles) {
|
||||
HANDLE hFindFile;
|
||||
WIN32_FIND_DATA findFileData;
|
||||
char szPath[MAX_PATH];
|
||||
|
||||
// Get a full pathname to the files
|
||||
::GetFullPathName(lpszFiles, sizeof(szPath), szPath, NULL);
|
||||
|
||||
// Get the first file that matches
|
||||
hFindFile = ::FindFirstFile(szPath, &findFileData);
|
||||
|
||||
if (hFindFile == INVALID_HANDLE_VALUE)
|
||||
return;
|
||||
|
||||
do {
|
||||
char szFile[MAX_PATH];
|
||||
|
||||
// We need to pass to AddFile() whatever kind of path we were passed,
|
||||
// e.g. simple, relative, full
|
||||
strcpy(szFile, szPath);
|
||||
strcpy(strrchr(szFile, '\\') + 1, findFileData.cFileName);
|
||||
AddFile(szFile);
|
||||
} while (::FindNextFile(hFindFile, &findFileData));
|
||||
|
||||
::FindClose(hFindFile);
|
||||
}
|
||||
}
|
||||
80
mozilla/xpinstall/wizard/windows/nszip/nszipdoc.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// nszipdoc.h : interface of the CNsZipDoc class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class CNsZipDoc : public CDocument
|
||||
{
|
||||
protected: // create from serialization only
|
||||
CNsZipDoc();
|
||||
DECLARE_DYNCREATE(CNsZipDoc)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
// Create an archive with the specified file name. Wrapper around
|
||||
// the MFC OnNewDocument member
|
||||
BOOL OnNewDocument(LPCTSTR lpszPathName);
|
||||
|
||||
// Add a single file to the archive
|
||||
BOOL AddFile(LPCTSTR lpszFile);
|
||||
|
||||
// Add one or more files to the archive (lpszFiles can be a wildcard)
|
||||
void AddFiles(LPCTSTR lpszFiles);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CNsZipDoc)
|
||||
public:
|
||||
virtual void OnCloseDocument();
|
||||
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
|
||||
virtual void DeleteContents();
|
||||
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CNsZipDoc();
|
||||
virtual void Serialize(CArchive& ar); // overridden for document i/o
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
HANDLE m_hUpdateFile;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CNsZipDoc)
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
117
mozilla/xpinstall/wizard/windows/nszip/nszipvw.cpp
Normal file
@@ -0,0 +1,117 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// nszipvw.cpp : implementation of the CNsZipView class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "nszip.h"
|
||||
|
||||
#include "nszipdoc.h"
|
||||
#include "nszipvw.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char BASED_CODE THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipView
|
||||
|
||||
IMPLEMENT_DYNCREATE(CNsZipView, CView)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CNsZipView, CView)
|
||||
//{{AFX_MSG_MAP(CNsZipView)
|
||||
ON_COMMAND(ID_ACTIONS_DELETE, OnActionsDelete)
|
||||
ON_UPDATE_COMMAND_UI(ID_ACTIONS_DELETE, OnUpdateActionsDelete)
|
||||
ON_COMMAND(ID_ACTIONS_ADD, OnActionsAdd)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipView construction/destruction
|
||||
|
||||
CNsZipView::CNsZipView()
|
||||
{
|
||||
// TODO: add construction code here
|
||||
|
||||
}
|
||||
|
||||
CNsZipView::~CNsZipView()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipView drawing
|
||||
|
||||
void CNsZipView::OnDraw(CDC* pDC)
|
||||
{
|
||||
CNsZipDoc* pDoc = GetDocument();
|
||||
ASSERT_VALID(pDoc);
|
||||
|
||||
// TODO: add draw code for native data here
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipView diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CNsZipView::AssertValid() const
|
||||
{
|
||||
CView::AssertValid();
|
||||
}
|
||||
|
||||
void CNsZipView::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CView::Dump(dc);
|
||||
}
|
||||
|
||||
CNsZipDoc* CNsZipView::GetDocument() // non-debug version is inline
|
||||
{
|
||||
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CNsZipDoc)));
|
||||
return (CNsZipDoc*)m_pDocument;
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CNsZipView message handlers
|
||||
|
||||
void CNsZipView::OnActionsDelete()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
|
||||
}
|
||||
|
||||
void CNsZipView::OnUpdateActionsDelete(CCmdUI* pCmdUI)
|
||||
{
|
||||
// TODO: Add your command update UI handler code here
|
||||
|
||||
}
|
||||
|
||||
void CNsZipView::OnActionsAdd()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
|
||||
}
|
||||
76
mozilla/xpinstall/wizard/windows/nszip/nszipvw.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// nszipvw.h : interface of the CNsZipView class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class CNsZipView : public CView
|
||||
{
|
||||
protected: // create from serialization only
|
||||
CNsZipView();
|
||||
DECLARE_DYNCREATE(CNsZipView)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
CNsZipDoc* GetDocument();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CNsZipView)
|
||||
public:
|
||||
virtual void OnDraw(CDC* pDC); // overridden to draw this view
|
||||
protected:
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CNsZipView();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CNsZipView)
|
||||
afx_msg void OnActionsDelete();
|
||||
afx_msg void OnUpdateActionsDelete(CCmdUI* pCmdUI);
|
||||
afx_msg void OnActionsAdd();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#ifndef _DEBUG // debug version in nszipvw.cpp
|
||||
inline CNsZipDoc* CNsZipView::GetDocument()
|
||||
{ return (CNsZipDoc*)m_pDocument; }
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
BIN
mozilla/xpinstall/wizard/windows/nszip/res/nszip.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
13
mozilla/xpinstall/wizard/windows/nszip/res/nszip.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// NSZIP.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
BIN
mozilla/xpinstall/wizard/windows/nszip/res/nszipdoc.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
46
mozilla/xpinstall/wizard/windows/nszip/resource.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by nszip.rc
|
||||
//
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDR_NSZIPTYPE 129
|
||||
#define ID_ACTIONS_ADD 32772
|
||||
#define ID_ACTIONS_DELETE 32773
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||
#define _APS_NEXT_COMMAND_VALUE 32774
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
31
mozilla/xpinstall/wizard/windows/nszip/stdafx.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// nszip.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
32
mozilla/xpinstall/wizard/windows/nszip/stdafx.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Troy Chevalier <troy@netscape.com>
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
52
mozilla/xpinstall/wizard/windows/nsztool/makefile.win
Normal file
@@ -0,0 +1,52 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = EXE
|
||||
USE_NON_MT_LIBS = 1
|
||||
|
||||
MODULE = nsztool
|
||||
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\nsztool.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\zlib_s.lib \
|
||||
$(NULL)
|
||||
|
||||
LLFLAGS= \
|
||||
/subsystem:windows \
|
||||
/machine:i386 \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\install
|
||||
$(DIST)\install\$(MODULE).exe -g $(DIST)\install\nszip.exe $(DIST)\install\nsinstall.exe
|
||||
|
||||
clobber_all::
|
||||
$(RM) $(DIST)\install\$(MODULE).exe
|
||||
$(RM) $(DIST)\install\nszip.exe
|
||||
|
||||
659
mozilla/xpinstall/wizard/windows/nsztool/nsztool.c
Normal file
@@ -0,0 +1,659 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include "nsztool.h"
|
||||
#include "zlib.h"
|
||||
|
||||
//#define SSU_DEBUG
|
||||
|
||||
/* Function to show the usage for this application */
|
||||
void ShowUsage(char *name)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
wsprintf(szBuf, "Usage: %s <output sea name> <files [file1] [file2]...>\n", name);
|
||||
lstrcat(szBuf, "\n");
|
||||
lstrcat(szBuf, " output sea name: name to use for the self-extracting executable\n");
|
||||
lstrcat(szBuf, " files: one or more files to add to the self-extracing executable\n");
|
||||
MessageBox(NULL, szBuf, "Usage", MB_OK);
|
||||
}
|
||||
|
||||
/* Function to print error message with/without error code */
|
||||
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH)
|
||||
{
|
||||
DWORD dwErr;
|
||||
char szErrorString[MAX_BUF];
|
||||
|
||||
if(dwErrorCodeSH == ERROR_CODE_SHOW)
|
||||
{
|
||||
dwErr = GetLastError();
|
||||
wsprintf(szErrorString, "%d : %s", dwErr, szMsg);
|
||||
}
|
||||
else
|
||||
wsprintf(szErrorString, "%s", szMsg);
|
||||
|
||||
MessageBox(NULL, szErrorString, NULL, MB_ICONEXCLAMATION);
|
||||
}
|
||||
|
||||
/* Function to remove quotes from a string */
|
||||
void RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize)
|
||||
{
|
||||
char *lpszBegin;
|
||||
|
||||
if(lstrlen(lpszSrc) > iDestSize)
|
||||
return;
|
||||
|
||||
if(*lpszSrc == '\"')
|
||||
lpszBegin = &lpszSrc[1];
|
||||
else
|
||||
lpszBegin = lpszSrc;
|
||||
|
||||
lstrcpy(lpszDest, lpszBegin);
|
||||
|
||||
if(lpszDest[lstrlen(lpszDest) - 1] == '\"')
|
||||
lpszDest[lstrlen(lpszDest) - 1] = '\0';
|
||||
}
|
||||
|
||||
/* Function to remove the last backslash from a path string */
|
||||
void RemoveBackSlash(LPSTR szInput)
|
||||
{
|
||||
int iCounter;
|
||||
DWORD dwInputLen;
|
||||
|
||||
if(szInput != NULL)
|
||||
{
|
||||
dwInputLen = lstrlen(szInput);
|
||||
|
||||
for(iCounter = dwInputLen -1; iCounter >= 0 ; iCounter--)
|
||||
{
|
||||
if(szInput[iCounter] == '\\')
|
||||
szInput[iCounter] = '\0';
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to append a backslash to a path string */
|
||||
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize)
|
||||
{
|
||||
if(szInput != NULL)
|
||||
{
|
||||
if(szInput[strlen(szInput) - 1] != '\\')
|
||||
{
|
||||
if(((DWORD)lstrlen(szInput) + 1) < dwInputSize)
|
||||
{
|
||||
lstrcat(szInput, "\\");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to parse a path string for one of three parts of a path:
|
||||
* Filename only
|
||||
* Path only
|
||||
* drive only */
|
||||
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, DWORD dwType)
|
||||
{
|
||||
int iCounter;
|
||||
DWORD dwCounter;
|
||||
DWORD dwInputLen;
|
||||
BOOL bFound;
|
||||
|
||||
if((szInput != NULL) && (szOutput != NULL))
|
||||
{
|
||||
bFound = FALSE;
|
||||
dwInputLen = lstrlen(szInput);
|
||||
ZeroMemory(szOutput, dwOutputSize);
|
||||
|
||||
if(dwInputLen < dwOutputSize)
|
||||
{
|
||||
switch(dwType)
|
||||
{
|
||||
case PP_FILENAME_ONLY:
|
||||
for(iCounter = dwInputLen - 1; iCounter >= 0; iCounter--)
|
||||
{
|
||||
if(szInput[iCounter] == '\\')
|
||||
{
|
||||
lstrcpy(szOutput, &szInput[iCounter + 1]);
|
||||
bFound = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(bFound == FALSE)
|
||||
lstrcpy(szOutput, szInput);
|
||||
|
||||
break;
|
||||
|
||||
case PP_PATH_ONLY:
|
||||
for(iCounter = dwInputLen - 1; iCounter >= 0; iCounter--)
|
||||
{
|
||||
if(szInput[iCounter] == '\\')
|
||||
{
|
||||
lstrcpy(szOutput, szInput);
|
||||
szOutput[iCounter + 1] = '\0';
|
||||
bFound = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(bFound == FALSE)
|
||||
lstrcpy(szOutput, szInput);
|
||||
|
||||
break;
|
||||
|
||||
case PP_ROOT_ONLY:
|
||||
if(szInput[1] == ':')
|
||||
{
|
||||
szOutput[0] = szInput[0];
|
||||
szOutput[1] = szInput[1];
|
||||
AppendBackSlash(szOutput, dwOutputSize);
|
||||
}
|
||||
else if(szInput[1] == '\\')
|
||||
{
|
||||
int iFoundBackSlash = 0;
|
||||
for(dwCounter = 0; dwCounter < dwInputLen; dwCounter++)
|
||||
{
|
||||
if(szInput[dwCounter] == '\\')
|
||||
{
|
||||
szOutput[dwCounter] = szInput[dwCounter];
|
||||
++iFoundBackSlash;
|
||||
}
|
||||
|
||||
if(iFoundBackSlash == 3)
|
||||
break;
|
||||
}
|
||||
|
||||
if(iFoundBackSlash != 0)
|
||||
AppendBackSlash(szOutput, dwOutputSize);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to check to see if a file exists.
|
||||
* If it does, return it's attributes */
|
||||
long FileExists(LPSTR szFile)
|
||||
{
|
||||
DWORD rv;
|
||||
|
||||
if((rv = GetFileAttributes(szFile)) == -1)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to locate the first non space character in a string,
|
||||
* and return a pointer to it. */
|
||||
LPSTR GetFirstNonSpace(LPSTR lpszString)
|
||||
{
|
||||
int i;
|
||||
int iStrLength;
|
||||
|
||||
iStrLength = lstrlen(lpszString);
|
||||
|
||||
for(i = 0; i < iStrLength; i++)
|
||||
{
|
||||
if(!isspace(lpszString[i]))
|
||||
return(&lpszString[i]);
|
||||
}
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Function to return the argument count given a command line input
|
||||
* format string */
|
||||
int GetArgC(LPSTR lpszCommandLine)
|
||||
{
|
||||
int i;
|
||||
int iArgCount;
|
||||
int iStrLength;
|
||||
LPSTR lpszBeginStr;
|
||||
BOOL bFoundQuote;
|
||||
BOOL bFoundSpace;
|
||||
|
||||
iArgCount = 0;
|
||||
lpszBeginStr = GetFirstNonSpace(lpszCommandLine);
|
||||
|
||||
if(lpszBeginStr == NULL)
|
||||
return(iArgCount);
|
||||
|
||||
iStrLength = lstrlen(lpszBeginStr);
|
||||
bFoundQuote = FALSE;
|
||||
bFoundSpace = TRUE;
|
||||
|
||||
for(i = 0; i < iStrLength; i++)
|
||||
{
|
||||
if(lpszCommandLine[i] == '\"')
|
||||
{
|
||||
if(bFoundQuote == FALSE)
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundQuote = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bFoundQuote = FALSE;
|
||||
}
|
||||
}
|
||||
else if(bFoundQuote == FALSE)
|
||||
{
|
||||
if(!isspace(lpszCommandLine[i]) && (bFoundSpace == TRUE))
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundSpace = FALSE;
|
||||
}
|
||||
else if(isspace(lpszCommandLine[i]))
|
||||
{
|
||||
bFoundSpace = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(iArgCount);
|
||||
}
|
||||
|
||||
/* Function to return a specific argument parameter from a given command line input
|
||||
* format string. */
|
||||
LPSTR GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int iArgCount;
|
||||
int iStrLength;
|
||||
LPSTR lpszBeginStr;
|
||||
LPSTR lpszDestTemp;
|
||||
BOOL bFoundQuote;
|
||||
BOOL bFoundSpace;
|
||||
|
||||
iArgCount = 0;
|
||||
lpszBeginStr = GetFirstNonSpace(lpszCommandLine);
|
||||
|
||||
if(lpszBeginStr == NULL)
|
||||
return(NULL);
|
||||
|
||||
lpszDestTemp = (char *)calloc(iDestSize, sizeof(char));
|
||||
if(lpszDestTemp == NULL)
|
||||
{
|
||||
PrintError("Out of memory", ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ZeroMemory(lpszDest, iDestSize);
|
||||
iStrLength = lstrlen(lpszBeginStr);
|
||||
bFoundQuote = FALSE;
|
||||
bFoundSpace = TRUE;
|
||||
j = 0;
|
||||
|
||||
for(i = 0; i < iStrLength; i++)
|
||||
{
|
||||
if(lpszCommandLine[i] == '\"')
|
||||
{
|
||||
if(bFoundQuote == FALSE)
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundQuote = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bFoundQuote = FALSE;
|
||||
}
|
||||
}
|
||||
else if(bFoundQuote == FALSE)
|
||||
{
|
||||
if(!isspace(lpszCommandLine[i]) && (bFoundSpace == TRUE))
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundSpace = FALSE;
|
||||
}
|
||||
else if(isspace(lpszCommandLine[i]))
|
||||
{
|
||||
bFoundSpace = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if((iIndex == (iArgCount - 1)) &&
|
||||
((bFoundQuote == TRUE) || (bFoundSpace == FALSE) ||
|
||||
((bFoundQuote == FALSE) && (lpszCommandLine[i] == '\"'))))
|
||||
{
|
||||
if(j < iDestSize)
|
||||
{
|
||||
lpszDestTemp[j] = lpszCommandLine[i];
|
||||
++j;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpszDestTemp[j] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RemoveQuotes(lpszDestTemp, lpszDest, iDestSize);
|
||||
free(lpszDestTemp);
|
||||
return(lpszDest);
|
||||
}
|
||||
|
||||
/* Function to add a file to a self-extracting .exe file.
|
||||
* It compresses the file, then adds it as a resource type "FILE". */
|
||||
void AddFile(LPSTR lpszSeaExe, LPSTR lpszFile)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szResourceName[MAX_BUF];
|
||||
HANDLE hSeaExe;
|
||||
HANDLE hInputFile;
|
||||
DWORD dwBytesRead;
|
||||
DWORD dwFileSize;
|
||||
DWORD dwFileSizeCmp;
|
||||
LPBYTE lpBuf;
|
||||
LPBYTE lpBufCmp;
|
||||
|
||||
ParsePath(lpszFile, szResourceName, sizeof(szResourceName), PP_FILENAME_ONLY);
|
||||
strupr(szResourceName);
|
||||
hInputFile = CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if(hInputFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
PrintError("CreateFile() failed", ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dwFileSize = GetFileSize(hInputFile, NULL);
|
||||
dwFileSizeCmp = dwFileSize;
|
||||
lpBuf = (LPBYTE)malloc(dwFileSize);
|
||||
lpBufCmp = (LPBYTE)malloc(dwFileSize + (sizeof(DWORD) * 2));
|
||||
if((lpBuf == NULL) || (lpBufCmp == NULL))
|
||||
{
|
||||
PrintError("Out of memory", ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ReadFile(hInputFile, lpBuf, dwFileSize, &dwBytesRead, NULL);
|
||||
if(dwBytesRead != dwFileSize)
|
||||
{
|
||||
wsprintf(szBuf, "Error reading file: %s", lpszFile);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(compress((lpBufCmp + (sizeof(DWORD) * 2)), &dwFileSizeCmp, (const Bytef*)lpBuf, dwFileSize) != Z_OK)
|
||||
{
|
||||
PrintError("Error occurred during compression of archives!", ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
*(LPDWORD)lpBufCmp = dwFileSizeCmp;
|
||||
*(LPDWORD)(lpBufCmp + sizeof(DWORD)) = dwFileSize;
|
||||
|
||||
if((hSeaExe = BeginUpdateResource(lpszSeaExe, FALSE)) == NULL)
|
||||
{
|
||||
DWORD dwErr;
|
||||
|
||||
dwErr = GetLastError();
|
||||
if(dwErr == ERROR_CALL_NOT_IMPLEMENTED)
|
||||
{
|
||||
MessageBox(NULL, "This application does not run under this OS", NULL, MB_ICONEXCLAMATION);
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintError("BeginUpdateResource() error", ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if(!UpdateResource(hSeaExe, "FILE", szResourceName, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
|
||||
lpBufCmp, dwFileSizeCmp + (sizeof(DWORD) * 2)))
|
||||
{
|
||||
PrintError("UpdateResource() failed", ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
if(!EndUpdateResource(hSeaExe, FALSE))
|
||||
{
|
||||
PrintError("EndUpdateResource() failed", ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
free(lpBuf);
|
||||
if(!CloseHandle(hInputFile))
|
||||
{
|
||||
PrintError("CloseHandle() failed", ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to extract a resourced file from a .exe file.
|
||||
* It also uncompresss the file after extracting it. */
|
||||
BOOL APIENTRY ExtractFilesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
HRSRC hResInfo;
|
||||
LPSTR lpszSeaExe = (LPSTR)lParam;
|
||||
HANDLE hFile;
|
||||
LPBYTE lpBytes;
|
||||
LPBYTE lpBytesUnCmp;
|
||||
HGLOBAL hGlobal;
|
||||
|
||||
// Extract the file
|
||||
hResInfo = FindResource((HINSTANCE)hModule, lpszName, lpszType);
|
||||
hGlobal = LoadResource((HINSTANCE)hModule, hResInfo);
|
||||
lpBytes = (LPBYTE)LockResource(hGlobal);
|
||||
|
||||
// Create the file
|
||||
hFile = CreateFile(lpszSeaExe, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_TEMPORARY, NULL);
|
||||
|
||||
if(hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwSizeUnCmp;
|
||||
|
||||
lpBytesUnCmp = (LPBYTE)malloc((*(LPDWORD)(lpBytes + sizeof(DWORD))) + 1);
|
||||
dwSizeUnCmp = *(LPDWORD)(lpBytes + sizeof(DWORD));
|
||||
|
||||
// Copy the file. The first DWORD specifies the size of the file
|
||||
dwSize = *(LPDWORD)lpBytes;
|
||||
lpBytes += (sizeof(DWORD) * 2);
|
||||
|
||||
if(uncompress(lpBytesUnCmp, &dwSizeUnCmp, lpBytes, dwSize) != Z_OK)
|
||||
{
|
||||
wsprintf(szBuf, "Error occurred during uncompression of %s: ", lpszSeaExe);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
CloseHandle(hFile);
|
||||
FreeResource(hResInfo);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
while(dwSizeUnCmp > 0)
|
||||
{
|
||||
DWORD dwBytesToWrite;
|
||||
DWORD dwBytesWritten;
|
||||
|
||||
dwBytesToWrite = dwSizeUnCmp > 4096 ? 4096 : dwSizeUnCmp;
|
||||
if(!WriteFile(hFile, lpBytesUnCmp, dwBytesToWrite, &dwBytesWritten, NULL))
|
||||
{
|
||||
wsprintf(szBuf, "%s: write error", lpszSeaExe);
|
||||
MessageBox(NULL, szBuf, "Error", MB_OK | MB_ICONEXCLAMATION);
|
||||
CloseHandle(hFile);
|
||||
FreeResource(hResInfo);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dwSizeUnCmp -= dwBytesWritten;
|
||||
lpBytesUnCmp += dwBytesWritten;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
|
||||
// Release the resource
|
||||
FreeResource(hResInfo);
|
||||
|
||||
return TRUE; // keep enumerating
|
||||
}
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
|
||||
{
|
||||
int i;
|
||||
int iArgC;
|
||||
char szBuf[MAX_BUF];
|
||||
char szArgVBuf[MAX_BUF];
|
||||
char szFileFullPath[MAX_BUF];
|
||||
char szSeaExe[MAX_BUF];
|
||||
char szNsZipName[MAX_BUF];
|
||||
char szAppName[MAX_BUF];
|
||||
|
||||
#ifdef SSU_DEBUG
|
||||
char szOutputStr[MAX_BUF];
|
||||
#endif
|
||||
|
||||
WIN32_FIND_DATA findFileData;
|
||||
HANDLE hFindFile;
|
||||
BOOL bSelfUpdate;
|
||||
|
||||
if(*lpszCmdLine == '\0')
|
||||
{
|
||||
if(GetModuleFileName(NULL, szAppName, sizeof(szAppName)) == 0L)
|
||||
{
|
||||
PrintError("GetModuleFileName() failed", ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
ParsePath(szAppName, szBuf, sizeof(szBuf), PP_FILENAME_ONLY);
|
||||
ShowUsage(szBuf);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
iArgC = GetArgC(lpszCmdLine);
|
||||
bSelfUpdate = FALSE;
|
||||
|
||||
#ifdef SSU_DEBUG
|
||||
wsprintf(szOutputStr, "ArgC: %d\n", iArgC);
|
||||
for(i = 0; i < iArgC; i++)
|
||||
{
|
||||
GetArgV(lpszCmdLine, i, szArgVBuf, sizeof(szArgVBuf));
|
||||
itoa(i, szBuf, 10);
|
||||
lstrcat(szOutputStr, " ");
|
||||
lstrcat(szOutputStr, szBuf);
|
||||
lstrcat(szOutputStr, ": ");
|
||||
lstrcat(szOutputStr, szArgVBuf);
|
||||
lstrcat(szOutputStr, "\n");
|
||||
}
|
||||
MessageBox(NULL, szOutputStr, "Output", MB_OK);
|
||||
#endif
|
||||
|
||||
/* Get the first parameter */
|
||||
GetArgV(lpszCmdLine, 0, szSeaExe, sizeof(szSeaExe));
|
||||
if(lstrcmpi(szSeaExe, "-g") == 0)
|
||||
{
|
||||
/* The first parameter is "-g".
|
||||
* Create a new nszip that contains nsinstall.exe in itself */
|
||||
|
||||
GetArgV(lpszCmdLine, 1, szNsZipName, sizeof(szNsZipName));
|
||||
GetArgV(lpszCmdLine, 2, szSeaExe, sizeof(szSeaExe));
|
||||
if(!FileExists(szSeaExe))
|
||||
{
|
||||
wsprintf(szBuf, "file not found: %s", szSeaExe);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(GetModuleFileName(NULL, szAppName, sizeof(szAppName)) == 0L)
|
||||
{
|
||||
PrintError("GetModuleFileName() failed", ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
if(!FileExists(szAppName))
|
||||
{
|
||||
wsprintf(szBuf, "File not found: %s", szAppName);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(CopyFile(szAppName, szNsZipName, FALSE) == FALSE)
|
||||
{
|
||||
wsprintf(szBuf, "Error creating %s", szNsZipName);
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
AddFile(szNsZipName, szSeaExe);
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The first parameter is not "-g". Assume that it's the name of the
|
||||
* self-extracting .exe to be saved as. So lets create it only if it does not exist. */
|
||||
|
||||
if(!FileExists(szSeaExe))
|
||||
EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)ExtractFilesProc, (LONG)szSeaExe);
|
||||
|
||||
if(!FileExists(szSeaExe))
|
||||
{
|
||||
wsprintf(szBuf, "file not found: %s", szSeaExe);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 1; i < iArgC; i++)
|
||||
{
|
||||
GetArgV(lpszCmdLine, i, szArgVBuf, sizeof(szArgVBuf));
|
||||
GetFullPathName(szArgVBuf, sizeof(szFileFullPath), szFileFullPath, NULL);
|
||||
hFindFile = FindFirstFile(szFileFullPath, &findFileData);
|
||||
|
||||
if(hFindFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
wsprintf(szBuf, "file not found: %s", szArgVBuf);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
char szFile[MAX_BUF];
|
||||
|
||||
if(!(findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
// We need to pass to AddFile() whatever kind of path we were passed,
|
||||
// e.g. simple, relative, full
|
||||
strcpy(szFile, szFileFullPath);
|
||||
strcpy(strrchr(szFile, '\\') + 1, findFileData.cFileName);
|
||||
AddFile(szSeaExe, szFile);
|
||||
}
|
||||
} while(FindNextFile(hFindFile, &findFileData));
|
||||
|
||||
FindClose(hFindFile);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
50
mozilla/xpinstall/wizard/windows/nsztool/nsztool.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _TESTXPI_H_
|
||||
#define _TESTXPI_H_
|
||||
|
||||
#define MAX_BUF 4096
|
||||
|
||||
#define ERROR_CODE_HIDE 0
|
||||
#define ERROR_CODE_SHOW 1
|
||||
|
||||
/* PP: Parse Path */
|
||||
#define PP_FILENAME_ONLY 1
|
||||
#define PP_PATH_ONLY 2
|
||||
#define PP_ROOT_ONLY 3
|
||||
|
||||
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH);
|
||||
void RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int dwDestSize);
|
||||
void RemoveBackSlash(LPSTR szInput);
|
||||
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
|
||||
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, DWORD dwType);
|
||||
long FileExists(LPSTR szFile);
|
||||
int GetArgC(LPSTR lpszCommandLine);
|
||||
LPSTR GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize);
|
||||
void AddFile(LPSTR lpszSeaExe, LPSTR lpszFile);
|
||||
BOOL APIENTRY ExtractFilesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam);
|
||||
|
||||
#endif
|
||||
|
||||
3
mozilla/xpinstall/wizard/windows/ren8dot3/example.ini
Normal file
@@ -0,0 +1,3 @@
|
||||
[rename]
|
||||
d:\work\1 2\longfi~1.txt=d:\work\1 2\longfilename.txt
|
||||
|
||||
42
mozilla/xpinstall/wizard/windows/ren8dot3/makefile.win
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = EXE
|
||||
USE_NON_MT_LIBS = 1
|
||||
|
||||
MODULE = ren8dot3
|
||||
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\ren8dot3.obj \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\install
|
||||
|
||||
clobber_all::
|
||||
$(RM) $(DIST)\install\$(MODULE).exe
|
||||
|
||||
117
mozilla/xpinstall/wizard/windows/ren8dot3/ren8dot3.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define _MAX_SIZE_ 64000
|
||||
|
||||
char *GetSubString(char *Strings)
|
||||
{
|
||||
return(strchr(Strings,0)+1);
|
||||
}
|
||||
|
||||
void ShowUsage(char *name)
|
||||
{
|
||||
char szBuf[_MAX_SIZE_];
|
||||
|
||||
sprintf(szBuf, "usage: %s <source .ini file>\n", name);
|
||||
MessageBox(NULL, szBuf, "Usage", MB_OK);
|
||||
}
|
||||
|
||||
void RemoveQuotes(LPSTR lpszCmdLine, LPSTR szBuf)
|
||||
{
|
||||
char *lpszBegin;
|
||||
|
||||
if(*lpszCmdLine == '\"')
|
||||
lpszBegin = &lpszCmdLine[1];
|
||||
else
|
||||
lpszBegin = lpszCmdLine;
|
||||
|
||||
lstrcpy(szBuf, lpszBegin);
|
||||
|
||||
if(szBuf[lstrlen(szBuf) - 1] == '\"')
|
||||
szBuf[lstrlen(szBuf) - 1] = '\0';
|
||||
}
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
|
||||
{
|
||||
char *temp;
|
||||
char *SubKey;
|
||||
char *SubKeyPtr;
|
||||
char *SubString;
|
||||
char *SubStringPtr;
|
||||
char *ReturnedKeys;
|
||||
char *ReturnedStrings;
|
||||
char *KeyValue;
|
||||
char *SrcIni;
|
||||
char *DestIni;
|
||||
char szBuf[_MAX_SIZE_];
|
||||
|
||||
if(*lpszCmdLine == '\0')
|
||||
{
|
||||
ShowUsage("Ren8dot3.exe");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
SrcIni = (char *)calloc(_MAX_DIR, sizeof(char));
|
||||
|
||||
RemoveQuotes(lpszCmdLine, szBuf);
|
||||
GetShortPathName(szBuf, SrcIni, _MAX_DIR);
|
||||
|
||||
temp = (char *)calloc(_MAX_SIZE_, sizeof(char));
|
||||
KeyValue = (char *)calloc(_MAX_SIZE_, sizeof(char));
|
||||
ReturnedKeys = (char *)calloc(_MAX_SIZE_, sizeof(char));
|
||||
ReturnedStrings = (char *)calloc(_MAX_SIZE_, sizeof(char));
|
||||
SubString = (char *)calloc(_MAX_SIZE_, sizeof(char));
|
||||
DestIni = (char *)calloc(_MAX_DIR, sizeof(char));
|
||||
SubStringPtr = SubString;
|
||||
|
||||
GetPrivateProfileString("rename", NULL, "_error_", &ReturnedKeys[1], _MAX_SIZE_, SrcIni);
|
||||
SubKey = (char *)calloc(_MAX_SIZE_, sizeof(char));
|
||||
SubKeyPtr = SubKey;
|
||||
memcpy(SubKey, ReturnedKeys, _MAX_SIZE_);
|
||||
SubKey = GetSubString(SubKey);
|
||||
while((SubKey[0]) != 0)
|
||||
{
|
||||
GetPrivateProfileString("rename", SubKey, "_error_", KeyValue, _MAX_SIZE_, SrcIni);
|
||||
rename(SubKey, KeyValue);
|
||||
SubKey = GetSubString(SubKey);
|
||||
}
|
||||
|
||||
unlink(SrcIni);
|
||||
|
||||
free(SubKeyPtr);
|
||||
free(temp);
|
||||
free(ReturnedKeys);
|
||||
free(ReturnedStrings);
|
||||
free(KeyValue);
|
||||
free(SubStringPtr);
|
||||
free(SrcIni);
|
||||
free(DestIni);
|
||||
|
||||
return(0);
|
||||
}
|
||||
1867
mozilla/xpinstall/wizard/windows/setup/dialogs.c
Normal file
56
mozilla/xpinstall/wizard/windows/setup/dialogs.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _DIALOGS_H_
|
||||
#define _DIALOGS_H_
|
||||
|
||||
LRESULT CALLBACK DlgProcMain(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK DlgProcWelcome(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcLicense(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcSetupType(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcSelectComponents(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcWindowsIntegration(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcProgramFolder(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcStartInstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcReboot(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK DlgProcMessage(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam);
|
||||
LRESULT CALLBACK NewListBoxWndProc( HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
void AskCancelDlg(HWND hDlg);
|
||||
void lbAddItem(HWND hList, siC *siCComponent);
|
||||
void InstantiateDialog(DWORD dwDlgID, LPSTR szTitle, WNDPROC wpDlgProc);
|
||||
void DlgSequenceNext(void);
|
||||
void DlgSequencePrev(void);
|
||||
void PaintGradientShade(HWND hWnd, HDC hdc);
|
||||
BOOL BrowseForDirectory(HWND hDlg, char *szCurrDir);
|
||||
LRESULT CALLBACK BrowseHookProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
void ShowMessage(LPSTR szMessage, BOOL bShow);
|
||||
void DrawCheck(LPDRAWITEMSTRUCT lpdis);
|
||||
void InvalidateLBCheckbox(HWND hwndListBox);
|
||||
void ProcessWindowsMessages(void);
|
||||
void CheckWizardStateCustom(DWORD dwDefault);
|
||||
void SunJavaDependencyHack(DWORD dwIndex, BOOL bSelected);
|
||||
|
||||
|
||||
#endif
|
||||
85
mozilla/xpinstall/wizard/windows/setup/extern.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _EXTERN_H_
|
||||
#define _EXTERN_H_
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
/* external global variables */
|
||||
extern HINSTANCE hInst;
|
||||
extern HINSTANCE hSetupRscInst;
|
||||
extern HINSTANCE hSDInst;
|
||||
extern HINSTANCE hXPIStubInst;
|
||||
|
||||
extern HBITMAP hbmpBoxChecked;
|
||||
extern HBITMAP hbmpBoxUnChecked;
|
||||
|
||||
extern HANDLE hAccelTable;
|
||||
|
||||
extern HWND hDlg;
|
||||
extern HWND hDlgMessage;
|
||||
extern HWND hWndMain;
|
||||
|
||||
extern SDI_NETINSTALL pfnNetInstall;
|
||||
|
||||
extern LPSTR szEGlobalAlloc;
|
||||
extern LPSTR szEStringLoad;
|
||||
extern LPSTR szEDllLoad;
|
||||
extern LPSTR szEStringNull;
|
||||
extern LPSTR szTempSetupPath;
|
||||
|
||||
extern LPSTR szClassName;
|
||||
extern LPSTR szSetupDir;
|
||||
extern LPSTR szTempDir;
|
||||
extern LPSTR szFileIniConfig;
|
||||
|
||||
extern DWORD dwWizardState;
|
||||
extern DWORD dwSetupType;
|
||||
extern DWORD dwOSType;
|
||||
extern DWORD dwScreenX;
|
||||
extern DWORD dwScreenY;
|
||||
|
||||
extern DWORD dwTempSetupType;
|
||||
|
||||
extern BOOL bSDUserCanceled;
|
||||
extern BOOL bIdiArchivesExists;
|
||||
extern BOOL bCreateDestinationDir;
|
||||
extern BOOL bReboot;
|
||||
|
||||
extern setupGen sgProduct;
|
||||
extern diS diSetup;
|
||||
extern diW diWelcome;
|
||||
extern diL diLicense;
|
||||
extern diST diSetupType;
|
||||
extern diSC diSelectComponents;
|
||||
extern diWI diWindowsIntegration;
|
||||
extern diPF diProgramFolder;
|
||||
extern diSI diStartInstall;
|
||||
extern diR diReboot;
|
||||
extern siSD siSDObject;
|
||||
extern siCF siCFCoreFile;
|
||||
extern siC *siComponents;
|
||||
|
||||
#endif
|
||||
4557
mozilla/xpinstall/wizard/windows/setup/extra.c
Normal file
155
mozilla/xpinstall/wizard/windows/setup/extra.h
Normal file
@@ -0,0 +1,155 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _EXTRA_H_
|
||||
#define _EXTRA_H_
|
||||
|
||||
typedef struct diskSpaceNode dsN;
|
||||
struct diskSpaceNode
|
||||
{
|
||||
ULONGLONG ullSpaceRequired;
|
||||
LPSTR szPath;
|
||||
dsN *Next;
|
||||
dsN *Prev;
|
||||
};
|
||||
|
||||
typedef struct structVer
|
||||
{
|
||||
ULONGLONG ullMajor;
|
||||
ULONGLONG ullMinor;
|
||||
ULONGLONG ullRelease;
|
||||
ULONGLONG ullBuild;
|
||||
} verBlock;
|
||||
|
||||
BOOL InitApplication(HINSTANCE hInstance, HINSTANCE hSetupRscInst);
|
||||
BOOL InitInstance(HINSTANCE hInstance, DWORD dwCmdShow);
|
||||
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH);
|
||||
void FreeMemory(void **vPointer);
|
||||
void *NS_GlobalAlloc(DWORD dwMaxBuf);
|
||||
HRESULT Initialize(HINSTANCE hInstance);
|
||||
HRESULT NS_LoadStringAlloc(HANDLE hInstance, DWORD dwID, LPSTR *szStringBuf, DWORD dwStringBuf);
|
||||
HRESULT NS_LoadString(HANDLE hInstance, DWORD dwID, LPSTR szStringBuf, DWORD dwStringBuf);
|
||||
HRESULT WinSpawn(LPSTR szClientName, LPSTR szParameters, LPSTR szCurrentDir, int iShowCmd, BOOL bWait);
|
||||
HRESULT ParseConfigIni(LPSTR lpszCmdLine);
|
||||
HRESULT DecryptString(LPSTR szOutputStr, LPSTR szInputStr);
|
||||
HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize);
|
||||
void GetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, LPSTR szReturnValue, DWORD dwSize);
|
||||
void SetWinReg(HKEY hkRootKey, LPSTR szKey, LPSTR szName, DWORD dwType, LPSTR szData, DWORD dwSize);
|
||||
HRESULT InitSetupGeneral(void);
|
||||
HRESULT InitDlgWelcome(diW *diDialog);
|
||||
HRESULT InitDlgLicense(diL *diDialog);
|
||||
HRESULT InitDlgSetupType(diST *diDialog);
|
||||
HRESULT InitDlgSelectComponents(diSC *diDialog, DWORD dwSM);
|
||||
HRESULT InitDlgWindowsIntegration(diWI *diDialog);
|
||||
HRESULT InitDlgProgramFolder(diPF *diDialog);
|
||||
HRESULT InitDlgStartInstall(diSI *diDialog);
|
||||
HRESULT InitSDObject(void);
|
||||
void DeInitSDObject(void);
|
||||
siC *CreateSiCNode(void);
|
||||
void SiCNodeInsert(siC **siCHead, siC *siCTemp);
|
||||
void SiCNodeDelete(siC *siCTemp);
|
||||
siCD *CreateSiCDepNode(void);
|
||||
void SiCDepNodeDelete(siCD *siCDepTemp);
|
||||
void SiCDepNodeInsert(siCD **siCDepHead, siCD *siCDepTemp);
|
||||
HRESULT SiCNodeGetAttributes(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
void SiCNodeSetAttributes(DWORD dwIndex, DWORD dwAttributes, BOOL bSet, BOOL bIncludeInvisible);
|
||||
void SiCNodeSetItemsSelected(DWORD dwItems, DWORD *dwItemsSelected);
|
||||
char *SiCNodeGetDescriptionLong(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
siC *SiCNodeGetObject(DWORD dwIndex, BOOL bIncludeInvisibleObjs);
|
||||
ULONGLONG SiCNodeGetInstallSize(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
ULONGLONG SiCNodeGetInstallSizeSystem(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
ULONGLONG SiCNodeGetInstallSizeArchive(DWORD dwIndex, BOOL bIncludeInvisible);
|
||||
void InitSiComponents(char *szFileIni);
|
||||
HRESULT ParseComponentAttributes(char *szBuf);
|
||||
void InitSiComponents(char *szFileIni);
|
||||
void DeInitSiCDependencies(siCD *siCDDependencies);
|
||||
BOOL ResolveDependencies(DWORD dwIndex);
|
||||
BOOL ResolveComponentDependency(siCD *siCDInDependency);
|
||||
void STGetComponents(LPSTR szSection, st *stSetupType, LPSTR szFileIni);
|
||||
HRESULT InitSCoreFile(void);
|
||||
void DeInitSCoreFile(void);
|
||||
void DeInitialize(void);
|
||||
void DeInitDlgWelcome(diW *diDialog);
|
||||
void DeInitDlgLicense(diL *diDialog);
|
||||
void DeInitDlgSetupType(diST *diDialog);
|
||||
void DeInitDlgSelectComponents(diSC *diDialog);
|
||||
void DeInitDlgWindowsIntegration(diWI *diDialog);
|
||||
void DeInitDlgProgramFolder(diPF *diDialog);
|
||||
void DeInitDlgStartInstall(diSI *diDialog);
|
||||
void DetermineOSVersion(void);
|
||||
void DeInitSiComponents(void);
|
||||
void DeInitSetupGeneral(void);
|
||||
HRESULT InitializeSmartDownload(void);
|
||||
HRESULT DeInitializeSmartDownload(void);
|
||||
HRESULT ParseSetupIni(void);
|
||||
HRESULT GetConfigIni(void);
|
||||
void CleanTempFiles(void);
|
||||
void OutputSetupTitle(HDC hDC);
|
||||
HRESULT SdArchives(LPSTR szFileIdi, LPSTR szDownloadDir);
|
||||
HRESULT RetrieveArchives(void);
|
||||
/* HRESULT SmartUpdateJars(void); */
|
||||
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwLength, DWORD dwType);
|
||||
void RemoveBackSlash(LPSTR szInput);
|
||||
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
|
||||
BOOL DeleteIdiGetConfigIni(void);
|
||||
BOOL DeleteIdiGetArchives(void);
|
||||
BOOL DeleteIdiFileIniConfig(void);
|
||||
void DeleteArchives(void);
|
||||
HRESULT LaunchApps(void);
|
||||
HRESULT FileExists(LPSTR szFile);
|
||||
int ExtractDirEntries(char* directory,void* vZip);
|
||||
BOOL LocateJar(siC *siCObject);
|
||||
HRESULT AddArchiveToIdiFile(siC *siCObject, char *szSComponent, char *szSFile, char *szFileIdiGetArchives);
|
||||
int SiCNodeGetIndexDS(char *szInDescriptionShort);
|
||||
void ViewSiComponents(void);
|
||||
BOOL IsWin95Debute(void);
|
||||
ULONGLONG GetDiskSpaceRequired(DWORD dwType);
|
||||
ULONGLONG GetDiskSpaceAvailable(LPSTR szPath);
|
||||
HRESULT VerifyDiskSpace(void);
|
||||
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);
|
||||
void TranslateVersionStr(LPSTR szVersion, verBlock *vbVersion);
|
||||
BOOL GetFileVersion(LPSTR szFile, verBlock *vbVersion);
|
||||
BOOL CheckLegacy(void);
|
||||
int CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew);
|
||||
|
||||
BOOL bSDInit;
|
||||
|
||||
#endif
|
||||
|
||||
779
mozilla/xpinstall/wizard/windows/setup/ifuncns.c
Normal file
@@ -0,0 +1,779 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include "extern.h"
|
||||
#include "extra.h"
|
||||
#include "dialogs.h"
|
||||
#include "shortcut.h"
|
||||
#include "ifuncns.h"
|
||||
|
||||
HRESULT TimingCheck(DWORD dwTiming, LPSTR szSection, LPSTR szFile)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
GetPrivateProfileString(szSection, "Timing", "", szBuf, MAX_BUF, szFile);
|
||||
if(*szBuf != '\0')
|
||||
{
|
||||
switch(dwTiming)
|
||||
{
|
||||
case T_PRE_DOWNLOAD:
|
||||
if(lstrcmpi(szBuf, "pre download") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_POST_DOWNLOAD:
|
||||
if(lstrcmpi(szBuf, "post download") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_PRE_CORE:
|
||||
if(lstrcmpi(szBuf, "pre core") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_POST_CORE:
|
||||
if(lstrcmpi(szBuf, "post core") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_PRE_SMARTUPDATE:
|
||||
if(lstrcmpi(szBuf, "pre smartupdate") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_POST_SMARTUPDATE:
|
||||
if(lstrcmpi(szBuf, "post smartupdate") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_PRE_LAUNCHAPP:
|
||||
if(lstrcmpi(szBuf, "pre launchapp") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_POST_LAUNCHAPP:
|
||||
if(lstrcmpi(szBuf, "post launchapp") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
|
||||
case T_DEPEND_REBOOT:
|
||||
if(lstrcmpi(szBuf, "depend reboot") == 0)
|
||||
return(TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
void ProcessFileOps(DWORD dwTiming)
|
||||
{
|
||||
ProcessUncompressFile(dwTiming);
|
||||
ProcessCreateDirectory(dwTiming);
|
||||
ProcessMoveFile(dwTiming);
|
||||
ProcessCopyFile(dwTiming);
|
||||
ProcessDeleteFile(dwTiming);
|
||||
ProcessRemoveDirectory(dwTiming);
|
||||
ProcessRunApp(dwTiming);
|
||||
ProcessProgramFolder(dwTiming);
|
||||
}
|
||||
|
||||
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
DWORD dwReturn;
|
||||
void *vZip;
|
||||
|
||||
/* Check for the existance of the from (source) file */
|
||||
if(!FileExists(szFrom))
|
||||
return(FO_ERROR_FILE_NOT_FOUND);
|
||||
|
||||
/* Check for the existance of the to (destination) path */
|
||||
dwReturn = FileExists(szTo);
|
||||
if(dwReturn && !(dwReturn & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
/* found a file with the same name as the destination path */
|
||||
return(FO_ERROR_DESTINATION_CONFLICT);
|
||||
}
|
||||
else if(!dwReturn)
|
||||
{
|
||||
lstrcpy(szBuf, szTo);
|
||||
AppendBackSlash(szBuf, sizeof(szBuf));
|
||||
CreateDirectoriesAll(szBuf);
|
||||
}
|
||||
|
||||
GetCurrentDirectory(MAX_BUF, szBuf);
|
||||
if(SetCurrentDirectory(szTo) == FALSE)
|
||||
return(FO_ERROR_CHANGE_DIR);
|
||||
|
||||
ZIP_OpenArchive(szFrom, &vZip);
|
||||
/* 1st parameter should be NULL or it will fail */
|
||||
/* It indicates extract the entire archive */
|
||||
ExtractDirEntries(NULL, vZip);
|
||||
ZIP_CloseArchive(&vZip);
|
||||
|
||||
if(SetCurrentDirectory(szBuf) == FALSE)
|
||||
return(FO_ERROR_CHANGE_DIR);
|
||||
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessCoreFile()
|
||||
{
|
||||
if(*siCFCoreFile.szMessage != '\0')
|
||||
ShowMessage(siCFCoreFile.szMessage, TRUE);
|
||||
|
||||
FileUncompress(siCFCoreFile.szSource, siCFCoreFile.szDestination);
|
||||
|
||||
if(*siCFCoreFile.szMessage != '\0')
|
||||
ShowMessage(siCFCoreFile.szMessage, FALSE);
|
||||
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT CleanupCoreFile()
|
||||
{
|
||||
if(siCFCoreFile.bCleanup == TRUE)
|
||||
DirectoryRemove(siCFCoreFile.szDestination, TRUE);
|
||||
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessUncompressFile(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
BOOL bOnlyIfExists;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szSource[MAX_BUF];
|
||||
char szDestination[MAX_BUF];
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Uncompress File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szSource, szBuf);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szDestination, szBuf);
|
||||
GetPrivateProfileString(szSection, "Only If Exists", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
if(lstrcmpi(szBuf, "TRUE") == 0)
|
||||
bOnlyIfExists = TRUE;
|
||||
else
|
||||
bOnlyIfExists = FALSE;
|
||||
|
||||
if((!bOnlyIfExists) || (bOnlyIfExists && FileExists(szDestination)))
|
||||
{
|
||||
GetPrivateProfileString(szSection, "Message", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
ShowMessage(szBuf, TRUE);
|
||||
FileUncompress(szSource, szDestination);
|
||||
ShowMessage(szBuf, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Uncompress File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT FileMove(LPSTR szFrom, LPSTR szTo)
|
||||
{
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fdFile;
|
||||
char szFromDir[MAX_BUF];
|
||||
char szFromTemp[MAX_BUF];
|
||||
char szToTemp[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
BOOL bFound;
|
||||
|
||||
/* From file path exists and To file path does not exist */
|
||||
if((FileExists(szFrom)) && (!FileExists(szTo)))
|
||||
{
|
||||
MoveFile(szFrom, szTo);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
/* From file path exists and To file path exists */
|
||||
if(FileExists(szFrom) && FileExists(szTo))
|
||||
{
|
||||
/* Since the To file path exists, assume it to be a directory and proceed. */
|
||||
/* We don't care if it's a file. If it is a file, then config.ini needs to be */
|
||||
/* corrected to remove the file before attempting a MoveFile(). */
|
||||
lstrcpy(szToTemp, szTo);
|
||||
AppendBackSlash(szToTemp, sizeof(szToTemp));
|
||||
ParsePath(szFrom, szBuf, MAX_BUF, PP_FILENAME_ONLY);
|
||||
lstrcat(szToTemp, szBuf);
|
||||
MoveFile(szFrom, szToTemp);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
ParsePath(szFrom, szFromDir, MAX_BUF, PP_PATH_ONLY);
|
||||
|
||||
if((hFile = FindFirstFile(szFrom, &fdFile)) == INVALID_HANDLE_VALUE)
|
||||
bFound = FALSE;
|
||||
else
|
||||
bFound = TRUE;
|
||||
|
||||
while(bFound)
|
||||
{
|
||||
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
|
||||
{
|
||||
/* create full path string including filename for source */
|
||||
lstrcpy(szFromTemp, szFromDir);
|
||||
AppendBackSlash(szFromTemp, sizeof(szFromTemp));
|
||||
lstrcat(szFromTemp, fdFile.cFileName);
|
||||
|
||||
/* create full path string including filename for destination */
|
||||
lstrcpy(szToTemp, szTo);
|
||||
AppendBackSlash(szToTemp, sizeof(szToTemp));
|
||||
lstrcat(szToTemp, fdFile.cFileName);
|
||||
|
||||
MoveFile(szFromTemp, szToTemp);
|
||||
}
|
||||
|
||||
bFound = FindNextFile(hFile, &fdFile);
|
||||
}
|
||||
|
||||
FindClose(hFile);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessMoveFile(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szSource[MAX_BUF];
|
||||
char szDestination[MAX_BUF];
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Move File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szSource, szBuf);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szDestination, szBuf);
|
||||
FileMove(szSource, szDestination);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Move File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists)
|
||||
{
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fdFile;
|
||||
char szFromDir[MAX_BUF];
|
||||
char szFromTemp[MAX_BUF];
|
||||
char szToTemp[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
BOOL bFound;
|
||||
|
||||
if(FileExists(szFrom))
|
||||
{
|
||||
/* The file in the From file path exists */
|
||||
ParsePath(szFrom, szBuf, MAX_BUF, PP_FILENAME_ONLY);
|
||||
lstrcpy(szToTemp, szTo);
|
||||
AppendBackSlash(szToTemp, sizeof(szToTemp));
|
||||
lstrcat(szToTemp, szBuf);
|
||||
CopyFile(szFrom, szToTemp, bFailIfExists);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
/* The file in the From file path does not exist. Assume to contain wild args and */
|
||||
/* proceed acordingly. */
|
||||
ParsePath(szFrom, szFromDir, MAX_BUF, PP_PATH_ONLY);
|
||||
|
||||
if((hFile = FindFirstFile(szFrom, &fdFile)) == INVALID_HANDLE_VALUE)
|
||||
bFound = FALSE;
|
||||
else
|
||||
bFound = TRUE;
|
||||
|
||||
while(bFound)
|
||||
{
|
||||
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
|
||||
{
|
||||
/* create full path string including filename for source */
|
||||
lstrcpy(szFromTemp, szFromDir);
|
||||
AppendBackSlash(szFromTemp, sizeof(szFromTemp));
|
||||
lstrcat(szFromTemp, fdFile.cFileName);
|
||||
|
||||
/* create full path string including filename for destination */
|
||||
lstrcpy(szToTemp, szTo);
|
||||
AppendBackSlash(szToTemp, sizeof(szToTemp));
|
||||
lstrcat(szToTemp, fdFile.cFileName);
|
||||
|
||||
CopyFile(szFromTemp, szToTemp, bFailIfExists);
|
||||
}
|
||||
|
||||
bFound = FindNextFile(hFile, &fdFile);
|
||||
}
|
||||
|
||||
FindClose(hFile);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessCopyFile(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szSource[MAX_BUF];
|
||||
char szDestination[MAX_BUF];
|
||||
BOOL bFailIfExists;
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Copy File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szSource, szBuf);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szDestination, szBuf);
|
||||
|
||||
GetPrivateProfileString(szSection, "Fail If Exists", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
if(lstrcmpi(szBuf, "TRUE") == 0)
|
||||
bFailIfExists = TRUE;
|
||||
else
|
||||
bFailIfExists = FALSE;
|
||||
|
||||
FileCopy(szSource, szDestination, bFailIfExists);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Copy File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT CreateDirectoriesAll(char* szPath)
|
||||
{
|
||||
int i;
|
||||
int iLen = lstrlen(szPath);
|
||||
char szCreatePath[MAX_BUF];
|
||||
HRESULT hrResult;
|
||||
|
||||
ZeroMemory(szCreatePath, MAX_BUF);
|
||||
memcpy(szCreatePath, szPath, iLen);
|
||||
for(i = 0; i < iLen; i++)
|
||||
{
|
||||
if((iLen > 1) &&
|
||||
((i != 0) && ((szPath[i] == '\\') || (szPath[i] == '/'))) &&
|
||||
(!((szPath[0] == '\\') && (i == 1)) && !((szPath[1] == ':') && (i == 2))))
|
||||
{
|
||||
szCreatePath[i] = '\0';
|
||||
hrResult = CreateDirectory(szCreatePath, NULL);
|
||||
szCreatePath[i] = szPath[i];
|
||||
}
|
||||
}
|
||||
return(hrResult);
|
||||
}
|
||||
|
||||
HRESULT ProcessCreateDirectory(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szDestination[MAX_BUF];
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Create Directory");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szDestination, szBuf);
|
||||
AppendBackSlash(szDestination, sizeof(szDestination));
|
||||
CreateDirectoriesAll(szDestination);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Create Directory");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT FileDelete(LPSTR szDestination)
|
||||
{
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fdFile;
|
||||
char szBuf[MAX_BUF];
|
||||
char szPathOnly[MAX_BUF];
|
||||
BOOL bFound;
|
||||
|
||||
if(FileExists(szDestination))
|
||||
{
|
||||
/* The file in the From file path exists */
|
||||
DeleteFile(szDestination);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
/* The file in the From file path does not exist. Assume to contain wild args and */
|
||||
/* proceed acordingly. */
|
||||
ParsePath(szDestination, szPathOnly, MAX_BUF, PP_PATH_ONLY);
|
||||
|
||||
if((hFile = FindFirstFile(szDestination, &fdFile)) == INVALID_HANDLE_VALUE)
|
||||
bFound = FALSE;
|
||||
else
|
||||
bFound = TRUE;
|
||||
|
||||
while(bFound)
|
||||
{
|
||||
if(!(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
lstrcpy(szBuf, szPathOnly);
|
||||
AppendBackSlash(szBuf, sizeof(szBuf));
|
||||
lstrcat(szBuf, fdFile.cFileName);
|
||||
|
||||
DeleteFile(szBuf);
|
||||
}
|
||||
|
||||
bFound = FindNextFile(hFile, &fdFile);
|
||||
}
|
||||
|
||||
FindClose(hFile);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessDeleteFile(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szDestination[MAX_BUF];
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Delete File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szDestination, szBuf);
|
||||
FileDelete(szDestination);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Delete File");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs)
|
||||
{
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fdFile;
|
||||
char szDestTemp[MAX_BUF];
|
||||
BOOL bFound;
|
||||
|
||||
if(!FileExists(szDestination))
|
||||
return(FO_SUCCESS);
|
||||
|
||||
if(bRemoveSubdirs == TRUE)
|
||||
{
|
||||
lstrcpy(szDestTemp, szDestination);
|
||||
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
|
||||
lstrcat(szDestTemp, "*");
|
||||
|
||||
bFound = TRUE;
|
||||
hFile = FindFirstFile(szDestTemp, &fdFile);
|
||||
while((hFile != INVALID_HANDLE_VALUE) && (bFound == TRUE))
|
||||
{
|
||||
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
|
||||
{
|
||||
/* create full path */
|
||||
lstrcpy(szDestTemp, szDestination);
|
||||
AppendBackSlash(szDestTemp, sizeof(szDestTemp));
|
||||
lstrcat(szDestTemp, fdFile.cFileName);
|
||||
|
||||
if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
DirectoryRemove(szDestTemp, bRemoveSubdirs);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteFile(szDestTemp);
|
||||
}
|
||||
}
|
||||
|
||||
bFound = FindNextFile(hFile, &fdFile);
|
||||
}
|
||||
|
||||
FindClose(hFile);
|
||||
}
|
||||
|
||||
RemoveDirectory(szDestination);
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessRemoveDirectory(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szDestination[MAX_BUF];
|
||||
BOOL bRemoveSubdirs;
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Remove Directory");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szDestination, szBuf);
|
||||
GetPrivateProfileString(szSection, "Remove subdirs", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
bRemoveSubdirs = FALSE;
|
||||
if(lstrcmpi(szBuf, "TRUE") == 0)
|
||||
bRemoveSubdirs = TRUE;
|
||||
|
||||
DirectoryRemove(szDestination, bRemoveSubdirs);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Remove Directory");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessRunApp(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szTarget[MAX_BUF];
|
||||
char szParameters[MAX_BUF];
|
||||
char szWorkingDir[MAX_BUF];
|
||||
BOOL bWait;
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "RunApp");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Target", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szTarget, szBuf);
|
||||
GetPrivateProfileString(szSection, "Parameters", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szParameters, szBuf);
|
||||
GetPrivateProfileString(szSection, "WorkingDir", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szWorkingDir, szBuf);
|
||||
GetPrivateProfileString(szSection, "Wait", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
|
||||
if(lstrcmpi(szBuf, "FALSE") == 0)
|
||||
bWait = FALSE;
|
||||
else
|
||||
bWait = TRUE;
|
||||
|
||||
if((dwTiming == T_DEPEND_REBOOT) && (NeedReboot() == TRUE))
|
||||
{
|
||||
lstrcat(szTarget, " ");
|
||||
lstrcat(szTarget, szParameters);
|
||||
SetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", "Netscape", REG_SZ, szTarget, lstrlen(szTarget));
|
||||
}
|
||||
else
|
||||
WinSpawn(szTarget, szParameters, szWorkingDir, SW_SHOWNORMAL, bWait);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "RunApp");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Target", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessProgramFolder(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex0;
|
||||
DWORD dwIndex1;
|
||||
DWORD dwIconId;
|
||||
char szIndex0[MAX_BUF];
|
||||
char szIndex1[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection0[MAX_BUF];
|
||||
char szSection1[MAX_BUF];
|
||||
char szProgramFolder[MAX_BUF];
|
||||
char szFile[MAX_BUF];
|
||||
char szArguments[MAX_BUF];
|
||||
char szWorkingDir[MAX_BUF];
|
||||
char szDescription[MAX_BUF];
|
||||
char szIconPath[MAX_BUF];
|
||||
|
||||
dwIndex0 = 0;
|
||||
itoa(dwIndex0, szIndex0, 10);
|
||||
lstrcpy(szSection0, "Program Folder");
|
||||
lstrcat(szSection0, szIndex0);
|
||||
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection0, szFileIniConfig))
|
||||
{
|
||||
DecryptString(szProgramFolder, szBuf);
|
||||
|
||||
dwIndex1 = 0;
|
||||
itoa(dwIndex1, szIndex1, 10);
|
||||
lstrcpy(szSection1, szSection0);
|
||||
lstrcat(szSection1, "-Shortcut");
|
||||
lstrcat(szSection1, szIndex1);
|
||||
GetPrivateProfileString(szSection1, "File", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
DecryptString(szFile, szBuf);
|
||||
GetPrivateProfileString(szSection1, "Arguments", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szArguments, szBuf);
|
||||
GetPrivateProfileString(szSection1, "Working Dir", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szWorkingDir, szBuf);
|
||||
GetPrivateProfileString(szSection1, "Description", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szDescription, szBuf);
|
||||
GetPrivateProfileString(szSection1, "Icon Path", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szIconPath, szBuf);
|
||||
GetPrivateProfileString(szSection1, "Icon Id", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
if(*szBuf != '\0')
|
||||
dwIconId = atol(szBuf);
|
||||
else
|
||||
dwIconId = 0;
|
||||
|
||||
CreateALink(szFile, szProgramFolder, szDescription, szWorkingDir, szArguments, szIconPath, dwIconId);
|
||||
|
||||
++dwIndex1;
|
||||
itoa(dwIndex1, szIndex1, 10);
|
||||
lstrcpy(szSection1, szSection0);
|
||||
lstrcat(szSection1, "-Shortcut");
|
||||
lstrcat(szSection1, szIndex1);
|
||||
GetPrivateProfileString(szSection1, "File", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
}
|
||||
|
||||
++dwIndex0;
|
||||
itoa(dwIndex0, szIndex0, 10);
|
||||
lstrcpy(szSection0, "Program Folder");
|
||||
lstrcat(szSection0, szIndex0);
|
||||
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessProgramFolderShowCmd()
|
||||
{
|
||||
DWORD dwIndex0;
|
||||
int iShowFolder;
|
||||
char szIndex0[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection0[MAX_BUF];
|
||||
char szProgramFolder[MAX_BUF];
|
||||
|
||||
dwIndex0 = 0;
|
||||
itoa(dwIndex0, szIndex0, 10);
|
||||
lstrcpy(szSection0, "Program Folder");
|
||||
lstrcat(szSection0, szIndex0);
|
||||
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
while(*szBuf != '\0')
|
||||
{
|
||||
DecryptString(szProgramFolder, szBuf);
|
||||
GetPrivateProfileString(szSection0, "Show Folder", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
|
||||
if(strcmpi(szBuf, "HIDE") == 0)
|
||||
iShowFolder = SW_HIDE;
|
||||
else if(strcmpi(szBuf, "MAXIMIZE") == 0)
|
||||
iShowFolder = SW_MAXIMIZE;
|
||||
else if(strcmpi(szBuf, "MINIMIZE") == 0)
|
||||
iShowFolder = SW_MINIMIZE;
|
||||
else if(strcmpi(szBuf, "RESTORE") == 0)
|
||||
iShowFolder = SW_RESTORE;
|
||||
else if(strcmpi(szBuf, "SHOW") == 0)
|
||||
iShowFolder = SW_SHOW;
|
||||
else if(strcmpi(szBuf, "SHOWMAXIMIZED") == 0)
|
||||
iShowFolder = SW_SHOWMAXIMIZED;
|
||||
else if(strcmpi(szBuf, "SHOWMINIMIZED") == 0)
|
||||
iShowFolder = SW_SHOWMINIMIZED;
|
||||
else if(strcmpi(szBuf, "SHOWMINNOACTIVE") == 0)
|
||||
iShowFolder = SW_SHOWMINNOACTIVE;
|
||||
else if(strcmpi(szBuf, "SHOWNA") == 0)
|
||||
iShowFolder = SW_SHOWNA;
|
||||
else if(strcmpi(szBuf, "SHOWNOACTIVATE") == 0)
|
||||
iShowFolder = SW_SHOWNOACTIVATE;
|
||||
else if(strcmpi(szBuf, "SHOWNORMAL") == 0)
|
||||
iShowFolder = SW_SHOWNORMAL;
|
||||
|
||||
WinSpawn(szProgramFolder, NULL, NULL, iShowFolder, TRUE);
|
||||
|
||||
++dwIndex0;
|
||||
itoa(dwIndex0, szIndex0, 10);
|
||||
lstrcpy(szSection0, "Program Folder");
|
||||
lstrcat(szSection0, szIndex0);
|
||||
GetPrivateProfileString(szSection0, "Program Folder", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
55
mozilla/xpinstall/wizard/windows/setup/ifuncns.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _IFUNCNS_H_
|
||||
#define _IFUNCNS_H_
|
||||
|
||||
HRESULT TimingCheck(DWORD dwTiming, LPSTR szSection, LPSTR szFile);
|
||||
HRESULT FileUncompress(LPSTR szFrom, LPSTR szTo);
|
||||
HRESULT ProcessCoreFile(void);
|
||||
HRESULT CleanupCoreFile(void);
|
||||
HRESULT ProcessUncompressFile(DWORD dwTiming);
|
||||
HRESULT FileMove(LPSTR szFrom, LPSTR szTo);
|
||||
HRESULT ProcessMoveFile(DWORD dwTiming);
|
||||
HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists);
|
||||
HRESULT ProcessCopyFile(DWORD dwTiming);
|
||||
HRESULT ProcessCreateDirectory(DWORD dwTiming);
|
||||
HRESULT FileDelete(LPSTR szDestination);
|
||||
HRESULT ProcessDeleteFile(DWORD dwTiming);
|
||||
HRESULT DirectoryRemove(LPSTR szDestination, BOOL bRemoveSubdirs);
|
||||
HRESULT ProcessRemoveDirectory(DWORD dwTiming);
|
||||
HRESULT ProcessRunApp(DWORD dwTiming);
|
||||
HRESULT CreateALink(LPSTR lpszPathObj,
|
||||
LPSTR lpszPathLink,
|
||||
LPSTR lpszDesc,
|
||||
LPSTR lpszWorkingPath,
|
||||
LPSTR lpszArgs,
|
||||
LPSTR lpszIconFullPath,
|
||||
int iIcon);
|
||||
HRESULT ProcessProgramFolder(DWORD dwTiming);
|
||||
HRESULT ProcessProgramFolderShowCmd(void);
|
||||
HRESULT CreateDirectoriesAll(char* szPath);
|
||||
void ProcessFileOps(DWORD dwTiming);
|
||||
|
||||
#endif
|
||||
61
mozilla/xpinstall/wizard/windows/setup/makefile.win
Normal file
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = EXE
|
||||
USE_NON_MT_LIBS = 1
|
||||
|
||||
MODULE = setup
|
||||
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
|
||||
RESFILE = $(MODULE).res
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\dialogs.obj \
|
||||
.\$(OBJDIR)\extra.obj \
|
||||
.\$(OBJDIR)\ifuncns.obj \
|
||||
.\$(OBJDIR)\setup.obj \
|
||||
.\$(OBJDIR)\shortcut.obj \
|
||||
.\$(OBJDIR)\xpi.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\nsreg_s.lib \
|
||||
$(DIST)\lib\jar_s.lib \
|
||||
$(DIST)\lib\zlib_s.lib \
|
||||
$(NULL)
|
||||
|
||||
WIN_LIBS= \
|
||||
ole32.lib \
|
||||
comdlg32.lib \
|
||||
shell32.lib \
|
||||
version.lib \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\install
|
||||
|
||||
clobber_all::
|
||||
$(RM) $(DIST)\install\$(MODULE).exe
|
||||
|
||||
47
mozilla/xpinstall/wizard/windows/setup/resource.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
//{{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
|
||||
|
||||
// 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
|
||||
151
mozilla/xpinstall/wizard/windows/setup/setup.c
Normal file
@@ -0,0 +1,151 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "extra.h"
|
||||
#include "dialogs.h"
|
||||
#include "ifuncns.h"
|
||||
|
||||
/* global variables */
|
||||
HINSTANCE hInst;
|
||||
HINSTANCE hSetupRscInst;
|
||||
HINSTANCE hSDInst;
|
||||
HINSTANCE hXPIStubInst;
|
||||
|
||||
HBITMAP hbmpBoxChecked;
|
||||
HBITMAP hbmpBoxUnChecked;
|
||||
|
||||
HANDLE hAccelTable;
|
||||
|
||||
HWND hDlg;
|
||||
HWND hDlgMessage;
|
||||
HWND hWndMain;
|
||||
|
||||
SDI_NETINSTALL pfnNetInstall;
|
||||
|
||||
LPSTR szEGlobalAlloc;
|
||||
LPSTR szEStringLoad;
|
||||
LPSTR szEDllLoad;
|
||||
LPSTR szEStringNull;
|
||||
LPSTR szTempSetupPath;
|
||||
|
||||
LPSTR szClassName;
|
||||
LPSTR szSetupDir;
|
||||
LPSTR szTempDir;
|
||||
LPSTR szFileIniConfig;
|
||||
|
||||
DWORD dwWizardState;
|
||||
DWORD dwSetupType;
|
||||
DWORD dwOSType;
|
||||
DWORD dwScreenX;
|
||||
DWORD dwScreenY;
|
||||
|
||||
DWORD dwTempSetupType;
|
||||
|
||||
BOOL bSDUserCanceled;
|
||||
BOOL bIdiArchivesExists;
|
||||
BOOL bCreateDestinationDir;
|
||||
BOOL bReboot;
|
||||
|
||||
setupGen sgProduct;
|
||||
diS diSetup;
|
||||
diW diWelcome;
|
||||
diL diLicense;
|
||||
diST diSetupType;
|
||||
diSC diSelectComponents;
|
||||
diWI diWindowsIntegration;
|
||||
diPF diProgramFolder;
|
||||
diSI diStartInstall;
|
||||
diR diReboot;
|
||||
siSD siSDObject;
|
||||
siCF siCFCoreFile;
|
||||
siC *siComponents;
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
|
||||
{
|
||||
/***********************************************************************/
|
||||
/* HANDLE hInstance; handle for this instance */
|
||||
/* HANDLE hPrevInstance; handle for possible previous instances */
|
||||
/* LPSTR lpszCmdLine; long pointer to exec command line */
|
||||
/* int nCmdShow; Show code for main window display */
|
||||
/***********************************************************************/
|
||||
|
||||
MSG msg;
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(!hPrevInstance)
|
||||
{
|
||||
if(Initialize(hInstance))
|
||||
PostQuitMessage(1);
|
||||
else if(!InitApplication(hInstance, hSetupRscInst))
|
||||
{
|
||||
char szEFailed[MAX_BUF];
|
||||
|
||||
if(NS_LoadString(hInstance, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK)
|
||||
{
|
||||
wsprintf(szBuf, szEFailed, "InitApplication().");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
}
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(!InitInstance(hInstance, nCmdShow))
|
||||
{
|
||||
char szEFailed[MAX_BUF];
|
||||
|
||||
if(NS_LoadString(hInstance, IDS_ERROR_FAILED, szEFailed, MAX_BUF) == WIZ_OK)
|
||||
{
|
||||
wsprintf(szBuf, szEFailed, "InitInstance().");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
}
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(GetConfigIni())
|
||||
{
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else if(ParseConfigIni(lpszCmdLine))
|
||||
{
|
||||
PostQuitMessage(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DlgSequenceNext();
|
||||
}
|
||||
}
|
||||
|
||||
while(GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if((!IsDialogMessage(hDlg, &msg)) && (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Do clean up before exiting from the application */
|
||||
DeInitialize();
|
||||
|
||||
return(msg.wParam);
|
||||
} /* End of WinMain */
|
||||
|
||||
296
mozilla/xpinstall/wizard/windows/setup/setup.h
Normal file
@@ -0,0 +1,296 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _SETUP_H_
|
||||
#define _SETUP_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define PR_BEGIN_EXTERN_C extern "C" {
|
||||
#define PR_END_EXTERN_C }
|
||||
#else
|
||||
#define PR_BEGIN_EXTERN_C
|
||||
#define PR_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
#define PR_EXTERN(type) type
|
||||
|
||||
typedef unsigned int PRUint32;
|
||||
typedef int PRInt32;
|
||||
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <direct.h>
|
||||
#include <tchar.h>
|
||||
#include <commctrl.h>
|
||||
#include "setuprsc.h"
|
||||
#include "resource.h"
|
||||
#include "zipfile.h"
|
||||
|
||||
/* required only by commercial seamonkey build */
|
||||
#ifndef MOZILLA_CLIENT
|
||||
#include "sdinst.h"
|
||||
#endif
|
||||
|
||||
#define CLASS_NAME "Setup"
|
||||
#define FILE_INI_SETUP "setup.ini"
|
||||
#define FILE_INI_CONFIG "config.ini"
|
||||
#define FILE_IDI_GETCONFIGINI "getconfigini.idi"
|
||||
#define FILE_IDI_GETARCHIVES "getarchives.idi"
|
||||
|
||||
/* PP: Parse Path */
|
||||
#define PP_FILENAME_ONLY 1
|
||||
#define PP_PATH_ONLY 2
|
||||
#define PP_ROOT_ONLY 3
|
||||
|
||||
/* T: Timing */
|
||||
#define T_PRE_DOWNLOAD 1
|
||||
#define T_POST_DOWNLOAD 2
|
||||
#define T_PRE_CORE 3
|
||||
#define T_POST_CORE 4
|
||||
#define T_PRE_SMARTUPDATE 5
|
||||
#define T_POST_SMARTUPDATE 6
|
||||
#define T_PRE_LAUNCHAPP 7
|
||||
#define T_POST_LAUNCHAPP 8
|
||||
#define T_DEPEND_REBOOT 9
|
||||
|
||||
#define MAX_BUF 4096
|
||||
#define ERROR_CODE_HIDE 0
|
||||
#define ERROR_CODE_SHOW 1
|
||||
#define DLG_NONE 0
|
||||
#define CX_CHECKBOX 13
|
||||
#define CY_CHECKBOX 13
|
||||
|
||||
/* WIZ: WIZARD defines */
|
||||
#define WIZ_OK 0
|
||||
#define WIZ_MEMORY_ALLOC_FAILED 1
|
||||
|
||||
/* FO: File Operation */
|
||||
#define FO_OK 0
|
||||
#define FO_SUCCESS 0
|
||||
#define FO_ERROR_FILE_NOT_FOUND 1
|
||||
#define FO_ERROR_DESTINATION_CONFLICT 2
|
||||
#define FO_ERROR_CHANGE_DIR 3
|
||||
|
||||
#define NORMAL 0
|
||||
#define SILENT 1
|
||||
#define AUTO 2
|
||||
|
||||
/* ST: Setup Type */
|
||||
#define ST_RADIO0 0
|
||||
#define ST_RADIO1 1
|
||||
#define ST_RADIO2 2
|
||||
#define ST_RADIO3 3
|
||||
|
||||
/* SM: Setup Type Mode */
|
||||
#define SM_SINGLE 0
|
||||
#define SM_MULTI 1
|
||||
|
||||
/* SIC: Setup Info Component*/
|
||||
#define SIC_SELECTED 1
|
||||
#define SIC_INVISIBLE 2
|
||||
#define SIC_LAUNCHAPP 4
|
||||
#define SIC_DOWNLOAD_REQUIRED 8
|
||||
#define SIC_DOWNLOAD_ONLY 16
|
||||
|
||||
/* OS: Operating System */
|
||||
#define OS_WIN95_DEBUTE 1
|
||||
#define OS_WIN95 2
|
||||
#define OS_WIN98 4
|
||||
#define OS_NT3 8
|
||||
#define OS_NT4 16
|
||||
|
||||
/* DSR: Disk Space Required */
|
||||
#define DSR_DESTINATION 0
|
||||
#define DSR_SYSTEM 1
|
||||
#define DSR_TEMP 2
|
||||
#define DSR_DOWNLOAD_SIZE 3
|
||||
|
||||
typedef HRESULT (_cdecl *SDI_NETINSTALL) (LPSDISTRUCT);
|
||||
|
||||
typedef struct dlgSetup
|
||||
{
|
||||
DWORD dwDlgID;
|
||||
WNDPROC fDlgProc;
|
||||
LPSTR szTitle;
|
||||
} diS;
|
||||
|
||||
typedef struct dlgWelcome
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szMessage1;
|
||||
LPSTR szMessage2;
|
||||
} diW;
|
||||
|
||||
typedef struct dlgLicense
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szLicenseFilename;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szMessage1;
|
||||
} diL;
|
||||
|
||||
typedef struct stStruct
|
||||
{
|
||||
BOOL bVisible;
|
||||
DWORD dwCItems;
|
||||
DWORD dwCItemsSelected[MAX_BUF]; /* components */
|
||||
DWORD dwAItems;
|
||||
DWORD dwAItemsSelected[MAX_BUF]; /* additions */
|
||||
LPSTR szDescriptionShort;
|
||||
LPSTR szDescriptionLong;
|
||||
} st;
|
||||
|
||||
typedef struct dlgSetupType
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szReadmeFilename;
|
||||
LPSTR szReadmeApp;
|
||||
st stSetupType0;
|
||||
st stSetupType1;
|
||||
st stSetupType2;
|
||||
st stSetupType3;
|
||||
} diST;
|
||||
|
||||
typedef struct dlgSelectComponents
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
DWORD bShowDialogSM;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
} diSC;
|
||||
|
||||
typedef struct wiCBstruct
|
||||
{
|
||||
BOOL bEnabled;
|
||||
BOOL bCheckBoxState;
|
||||
LPSTR szDescription;
|
||||
LPSTR szArchive;
|
||||
} wiCBs;
|
||||
|
||||
typedef struct dlgWindowsIntegration
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
LPSTR szMessage1;
|
||||
wiCBs wiCB0;
|
||||
wiCBs wiCB1;
|
||||
wiCBs wiCB2;
|
||||
wiCBs wiCB3;
|
||||
} diWI;
|
||||
|
||||
typedef struct dlgProgramFolder
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
} diPF;
|
||||
|
||||
typedef struct dlgStartInstall
|
||||
{
|
||||
BOOL bShowDialog;
|
||||
LPSTR szTitle;
|
||||
LPSTR szMessage0;
|
||||
} diSI;
|
||||
|
||||
typedef struct dlgReboot
|
||||
{
|
||||
DWORD dwShowDialog;
|
||||
LPSTR szTitle;
|
||||
} diR;
|
||||
|
||||
typedef struct setupStruct
|
||||
{
|
||||
DWORD dwMode;
|
||||
DWORD dwCustomType;
|
||||
LPSTR szPath;
|
||||
LPSTR szProductName;
|
||||
LPSTR szProgramFolderName;
|
||||
LPSTR szProgramFolderPath;
|
||||
LPSTR szAlternateArchiveSearchPath;
|
||||
LPSTR szSetupTitle0;
|
||||
LPSTR szSetupTitle1;
|
||||
LPSTR szSetupTitle2;
|
||||
} setupGen;
|
||||
|
||||
typedef struct sinfoSmartDownload
|
||||
{
|
||||
LPSTR szCoreFile;
|
||||
LPSTR szCoreDir;
|
||||
LPSTR szNoAds;
|
||||
LPSTR szSilent;
|
||||
LPSTR szExecution;
|
||||
LPSTR szConfirmInstall;
|
||||
LPSTR szExtractMsg;
|
||||
LPSTR szExe;
|
||||
LPSTR szExeParam;
|
||||
LPSTR szCoreFilePath;
|
||||
} siSD;
|
||||
|
||||
typedef struct sinfoCoreFile
|
||||
{
|
||||
LPSTR szSource;
|
||||
LPSTR szDestination;
|
||||
LPSTR szMessage;
|
||||
BOOL bCleanup;
|
||||
ULONGLONG ullInstallSize;
|
||||
} siCF;
|
||||
|
||||
typedef struct sinfoComponentDep siCD;
|
||||
struct sinfoComponentDep
|
||||
{
|
||||
LPSTR szDescriptionShort;
|
||||
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 szArchivePath;
|
||||
LPSTR szDestinationPath;
|
||||
LPSTR szDescriptionShort;
|
||||
LPSTR szDescriptionLong;
|
||||
LPSTR szParameter;
|
||||
siCD *siCDDependencies;
|
||||
siC *Next;
|
||||
siC *Prev;
|
||||
};
|
||||
|
||||
#endif
|
||||
BIN
mozilla/xpinstall/wizard/windows/setup/setup.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
12
mozilla/xpinstall/wizard/windows/setup/setup.ini
Normal file
@@ -0,0 +1,12 @@
|
||||
[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
|
||||
|
||||
156
mozilla/xpinstall/wizard/windows/setup/setup.rc
Normal file
@@ -0,0 +1,156 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.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
|
||||
"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,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "Netscape Communications\0"
|
||||
VALUE "FileDescription", "setup\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "setup\0"
|
||||
VALUE "LegalCopyright", "Copyright © 1999\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "setup.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "Netscape Communications setup\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
88
mozilla/xpinstall/wizard/windows/setup/shortcut.cpp
Normal file
@@ -0,0 +1,88 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
/* 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);
|
||||
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;
|
||||
}
|
||||
43
mozilla/xpinstall/wizard/windows/setup/shortcut.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _SHORTCUT_H_
|
||||
#define _SHORTCUT_H_
|
||||
|
||||
#ifndef MAX_BUF
|
||||
#define MAX_BUF 4096
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
HRESULT CreateALink(LPSTR lpszPathObj, LPSTR lpszPathLink, LPSTR lpszDesc, LPSTR lpszWorkingPath, LPSTR lpszArgs, LPSTR lpszIconFullPath, int iIcon);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
688
mozilla/xpinstall/wizard/windows/setup/xpi.c
Normal file
@@ -0,0 +1,688 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include "extern.h"
|
||||
#include "dialogs.h"
|
||||
#include "extra.h"
|
||||
#include "xpistub.h"
|
||||
#include "xpi.h"
|
||||
|
||||
#define BDIR_RIGHT 1
|
||||
#define BDIR_LEFT 2
|
||||
|
||||
static XpiInit pfnXpiInit;
|
||||
static XpiInstall pfnXpiInstall;
|
||||
static XpiExit pfnXpiExit;
|
||||
|
||||
static long lFileCounter;
|
||||
static long lBarberCounter;
|
||||
static BOOL bBarberBar;
|
||||
static DWORD dwBarberDirection;
|
||||
static DWORD dwCurrentArchive;
|
||||
static DWORD dwTotalArchives;
|
||||
char szStrProcessingFile[MAX_BUF];
|
||||
char szStrCopyingFile[MAX_BUF];
|
||||
char szStrInstalling[MAX_BUF];
|
||||
|
||||
static void UpdateGaugeFileProgressBar(unsigned value);
|
||||
static void UpdateGaugeArchiveProgressBar(unsigned value);
|
||||
static void UpdateGaugeFileBarber(void);
|
||||
|
||||
struct ExtractFilesDlgInfo
|
||||
{
|
||||
HWND hWndDlg;
|
||||
int nMaxFileBars; // maximum number of bars that can be displayed
|
||||
int nMaxArchiveBars; // maximum number of bars that can be displayed
|
||||
int nFileBars; // current number of bars to display
|
||||
int nArchiveBars; // current number of bars to display
|
||||
} dlgInfo;
|
||||
|
||||
HRESULT InitializeXPIStub()
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szXPIStubFile[MAX_BUF];
|
||||
char szEGetProcAddress[MAX_BUF];
|
||||
|
||||
hXPIStubInst = NULL;
|
||||
|
||||
if(NS_LoadString(hSetupRscInst, IDS_ERROR_GETPROCADDRESS, szEGetProcAddress, MAX_BUF) != WIZ_OK)
|
||||
return(1);
|
||||
|
||||
/* change current directory to where xpistub.dll */
|
||||
lstrcpy(szBuf, siCFCoreFile.szDestination);
|
||||
AppendBackSlash(szBuf, sizeof(szBuf));
|
||||
lstrcat(szBuf, "bin");
|
||||
chdir(szBuf);
|
||||
|
||||
/* build full path to xpistub.dll */
|
||||
lstrcpy(szXPIStubFile, szBuf);
|
||||
AppendBackSlash(szXPIStubFile, sizeof(szXPIStubFile));
|
||||
lstrcat(szXPIStubFile, "xpistub.dll");
|
||||
|
||||
if(FileExists(szXPIStubFile) == FALSE)
|
||||
return(2);
|
||||
|
||||
/* load xpistub.dll */
|
||||
if((hXPIStubInst = LoadLibraryEx(szXPIStubFile, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, szEDllLoad, szXPIStubFile);
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
return(1);
|
||||
}
|
||||
if(((FARPROC)pfnXpiInit = GetProcAddress(hXPIStubInst, "XPI_Init")) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, szEGetProcAddress, "XPI_Init");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
return(1);
|
||||
}
|
||||
if(((FARPROC)pfnXpiInstall = GetProcAddress(hXPIStubInst, "XPI_Install")) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, szEGetProcAddress, "XPI_Install");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
return(1);
|
||||
}
|
||||
if(((FARPROC)pfnXpiExit = GetProcAddress(hXPIStubInst, "XPI_Exit")) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, szEGetProcAddress, "XPI_Exit");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW);
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
HRESULT DeInitializeXPIStub()
|
||||
{
|
||||
pfnXpiInit = NULL;
|
||||
pfnXpiInstall = NULL;
|
||||
pfnXpiExit = NULL;
|
||||
|
||||
if(hXPIStubInst)
|
||||
FreeLibrary(hXPIStubInst);
|
||||
|
||||
chdir(szSetupDir);
|
||||
return(0);
|
||||
}
|
||||
|
||||
void GetTotalArchivesToInstall(void)
|
||||
{
|
||||
DWORD dwIndex0;
|
||||
siC *siCObject = NULL;
|
||||
|
||||
dwIndex0 = 0;
|
||||
dwTotalArchives = 0;
|
||||
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
|
||||
while(siCObject)
|
||||
{
|
||||
if((siCObject->dwAttributes & SIC_SELECTED) && !(siCObject->dwAttributes & SIC_LAUNCHAPP))
|
||||
++dwTotalArchives;
|
||||
|
||||
++dwIndex0;
|
||||
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT SmartUpdateJars()
|
||||
{
|
||||
DWORD dwIndex0;
|
||||
siC *siCObject = NULL;
|
||||
HRESULT hrResult;
|
||||
char szBuf[MAX_BUF];
|
||||
char szEXpiInstall[MAX_BUF];
|
||||
char szArchive[MAX_BUF];
|
||||
char szMsgSmartUpdateStart[MAX_BUF];
|
||||
char szDlgExtractingTitle[MAX_BUF];
|
||||
|
||||
if(NS_LoadString(hSetupRscInst, IDS_MSG_SMARTUPDATE_START, szMsgSmartUpdateStart, MAX_BUF) != WIZ_OK)
|
||||
return(1);
|
||||
if(NS_LoadString(hSetupRscInst, IDS_DLG_EXTRACTING_TITLE, szDlgExtractingTitle, MAX_BUF) != WIZ_OK)
|
||||
return(1);
|
||||
if(NS_LoadString(hSetupRscInst, IDS_STR_PROCESSINGFILE, szStrProcessingFile, MAX_BUF) != WIZ_OK)
|
||||
exit(1);
|
||||
if(NS_LoadString(hSetupRscInst, IDS_STR_INSTALLING, szStrInstalling, MAX_BUF) != WIZ_OK)
|
||||
exit(1);
|
||||
if(NS_LoadString(hSetupRscInst, IDS_STR_COPYINGFILE, szStrCopyingFile, MAX_BUF) != WIZ_OK)
|
||||
exit(1);
|
||||
|
||||
ShowMessage(szMsgSmartUpdateStart, TRUE);
|
||||
if(InitializeXPIStub() == WIZ_OK)
|
||||
{
|
||||
hrResult = pfnXpiInit(sgProduct.szPath, cbXPIProgress);
|
||||
|
||||
ShowMessage(szMsgSmartUpdateStart, FALSE);
|
||||
InitProgressDlg();
|
||||
GetTotalArchivesToInstall();
|
||||
SetWindowText(dlgInfo.hWndDlg, szDlgExtractingTitle);
|
||||
|
||||
dwIndex0 = 0;
|
||||
dwCurrentArchive = 0;
|
||||
dwTotalArchives = (dwTotalArchives * 2) + 1;
|
||||
bBarberBar = FALSE;
|
||||
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
|
||||
while(siCObject)
|
||||
{
|
||||
/* 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;
|
||||
dwBarberDirection = BDIR_RIGHT;
|
||||
dlgInfo.nFileBars = 0;
|
||||
UpdateGaugeFileProgressBar(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(NS_LoadString(hSetupRscInst, IDS_ERROR_FILE_NOT_FOUND, szEFileNotFound, MAX_BUF) == WIZ_OK)
|
||||
{
|
||||
wsprintf(szBuf, szEFileNotFound, szArchive);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(dwCurrentArchive == 0)
|
||||
{
|
||||
++dwCurrentArchive;
|
||||
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
}
|
||||
|
||||
wsprintf(szBuf, szStrInstalling, siCObject->szDescriptionShort);
|
||||
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS0, szBuf);
|
||||
|
||||
hrResult = pfnXpiInstall(szArchive, "", 0xFFFF);
|
||||
if(hrResult == 999)
|
||||
bReboot = TRUE;
|
||||
else if(hrResult != WIZ_OK)
|
||||
{
|
||||
if(NS_LoadString(hSetupRscInst, IDS_ERROR_XPI_INSTALL, szEXpiInstall, MAX_BUF) == WIZ_OK)
|
||||
{
|
||||
wsprintf(szBuf, "%d: %s", hrResult, szEXpiInstall);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE);
|
||||
}
|
||||
|
||||
/* break out of the while loop */
|
||||
break;
|
||||
}
|
||||
|
||||
++dwCurrentArchive;
|
||||
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
ProcessWindowsMessages();
|
||||
}
|
||||
|
||||
++dwIndex0;
|
||||
siCObject = SiCNodeGetObject(dwIndex0, TRUE);
|
||||
}
|
||||
|
||||
pfnXpiExit();
|
||||
DeInitProgressDlg();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowMessage(szMsgSmartUpdateStart, FALSE);
|
||||
}
|
||||
|
||||
DeInitializeXPIStub();
|
||||
|
||||
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];
|
||||
|
||||
ParsePath((char *)msg, szFilename, sizeof(szFilename), PP_FILENAME_ONLY);
|
||||
|
||||
if(max == 0)
|
||||
{
|
||||
wsprintf(szStrProcessingFileBuf, szStrProcessingFile, szFilename);
|
||||
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS3, szStrProcessingFileBuf);
|
||||
bBarberBar = TRUE;
|
||||
UpdateGaugeFileBarber();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(bBarberBar == TRUE)
|
||||
{
|
||||
dlgInfo.nFileBars = 0;
|
||||
++dwCurrentArchive;
|
||||
UpdateGaugeArchiveProgressBar((unsigned)(((double)(dwCurrentArchive)/(double)dwTotalArchives)*(double)100));
|
||||
bBarberBar = FALSE;
|
||||
}
|
||||
|
||||
wsprintf(szStrCopyingFileBuf, szStrCopyingFile, szFilename);
|
||||
SetDlgItemText(dlgInfo.hWndDlg, IDC_STATUS3, szStrCopyingFileBuf);
|
||||
UpdateGaugeFileProgressBar((unsigned)(((double)(val+1)/(double)max)*(double)100));
|
||||
}
|
||||
|
||||
ProcessWindowsMessages();
|
||||
}
|
||||
|
||||
void cbXPIFinal(const char *URL, PRInt32 finalStatus)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Progress bar
|
||||
|
||||
// Centers the specified window over the desktop. Assumes the window is
|
||||
// smaller both horizontally and vertically than the desktop
|
||||
static void
|
||||
CenterWindow(HWND hWndDlg)
|
||||
{
|
||||
RECT rect;
|
||||
int iLeft, iTop;
|
||||
|
||||
GetWindowRect(hWndDlg, &rect);
|
||||
iLeft = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
|
||||
iTop = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;
|
||||
|
||||
SetWindowPos(hWndDlg, NULL, iLeft, iTop, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
// Window proc for dialog
|
||||
LRESULT CALLBACK
|
||||
ProgressDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
CenterWindow(hWndDlg);
|
||||
return FALSE;
|
||||
|
||||
case WM_COMMAND:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE; // didn't handle the message
|
||||
}
|
||||
|
||||
// This routine will update the File Gauge progress bar to the specified percentage
|
||||
// (value between 0 and 100)
|
||||
static void
|
||||
UpdateGaugeFileBarber()
|
||||
{
|
||||
int nBars;
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
|
||||
RECT rect;
|
||||
|
||||
if(dwBarberDirection == BDIR_RIGHT)
|
||||
{
|
||||
if(lBarberCounter < 151)
|
||||
++lBarberCounter;
|
||||
else
|
||||
dwBarberDirection = BDIR_LEFT;
|
||||
}
|
||||
else if(dwBarberDirection == BDIR_LEFT)
|
||||
{
|
||||
if(lBarberCounter > 0)
|
||||
--lBarberCounter;
|
||||
else
|
||||
dwBarberDirection = BDIR_RIGHT;
|
||||
}
|
||||
|
||||
// Figure out how many bars should be displayed
|
||||
nBars = (dlgInfo.nMaxFileBars * lBarberCounter / 100);
|
||||
|
||||
// Update the gauge state before painting
|
||||
dlgInfo.nFileBars = nBars;
|
||||
|
||||
// Only invalidate the part that needs updating
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
|
||||
// Update the whole extracting dialog. We do this because we don't
|
||||
// have a message loop to process WM_PAINT messages in case the
|
||||
// extracting dialog was exposed
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
|
||||
// This routine will update the File Gauge progress bar to the specified percentage
|
||||
// (value between 0 and 100)
|
||||
static void
|
||||
UpdateGaugeFileProgressBar(unsigned value)
|
||||
{
|
||||
int nBars;
|
||||
|
||||
// Figure out how many bars should be displayed
|
||||
nBars = dlgInfo.nMaxFileBars * value / 100;
|
||||
|
||||
// Only paint if we need to display more bars
|
||||
if((nBars > dlgInfo.nFileBars) || (dlgInfo.nFileBars == 0))
|
||||
{
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_FILE);
|
||||
RECT rect;
|
||||
|
||||
// Update the gauge state before painting
|
||||
dlgInfo.nFileBars = nBars;
|
||||
|
||||
// Only invalidate the part that needs updating
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
|
||||
// Update the whole extracting dialog. We do this because we don't
|
||||
// have a message loop to process WM_PAINT messages in case the
|
||||
// extracting dialog was exposed
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
}
|
||||
|
||||
// This routine will update the Archive Gauge progress bar to the specified percentage
|
||||
// (value between 0 and 100)
|
||||
static void
|
||||
UpdateGaugeArchiveProgressBar(unsigned value)
|
||||
{
|
||||
int nBars;
|
||||
|
||||
// Figure out how many bars should be displayed
|
||||
nBars = dlgInfo.nMaxArchiveBars * value / 100;
|
||||
|
||||
// Only paint if we need to display more bars
|
||||
if (nBars > dlgInfo.nArchiveBars)
|
||||
{
|
||||
HWND hWndGauge = GetDlgItem(dlgInfo.hWndDlg, IDC_GAUGE_ARCHIVE);
|
||||
RECT rect;
|
||||
|
||||
// Update the gauge state before painting
|
||||
dlgInfo.nArchiveBars = nBars;
|
||||
|
||||
// Only invalidate the part that needs updating
|
||||
GetClientRect(hWndGauge, &rect);
|
||||
InvalidateRect(hWndGauge, &rect, FALSE);
|
||||
|
||||
// Update the whole extracting dialog. We do this because we don't
|
||||
// have a message loop to process WM_PAINT messages in case the
|
||||
// extracting dialog was exposed
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
}
|
||||
|
||||
// Draws a recessed border around the gauge
|
||||
static void
|
||||
DrawGaugeBorder(HWND hWnd)
|
||||
{
|
||||
HDC hDC = GetWindowDC(hWnd);
|
||||
RECT rect;
|
||||
int cx, cy;
|
||||
HPEN hShadowPen = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_BTNSHADOW));
|
||||
HGDIOBJ hOldPen;
|
||||
|
||||
GetWindowRect(hWnd, &rect);
|
||||
cx = rect.right - rect.left;
|
||||
cy = rect.bottom - rect.top;
|
||||
|
||||
// Draw a dark gray line segment
|
||||
hOldPen = SelectObject(hDC, (HGDIOBJ)hShadowPen);
|
||||
MoveToEx(hDC, 0, cy - 1, NULL);
|
||||
LineTo(hDC, 0, 0);
|
||||
LineTo(hDC, cx - 1, 0);
|
||||
|
||||
// Draw a white line segment
|
||||
SelectObject(hDC, GetStockObject(WHITE_PEN));
|
||||
MoveToEx(hDC, 0, cy - 1, NULL);
|
||||
LineTo(hDC, cx - 1, cy - 1);
|
||||
LineTo(hDC, cx - 1, 0);
|
||||
|
||||
SelectObject(hDC, hOldPen);
|
||||
DeleteObject(hShadowPen);
|
||||
ReleaseDC(hWnd, hDC);
|
||||
}
|
||||
|
||||
// Draws the blue progress bar
|
||||
static void
|
||||
DrawProgressBar(HWND hWnd, int nBars)
|
||||
{
|
||||
int i;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
RECT rect;
|
||||
HBRUSH hBrush;
|
||||
|
||||
hDC = BeginPaint(hWnd, &ps);
|
||||
GetClientRect(hWnd, &rect);
|
||||
if(nBars <= 0)
|
||||
{
|
||||
/* clear the bars */
|
||||
hBrush = CreateSolidBrush(GetSysColor(COLOR_MENU));
|
||||
FillRect(hDC, &rect, hBrush);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw the bars
|
||||
hBrush = CreateSolidBrush(RGB(0, 0, 128));
|
||||
rect.left = rect.top = BAR_MARGIN;
|
||||
rect.bottom -= BAR_MARGIN;
|
||||
rect.right = rect.left + BAR_WIDTH;
|
||||
|
||||
for(i = 0; i < nBars; i++)
|
||||
{
|
||||
RECT dest;
|
||||
|
||||
if(IntersectRect(&dest, &ps.rcPaint, &rect))
|
||||
FillRect(hDC, &rect, hBrush);
|
||||
|
||||
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteObject(hBrush);
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
|
||||
// Draws the blue progress bar
|
||||
static void
|
||||
DrawBarberBar(HWND hWnd, int nBars)
|
||||
{
|
||||
int i;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
RECT rect;
|
||||
HBRUSH hBrush;
|
||||
HBRUSH hBrushClear;
|
||||
|
||||
hDC = BeginPaint(hWnd, &ps);
|
||||
GetClientRect(hWnd, &rect);
|
||||
if(nBars <= 0)
|
||||
{
|
||||
/* clear the bars */
|
||||
hBrushClear = CreateSolidBrush(GetSysColor(COLOR_MENU));
|
||||
FillRect(hDC, &rect, hBrushClear);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw the bars
|
||||
hBrushClear = CreateSolidBrush(GetSysColor(COLOR_MENU));
|
||||
hBrush = CreateSolidBrush(RGB(0, 0, 128));
|
||||
rect.left = rect.top = BAR_MARGIN;
|
||||
rect.bottom -= BAR_MARGIN;
|
||||
rect.right = rect.left + BAR_WIDTH;
|
||||
|
||||
for(i = 0; i < (nBars + 1); i++)
|
||||
{
|
||||
RECT dest;
|
||||
|
||||
if(IntersectRect(&dest, &ps.rcPaint, &rect))
|
||||
{
|
||||
if((i >= (nBars - 15)) && (i < nBars))
|
||||
FillRect(hDC, &rect, hBrush);
|
||||
else
|
||||
FillRect(hDC, &rect, hBrushClear);
|
||||
}
|
||||
|
||||
OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);
|
||||
}
|
||||
}
|
||||
|
||||
DeleteObject(hBrushClear);
|
||||
DeleteObject(hBrush);
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
|
||||
// Adjusts the width of the gauge based on the maximum number of bars
|
||||
static void
|
||||
SizeToFitGauge(HWND hWnd, int nMaxBars)
|
||||
{
|
||||
RECT rect;
|
||||
int cx;
|
||||
|
||||
// Get the window size in pixels
|
||||
GetWindowRect(hWnd, &rect);
|
||||
|
||||
// Size the width to fit
|
||||
cx = 2 * GetSystemMetrics(SM_CXBORDER) + 2 * BAR_MARGIN +
|
||||
nMaxBars * BAR_WIDTH + (nMaxBars - 1) * BAR_SPACING;
|
||||
|
||||
SetWindowPos(hWnd, NULL, -1, -1, cx, rect.bottom - rect.top,
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
// Window proc for file gauge
|
||||
LRESULT CALLBACK
|
||||
GaugeFileWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DWORD dwStyle;
|
||||
RECT rect;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_NCCREATE:
|
||||
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
|
||||
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
|
||||
return(TRUE);
|
||||
|
||||
case WM_CREATE:
|
||||
// Figure out the maximum number of bars that can be displayed
|
||||
GetClientRect(hWnd, &rect);
|
||||
dlgInfo.nFileBars = 0;
|
||||
dlgInfo.nMaxFileBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
|
||||
|
||||
// Size the gauge to exactly fit the maximum number of bars
|
||||
SizeToFitGauge(hWnd, dlgInfo.nMaxFileBars);
|
||||
return(FALSE);
|
||||
|
||||
case WM_NCPAINT:
|
||||
DrawGaugeBorder(hWnd);
|
||||
return(FALSE);
|
||||
|
||||
case WM_PAINT:
|
||||
if(bBarberBar == TRUE)
|
||||
DrawBarberBar(hWnd, dlgInfo.nFileBars);
|
||||
else
|
||||
DrawProgressBar(hWnd, dlgInfo.nFileBars);
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(DefWindowProc(hWnd, msg, wParam, lParam));
|
||||
}
|
||||
|
||||
// Window proc for file gauge
|
||||
LRESULT CALLBACK
|
||||
GaugeArchiveWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
DWORD dwStyle;
|
||||
RECT rect;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_NCCREATE:
|
||||
dwStyle = GetWindowLong(hWnd, GWL_STYLE);
|
||||
SetWindowLong(hWnd, GWL_STYLE, dwStyle | WS_BORDER);
|
||||
return(TRUE);
|
||||
|
||||
case WM_CREATE:
|
||||
// Figure out the maximum number of bars that can be displayed
|
||||
GetClientRect(hWnd, &rect);
|
||||
dlgInfo.nArchiveBars = 0;
|
||||
dlgInfo.nMaxArchiveBars = (rect.right - rect.left - 2 * BAR_MARGIN + BAR_SPACING) / (BAR_WIDTH + BAR_SPACING);
|
||||
|
||||
// Size the gauge to exactly fit the maximum number of bars
|
||||
SizeToFitGauge(hWnd, dlgInfo.nMaxArchiveBars);
|
||||
return(FALSE);
|
||||
|
||||
case WM_NCPAINT:
|
||||
DrawGaugeBorder(hWnd);
|
||||
return(FALSE);
|
||||
|
||||
case WM_PAINT:
|
||||
DrawProgressBar(hWnd, dlgInfo.nArchiveBars);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
return(DefWindowProc(hWnd, msg, wParam, lParam));
|
||||
}
|
||||
|
||||
void InitProgressDlg()
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
memset(&wc, 0, sizeof(wc));
|
||||
wc.style = CS_GLOBALCLASS;
|
||||
wc.hInstance = hInst;
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
|
||||
wc.lpfnWndProc = (WNDPROC)GaugeFileWndProc;
|
||||
wc.lpszClassName = "GaugeFile";
|
||||
RegisterClass(&wc);
|
||||
|
||||
wc.lpfnWndProc = (WNDPROC)GaugeArchiveWndProc;
|
||||
wc.lpszClassName = "GaugeArchive";
|
||||
RegisterClass(&wc);
|
||||
|
||||
// Display the dialog box
|
||||
dlgInfo.hWndDlg = CreateDialog(hSetupRscInst, MAKEINTRESOURCE(DLG_EXTRACTING), hWndMain, (WNDPROC)ProgressDlgProc);
|
||||
UpdateWindow(dlgInfo.hWndDlg);
|
||||
}
|
||||
|
||||
void DeInitProgressDlg()
|
||||
{
|
||||
DestroyWindow(dlgInfo.hWndDlg);
|
||||
UnregisterClass("GaugeFile", hInst);
|
||||
UnregisterClass("GaugeArchive", hInst);
|
||||
}
|
||||
46
mozilla/xpinstall/wizard/windows/setup/xpi.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _XPI_H_
|
||||
#define _XPI_H_
|
||||
|
||||
#define BAR_MARGIN 1
|
||||
#define BAR_SPACING 2
|
||||
#define BAR_WIDTH 6
|
||||
|
||||
typedef HRESULT (_cdecl *XpiInit)(const char *, pfnXPIProgress);
|
||||
typedef HRESULT (_cdecl *XpiInstall)(const char *, const char *, long);
|
||||
typedef void (_cdecl *XpiExit)(void);
|
||||
|
||||
HRESULT InitializeXPIStub(void);
|
||||
HRESULT DeInitializeXPIStub(void);
|
||||
HRESULT SmartUpdateJars(void);
|
||||
void cbXPIStart(const char *, const char *UIName);
|
||||
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max);
|
||||
void cbXPIFinal(const char *, PRInt32 finalStatus);
|
||||
void InitProgressDlg(void);
|
||||
void DeInitProgressDlg(void);
|
||||
void GetTotalArchivesToInstall(void);
|
||||
|
||||
#endif
|
||||
118
mozilla/xpinstall/wizard/windows/setup/xpistub.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
//#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
|
||||
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
|
||||
|
||||
86
mozilla/xpinstall/wizard/windows/setup/zipfile.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _zipfile_h
|
||||
#define _zipfile_h
|
||||
/*
|
||||
* This module implements a simple archive extractor for the PKZIP format.
|
||||
*
|
||||
* All functions return a status/error code, and have an opaque hZip argument
|
||||
* that represents an open archive.
|
||||
*
|
||||
* Currently only compression mode 8 (or none) is supported.
|
||||
*/
|
||||
|
||||
|
||||
#define ZIP_OK 0
|
||||
#define ZIP_ERR_GENERAL -1
|
||||
#define ZIP_ERR_MEMORY -2
|
||||
#define ZIP_ERR_DISK -3
|
||||
#define ZIP_ERR_CORRUPT -4
|
||||
#define ZIP_ERR_PARAM -5
|
||||
#define ZIP_ERR_FNF -6
|
||||
#define ZIP_ERR_UNSUPPORTED -7
|
||||
#define ZIP_ERR_SMALLBUF -8
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
/* Open and close the archive
|
||||
*
|
||||
* If successful OpenArchive returns a handle in the hZip parameter
|
||||
* that must be passed to all subsequent operations on the archive
|
||||
*/
|
||||
extern _declspec(dllexport)int ZIP_OpenArchive( const char * zipname, void** hZip );
|
||||
extern _declspec(dllexport)int ZIP_CloseArchive( void** hZip );
|
||||
|
||||
|
||||
/* Extract the named file in the archive to disk.
|
||||
* This function will happily overwrite an existing Outfile if it can.
|
||||
* It's up to the caller to detect or move it out of the way if it's important.
|
||||
*/
|
||||
extern _declspec(dllexport)int ZIP_ExtractFile( void* hZip, const char * filename, const char * outname );
|
||||
|
||||
|
||||
/* Functions to list the files contained in the archive
|
||||
*
|
||||
* FindInit() initializes the search with the pattern and returns a find token,
|
||||
* or NULL on an error. Then FindNext() is called with the token to get the
|
||||
* matching filenames if any. When done you must call FindFree() with the
|
||||
* token to release memory.
|
||||
*
|
||||
* a NULL pattern will find all the files in the archive, otherwise the
|
||||
* pattern must be a shell regexp type pattern.
|
||||
*
|
||||
* if a matching filename is too small for the passed buffer FindNext()
|
||||
* will return ZIP_ERR_SMALLBUF. When no more matches can be found in
|
||||
* the archive it will return ZIP_ERR_FNF
|
||||
*/
|
||||
extern _declspec(dllexport)void* ZIP_FindInit( void* hZip, const char * pattern );
|
||||
extern _declspec(dllexport)int ZIP_FindNext( void* hFind, char * outbuf, int bufsize );
|
||||
extern _declspec(dllexport)int ZIP_FindFree( void* hFind );
|
||||
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* _zipfile_h */
|
||||
BIN
mozilla/xpinstall/wizard/windows/setuprsc/bitmap1.bmp
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
mozilla/xpinstall/wizard/windows/setuprsc/box_chec.bmp
Normal file
|
After Width: | Height: | Size: 206 B |
BIN
mozilla/xpinstall/wizard/windows/setuprsc/box_unch.bmp
Normal file
|
After Width: | Height: | Size: 206 B |
55
mozilla/xpinstall/wizard/windows/setuprsc/makefile.win
Normal file
@@ -0,0 +1,55 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Sean Su <ssu@netscape.com>
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
|
||||
USE_NON_MT_LIBS=1
|
||||
#USE_STATIC_LIBS=1
|
||||
|
||||
MODULE = setuprsc
|
||||
RESFILE = $(MODULE).res
|
||||
DLL = $(OBJDIR)\$(MODULE).dll
|
||||
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\setuprsc.obj \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
docopy:
|
||||
$(MAKE_INSTALL) setuprsc.h $(DIST)\include
|
||||
|
||||
export:: docopy
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).dll $(DIST)\install
|
||||
|
||||
clobber::
|
||||
$(RM) $(DIST)\include\setuprsc.h
|
||||
|
||||
clobber_all:: clobber
|
||||
$(RM) $(DIST)\install\$(MODULE).dll
|
||||
|
||||
BIN
mozilla/xpinstall/wizard/windows/setuprsc/setup.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
29
mozilla/xpinstall/wizard/windows/setuprsc/setuprsc.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
int FAR PASCAL LibMain(HINSTANCE hInstance, WORD wDataSeg, WORD cbHeapSize, LPSTR lpCmdLine)
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
126
mozilla/xpinstall/wizard/windows/setuprsc/setuprsc.h
Normal file
@@ -0,0 +1,126 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by setuprsc.rc
|
||||
//
|
||||
//#include "winres.h"
|
||||
#include "winresrc.h"
|
||||
//#include "winuser.rh"
|
||||
|
||||
#ifdef IDC_STATIC
|
||||
#undef IDC_STATIC
|
||||
#endif
|
||||
#define IDC_STATIC (-1)
|
||||
|
||||
#define IDS_ERROR_DIALOG_CREATE 1
|
||||
#define IDS_ERROR_FAILED 2
|
||||
#define IDS_ERROR_FILE_NOT_FOUND 3
|
||||
#define IDS_ERROR_GET_SYSTEM_DIRECTORY_FAILED 4
|
||||
#define IDS_ERROR_GET_WINDOWS_DIRECTORY_FAILED 5
|
||||
#define IDS_DLGQUITTITLE 6
|
||||
#define IDS_DLGQUITMSG 7
|
||||
#define IDS_DLG_REBOOT_TITLE 8
|
||||
#define IDS_ERROR_GETPROCADDRESS 9
|
||||
#define IDS_ERROR_WRITEPRIVATEPROFILESTRING 10
|
||||
#define IDS_MSG_RETRIEVE_CONFIGINI 11
|
||||
#define IDS_ERROR_CREATE_TEMP_DIR 12
|
||||
#define IDS_DLGBROWSETITLE 13
|
||||
#define IDS_ERROR_DETERMINING_DISK_SPACE 14
|
||||
#define IDS_DLG_DISK_SPACE_CHECK_TITLE 15
|
||||
#define IDS_DLG_DISK_SPACE_CHECK_SYS_MSG 16
|
||||
#define IDS_DLG_DISK_SPACE_CHECK_CRUTIAL_MSG 16
|
||||
#define IDS_DLG_DISK_SPACE_CHECK_MSG 17
|
||||
#define IDS_ERROR_CREATE_DIRECTORY 18
|
||||
#define IDS_STR_FILE_NUMBER 19
|
||||
#define IDS_STR_FILENAME 20
|
||||
#define IDS_MSG_SMARTUPDATE_START 21
|
||||
#define IDS_MSG_CONFIGURING 22
|
||||
#define IDS_ERROR_XPI_INSTALL 23
|
||||
#define IDS_ERROR_SETUP_REQUIREMENT 24
|
||||
#define IDS_DLG_EXTRACTING_TITLE 25
|
||||
#define IDS_STR_PROCESSINGFILE 26
|
||||
#define IDS_STR_INSTALLING 27
|
||||
#define IDS_STR_COPYINGFILE 28
|
||||
#define IDI_ICON1 105
|
||||
#define IDI_SETUP 105
|
||||
#define IDB_BITMAP_WELCOME 108
|
||||
#define DLG_MESSAGE 110
|
||||
#define DLG_BROWSE_DIR 503
|
||||
#define IDC_STATUS 1001
|
||||
#define IDC_STATUS1 1001
|
||||
#define IDC_GAUGE 1002
|
||||
#define IDC_GAUGE_FILE 1002
|
||||
#define IDC_STATUS2 1003
|
||||
#define IDC_STATUS0 1004
|
||||
#define IDC_STATUS3 1005
|
||||
#define IDC_GAUGE_ARCHIVE 1006
|
||||
#define IDC_EDIT_DESTINATION 1009
|
||||
#define IDC_BUTTON_BROWSE 1010
|
||||
#define IDC_EDIT_COMPONENT1 1013
|
||||
#define IDC_EDIT_SUBCOMPONENT 1014
|
||||
#define IDC_STATIC_SUBCOMPONENT 1016
|
||||
#define IDC_CHECK1 1017
|
||||
#define IDC_STATIC_DESCRIPTION 1018
|
||||
#define IDC_EDIT_PROGRAM_FOLDER 1019
|
||||
#define IDC_CHECK2 1023
|
||||
#define IDC_LIST2 1023
|
||||
#define IDC_LIST 1023
|
||||
#define IDC_CHECK3 1024
|
||||
#define IDC_EDIT_LICENSE 1024
|
||||
#define IDC_CHECK0 1025
|
||||
#define IDC_EDIT_CURRENT_SETTINGS 1026
|
||||
#define IDC_LIST_COMPONENTS 1027
|
||||
#define IDC_LIST_SUBCOMPONENTS 1029
|
||||
#define IDC_STATIC_DRIVE_SPACE_REQUIRED 1030
|
||||
#define IDC_STATIC_DRIVE_SPACE_AVAILABLE 1031
|
||||
#define IDC_STATIC_DESTINATION 1032
|
||||
#define IDC_STATIC0 1033
|
||||
#define IDC_STATIC1 1034
|
||||
#define IDC_STATIC2 1035
|
||||
#define IDC_MESSAGE1 1040
|
||||
#define IDC_PICT0 1041
|
||||
#define IDC_MESSAGE0 1042
|
||||
#define IDC_STATIC_ST0_DESCRIPTION 1042
|
||||
#define IDC_STATIC_ST1_DESCRIPTION 1043
|
||||
#define IDC_STATIC_ST2_DESCRIPTION 1044
|
||||
#define IDC_STATIC_ST3_DESCRIPTION 1045
|
||||
#define IDC_STATIC_MSG0 1046
|
||||
#define IDC_MESSAGE 1049
|
||||
#define IDC_LIST1 1053
|
||||
#define IDC_BUTTON1 1055
|
||||
#define IDC_README 1055
|
||||
#define DLG_WELCOME 2001
|
||||
#define DLG_LICENSE 2002
|
||||
#define DLG_SETUP_TYPE 2003
|
||||
#define DLG_SELECT_COMPONENTS_SINGLE 2004
|
||||
#define DLG_SELECT_COMPONENTS 2004
|
||||
#define DLG_SELECT_COMPONENTS_MULTI 2005
|
||||
#define DLG_WINDOWS_INTEGRATION 2006
|
||||
#define DLG_PROGRAM_FOLDER 2007
|
||||
#define DLG_START_INSTALL 2008
|
||||
#define DLG_EXTRACTING 2009
|
||||
#define DLG_RESTART 10206
|
||||
#define IDB_BOX_CHECKED 10304
|
||||
#define IDB_BOX_UNCHECKED 10306
|
||||
#define IDC_RADIO_TYPICAL 11007
|
||||
#define IDC_RADIO_ST0 11007
|
||||
#define IDC_RADIO_CUSTOM 11008
|
||||
#define IDC_RADIO_ST2 11008
|
||||
#define IDC_RADIO_COMPACT 11009
|
||||
#define IDC_RADIO_ST1 11009
|
||||
#define IDC_RADIO_ST3 11010
|
||||
#define IDC_RADIO_YES 11011
|
||||
#define IDC_RADIO_NO 11012
|
||||
#define IDWIZBACK 11013
|
||||
#define IDWIZNEXT 11014
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 112
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1058
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
351
mozilla/xpinstall/wizard/windows/setuprsc/setuprsc.rc
Normal file
@@ -0,0 +1,351 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#define WINVER 0x400
|
||||
#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, 315, 205
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&Next >",IDWIZNEXT,188,186,53,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
|
||||
LTEXT "",IDC_STATIC0,127,11,176,37,NOT WS_GROUP
|
||||
LTEXT "",IDC_STATIC1,127,53,176,37,NOT WS_GROUP
|
||||
LTEXT "",IDC_STATIC2,127,96,176,37,NOT WS_GROUP
|
||||
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
|
||||
WS_EX_CLIENTEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
DLG_SETUP_TYPE DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_RADIO_ST0,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_TABSTOP,102,31,65,8
|
||||
CONTROL "",IDC_RADIO_ST1,"Button",BS_AUTORADIOBUTTON,102,59,65,8
|
||||
CONTROL "",IDC_RADIO_ST2,"Button",BS_AUTORADIOBUTTON,102,86,64,8
|
||||
CONTROL "",IDC_RADIO_ST3,"Button",BS_AUTORADIOBUTTON,102,114,64,
|
||||
8
|
||||
LTEXT "",IDC_STATIC_ST0_DESCRIPTION,175,31,126,24
|
||||
LTEXT "",IDC_STATIC_ST3_DESCRIPTION,175,114,126,25
|
||||
LTEXT "",IDC_STATIC_ST1_DESCRIPTION,175,59,126,24
|
||||
LTEXT "",IDC_STATIC_ST2_DESCRIPTION,175,86,126,24
|
||||
GROUPBOX "&Destination Directory",IDC_STATIC,101,147,204,27
|
||||
PUSHBUTTON "B&rowse...",IDC_BUTTON_BROWSE,255,157,46,12
|
||||
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,12
|
||||
DEFPUSHBUTTON "&Next >",IDWIZNEXT,188,186,53,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
|
||||
LTEXT "",IDC_STATIC_MSG0,101,11,204,17,NOT WS_GROUP
|
||||
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
|
||||
WS_EX_CLIENTEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Readme",IDC_README,11,186,53,12
|
||||
LTEXT "Static",IDC_EDIT_DESTINATION,107,160,144,9
|
||||
END
|
||||
|
||||
DLG_SELECT_COMPONENTS DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,12
|
||||
DEFPUSHBUTTON "&Next >",IDWIZNEXT,188,186,53,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
|
||||
LTEXT "Select the components you want to install, clear the components you do not want to install. ",
|
||||
IDC_STATIC,101,10,204,19,NOT WS_GROUP
|
||||
LTEXT "C&omponents",IDC_STATIC,101,32,103,8
|
||||
GROUPBOX "Description",IDC_STATIC,101,124,204,22
|
||||
LTEXT "Component Description",IDC_STATIC_DESCRIPTION,106,133,
|
||||
195,8
|
||||
GROUPBOX "&Disk space information",IDC_STATIC,101,150,204,23
|
||||
LTEXT "Total download size:",IDC_STATIC,106,160,91,8,NOT
|
||||
WS_GROUP
|
||||
RTEXT "",IDC_STATIC_DRIVE_SPACE_REQUIRED,206,160,94,8,NOT
|
||||
WS_GROUP
|
||||
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
|
||||
WS_EX_CLIENTEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
LISTBOX IDC_LIST_COMPONENTS,101,42,204,78,LBS_OWNERDRAWFIXED |
|
||||
LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_GROUP | WS_TABSTOP
|
||||
LTEXT "Download Size",IDC_STATIC,201,32,103,8,0,WS_EX_RIGHT
|
||||
END
|
||||
|
||||
DLG_WINDOWS_INTEGRATION DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Check0",IDC_CHECK0,"Button",BS_AUTOCHECKBOX | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,101,32,205,17
|
||||
CONTROL "Check1",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,101,53,205,17
|
||||
CONTROL "Check2",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,101,73,205,17
|
||||
CONTROL "Check3",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,101,94,205,17
|
||||
LTEXT "",IDC_MESSAGE1,101,117,205,54,NOT WS_GROUP
|
||||
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,12
|
||||
DEFPUSHBUTTON "&Next >",IDWIZNEXT,188,186,53,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
|
||||
LTEXT "",IDC_MESSAGE0,101,11,204,17,NOT WS_GROUP
|
||||
CONTROL 108,IDC_PICT0,"Static",SS_BITMAP,11,11,80,160,
|
||||
WS_EX_CLIENTEDGE
|
||||
CONTROL "",IDC_STATIC0,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
DLG_PROGRAM_FOLDER DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDIT_PROGRAM_FOLDER,101,64,204,12,ES_AUTOHSCROLL
|
||||
LISTBOX IDC_LIST,101,94,204,77,LBS_SORT | LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,12
|
||||
DEFPUSHBUTTON "&Next >",IDWIZNEXT,188,186,53,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
|
||||
LTEXT "Click the type of Setup you prefer, then click Next.",
|
||||
IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP
|
||||
LTEXT "&Program Folder:",IDC_STATIC,101,54,105,8
|
||||
LTEXT "E&xisting Folders:",IDC_STATIC,101,84,163,8
|
||||
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,83,162,
|
||||
WS_EX_CLIENTEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
DLG_LICENSE DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&Accept",IDWIZNEXT,188,186,53,12
|
||||
PUSHBUTTON "&No",IDCANCEL,252,186,53,12
|
||||
EDITTEXT IDC_EDIT_LICENSE,11,29,295,119,ES_MULTILINE |
|
||||
ES_OEMCONVERT | ES_READONLY | WS_VSCROLL | WS_GROUP
|
||||
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,12
|
||||
LTEXT "",IDC_MESSAGE0,11,8,295,17,NOT WS_GROUP
|
||||
LTEXT "",IDC_MESSAGE1,11,152,295,19,NOT WS_GROUP
|
||||
CONTROL "",-1,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
DLG_START_INSTALL DIALOG DISCARDABLE 51, 56, 315, 205
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDIT_CURRENT_SETTINGS,101,67,204,104,ES_MULTILINE |
|
||||
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY
|
||||
PUSHBUTTON "< &Back",IDWIZBACK,134,186,53,12
|
||||
DEFPUSHBUTTON "&Install",IDWIZNEXT,188,186,53,12
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,252,186,53,12
|
||||
LTEXT "Click the type of Setup you prefer, then click Next.",
|
||||
IDC_MESSAGE0,101,11,204,33,NOT WS_GROUP
|
||||
LTEXT "Current Settings:",IDC_STATIC,101,57,163,8,NOT WS_GROUP
|
||||
CONTROL 108,IDC_STATIC,"Static",SS_BITMAP,11,11,80,160,
|
||||
WS_EX_CLIENTEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,11,179,295,1,
|
||||
WS_EX_STATICEDGE
|
||||
END
|
||||
|
||||
DLG_BROWSE_DIR DIALOG DISCARDABLE 147, 23, 190, 143
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Select a directory"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDIT_DESTINATION,8,16,177,12,ES_AUTOHSCROLL |
|
||||
ES_OEMCONVERT | NOT WS_BORDER,WS_EX_CLIENTEDGE
|
||||
LISTBOX 1121,8,37,120,68,LBS_SORT | LBS_NOREDRAW |
|
||||
LBS_OWNERDRAWFIXED | LBS_HASSTRINGS |
|
||||
LBS_DISABLENOSCROLL | WS_VSCROLL | WS_HSCROLL |
|
||||
WS_TABSTOP
|
||||
COMBOBOX 1137,8,118,121,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
|
||||
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
DEFPUSHBUTTON "OK",1,135,43,50,14,WS_GROUP
|
||||
PUSHBUTTON "Cancel",IDCANCEL,135,63,50,14,WS_GROUP
|
||||
LTEXT "&Directories:",-1,8,6,92,9
|
||||
LTEXT "Dri&ves:",1091,8,108,92,9
|
||||
END
|
||||
|
||||
DLG_RESTART DIALOG FIXED IMPURE 133, 69, 226, 110
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Setup has finished copying files to your computer. Before you can use the program, you must restart Windows or your computer.\n\n Choose one of the following options and click OK to finish setup.",
|
||||
202,10,10,209,36,SS_NOPREFIX
|
||||
CONTROL "Yes, I want to restart my computer now.",IDC_RADIO_YES,
|
||||
"Button",BS_AUTORADIOBUTTON,26,52,191,12
|
||||
CONTROL "No, I will restart my computer later.",IDC_RADIO_NO,
|
||||
"Button",BS_AUTORADIOBUTTON,26,68,191,12
|
||||
DEFPUSHBUTTON "OK",IDOK,169,88,50,14,WS_GROUP
|
||||
END
|
||||
|
||||
DLG_MESSAGE DIALOG DISCARDABLE 0, 0, 236, 34
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CTEXT "",IDC_MESSAGE,0,0,236,34,SS_CENTERIMAGE
|
||||
END
|
||||
|
||||
DLG_EXTRACTING DIALOG DISCARDABLE 0, 0, 193, 73
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_GAUGE_FILE,"GaugeFile",0x0,9,52,175,11
|
||||
LTEXT "",IDC_STATUS0,9,9,175,8
|
||||
LTEXT "",IDC_STATUS3,9,40,175,8
|
||||
CONTROL "",IDC_GAUGE_ARCHIVE,"GaugeArchive",0x0,9,21,175,11
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_SETUP ICON DISCARDABLE "setup.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_BOX_UNCHECKED BITMAP FIXED IMPURE "box_unch.bmp"
|
||||
IDB_BOX_CHECKED BITMAP FIXED IMPURE "box_chec.bmp"
|
||||
IDB_BITMAP_WELCOME BITMAP DISCARDABLE "bitmap1.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
DLG_EXTRACTING, DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 72
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ERROR_DIALOG_CREATE "Could not create %s dialog."
|
||||
IDS_ERROR_FAILED "%s failed."
|
||||
IDS_ERROR_FILE_NOT_FOUND "File not found: %s"
|
||||
IDS_ERROR_GET_SYSTEM_DIRECTORY_FAILED "GetSystemDirectory() failed."
|
||||
IDS_ERROR_GET_WINDOWS_DIRECTORY_FAILED "GetWindowsDirectory() failed."
|
||||
IDS_DLGQUITTITLE "Question"
|
||||
IDS_DLGQUITMSG "Are you sure you want to cancel Setup?"
|
||||
IDS_DLG_REBOOT_TITLE "Restarting Windows"
|
||||
IDS_ERROR_GETPROCADDRESS "GetProcAddress() of %s failed."
|
||||
IDS_ERROR_WRITEPRIVATEPROFILESTRING
|
||||
"WritePrivateProfileString() failed for file %s"
|
||||
IDS_MSG_RETRIEVE_CONFIGINI
|
||||
"Please wait while Setup is attempting to retrieve Config.ini, required by Setup, from the Web..."
|
||||
IDS_ERROR_CREATE_TEMP_DIR
|
||||
"Setup was unable to create the TEMP directory: %s"
|
||||
IDS_DLGBROWSETITLE "Select a directory"
|
||||
IDS_ERROR_DETERMINING_DISK_SPACE
|
||||
"Could not determine available disk space for: %s"
|
||||
IDS_DLG_DISK_SPACE_CHECK_TITLE "Disk space check"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_DLG_DISK_SPACE_CHECK_CRUTIAL_MSG
|
||||
"Setup has detected insufficient disk space to continue with installation on %s for the path: %sRequired: %sAvailable: %sClick Retry if more disk space has been made available, or click Cancel to cancel Setup."
|
||||
IDS_DLG_DISK_SPACE_CHECK_MSG
|
||||
"Setup has detected insufficient disk space to continue with installation process on %s for the path: %sRequired: %sAvailable: %sClick OK to go back and choose a different destination path, or click Cancel to cancel Setup."
|
||||
IDS_ERROR_CREATE_DIRECTORY
|
||||
"Could not create folder: %sMake sure you have access to create the folder."
|
||||
IDS_STR_FILE_NUMBER "File count:"
|
||||
IDS_STR_FILENAME "Filename:"
|
||||
IDS_MSG_SMARTUPDATE_START "Preparing Install, please wait..."
|
||||
IDS_MSG_CONFIGURING "Configuring %s, please wait..."
|
||||
IDS_ERROR_XPI_INSTALL "Error ocurred during installation"
|
||||
IDS_ERROR_SETUP_REQUIREMENT
|
||||
"Windows95 or greater Operating System is required! Exiting setup..."
|
||||
IDS_DLG_EXTRACTING_TITLE "Install Progress"
|
||||
IDS_STR_PROCESSINGFILE "Preparing file: %s"
|
||||
IDS_STR_INSTALLING "Currently installing %s"
|
||||
IDS_STR_COPYINGFILE "Copying file: %s"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
68
mozilla/xpinstall/wizard/windows/test/makefile.win
Normal file
@@ -0,0 +1,68 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = EXE
|
||||
USE_NON_MT_LIBS = 1
|
||||
|
||||
MODULE = TestXPI
|
||||
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\testxpi.obj \
|
||||
.\$(OBJDIR)\xpi.obj \
|
||||
$(NULL)
|
||||
|
||||
LLFLAGS= \
|
||||
/machine:i386 \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\bin
|
||||
|
||||
if not exist test1\nul mkdir test1
|
||||
copy test1.txt test1
|
||||
copy test1.js test1\install.js
|
||||
cd test1
|
||||
zip test1.xpi *.*
|
||||
cd ..
|
||||
copy test1\test1.xpi $(DIST)\bin
|
||||
|
||||
if not exist test2\nul mkdir test2
|
||||
copy test2.txt test2
|
||||
copy test2.js test2\install.js
|
||||
cd test2
|
||||
zip test2.xpi *.*
|
||||
cd ..
|
||||
copy test2\test2.xpi $(DIST)\bin
|
||||
|
||||
|
||||
clobber_all::
|
||||
$(RM) $(DIST)\bin\$(MODULE).exe
|
||||
$(RM) $(DIST)\bin\test1.xpi
|
||||
$(RM) $(DIST)\bin\test2.xpi
|
||||
$(RM) -rf $(DIST)\bin\testxpi
|
||||
$(RM) -rf test1
|
||||
$(RM) -rf test2
|
||||
|
||||
36
mozilla/xpinstall/wizard/windows/test/test1.js
Normal file
@@ -0,0 +1,36 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// test1.js
|
||||
//
|
||||
// Acceptance test 1
|
||||
// Adds a component to the testxpi directory
|
||||
//
|
||||
// XPInstall test
|
||||
// Feb 8, 2000
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var regName = "testxpi test 1";
|
||||
var vi = "1.0.1.9"
|
||||
var jarSrc = "test1.txt";
|
||||
var err;
|
||||
|
||||
err = startInstall("Acceptance: test1", "install test file 1", vi, 0);
|
||||
logComment("startInstall() returned: " + err);
|
||||
|
||||
f = getFolder("Program", "testxpi");
|
||||
logComment("getFolder() returned: " + f);
|
||||
|
||||
err = addFile(regName, vi, jarSrc, f, jarSrc, true);
|
||||
logComment("addFile() returned: " + err);
|
||||
|
||||
|
||||
err = getLastError();
|
||||
if(0 == err)
|
||||
{
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
else
|
||||
{
|
||||
abortInstall(err);
|
||||
}
|
||||
1
mozilla/xpinstall/wizard/windows/test/test1.txt
Normal file
@@ -0,0 +1 @@
|
||||
Simple text file
|
||||
35
mozilla/xpinstall/wizard/windows/test/test2.js
Normal file
@@ -0,0 +1,35 @@
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// test2.js
|
||||
//
|
||||
// Acceptance test 2
|
||||
// Adds a component to the testxpi directory
|
||||
//
|
||||
// XPInstall test
|
||||
// Feb 8, 2000
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var regName = "testxpi test 2";
|
||||
var vi = "2.0.1.9"
|
||||
var jarSrc = "test2.txt";
|
||||
var err;
|
||||
|
||||
err = startInstall("Acceptance: test2", "install test file 2", vi, 0);
|
||||
logComment("startInstall() returned: " + err);
|
||||
|
||||
f = getFolder("Program", "testxpi");
|
||||
logComment("getFolder() returned: " + f);
|
||||
|
||||
err = addFile(regName, vi, jarSrc, f, jarSrc, true);
|
||||
logComment("addFile() returned: " + err);
|
||||
|
||||
err == getLastError();
|
||||
if(0 == err)
|
||||
{
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
else
|
||||
{
|
||||
abortInstall(err);
|
||||
}
|
||||
1
mozilla/xpinstall/wizard/windows/test/test2.txt
Normal file
@@ -0,0 +1 @@
|
||||
Simple text file
|
||||
391
mozilla/xpinstall/wizard/windows/test/testxpi.c
Normal file
@@ -0,0 +1,391 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include "testxpi.h"
|
||||
|
||||
//#define SSU_DEBUG
|
||||
|
||||
HANDLE hXPIStubInst;
|
||||
|
||||
/* Function to show the usage for this application */
|
||||
void ShowUsage(char *name)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
wsprintf(szBuf, "Usage: %s <output sea name> <files [file1] [file2]...>\n", name);
|
||||
lstrcat(szBuf, "\n");
|
||||
lstrcat(szBuf, " output sea name: name to use for the self-extracting executable\n");
|
||||
lstrcat(szBuf, " files: one or more files to add to the self-extracing executable\n");
|
||||
}
|
||||
|
||||
/* Function to print error message with/without error code */
|
||||
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH, int iExitCode)
|
||||
{
|
||||
DWORD dwErr;
|
||||
char szErrorString[MAX_BUF];
|
||||
|
||||
if(dwErrorCodeSH == ERROR_CODE_SHOW)
|
||||
{
|
||||
dwErr = GetLastError();
|
||||
wsprintf(szErrorString, "%d : %s", dwErr, szMsg);
|
||||
}
|
||||
else
|
||||
wsprintf(szErrorString, "%s", szMsg);
|
||||
|
||||
printf("%s\n", szErrorString);
|
||||
printf("exit code: %d\n", iExitCode);
|
||||
if(iExitCode == 0)
|
||||
printf("\n** Success! **\n");
|
||||
|
||||
DeInitializeXPIStub();
|
||||
exit(iExitCode);
|
||||
}
|
||||
|
||||
/* Function to remove quotes from a string */
|
||||
void RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int iDestSize)
|
||||
{
|
||||
char *lpszBegin;
|
||||
|
||||
if(lstrlen(lpszSrc) > iDestSize)
|
||||
return;
|
||||
|
||||
if(*lpszSrc == '\"')
|
||||
lpszBegin = &lpszSrc[1];
|
||||
else
|
||||
lpszBegin = lpszSrc;
|
||||
|
||||
lstrcpy(lpszDest, lpszBegin);
|
||||
|
||||
if(lpszDest[lstrlen(lpszDest) - 1] == '\"')
|
||||
lpszDest[lstrlen(lpszDest) - 1] = '\0';
|
||||
}
|
||||
|
||||
/* Function to remove the last backslash from a path string */
|
||||
void RemoveBackSlash(LPSTR szInput)
|
||||
{
|
||||
int iCounter;
|
||||
DWORD dwInputLen;
|
||||
|
||||
if(szInput != NULL)
|
||||
{
|
||||
dwInputLen = lstrlen(szInput);
|
||||
|
||||
for(iCounter = dwInputLen -1; iCounter >= 0 ; iCounter--)
|
||||
{
|
||||
if(szInput[iCounter] == '\\')
|
||||
szInput[iCounter] = '\0';
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to append a backslash to a path string */
|
||||
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize)
|
||||
{
|
||||
if(szInput != NULL)
|
||||
{
|
||||
if(szInput[strlen(szInput) - 1] != '\\')
|
||||
{
|
||||
if(((DWORD)lstrlen(szInput) + 1) < dwInputSize)
|
||||
{
|
||||
lstrcat(szInput, "\\");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to parse a path string for one of three parts of a path:
|
||||
* Filename only
|
||||
* Path only
|
||||
* drive only */
|
||||
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, DWORD dwType)
|
||||
{
|
||||
int iCounter;
|
||||
DWORD dwCounter;
|
||||
DWORD dwInputLen;
|
||||
BOOL bFound;
|
||||
|
||||
if((szInput != NULL) && (szOutput != NULL))
|
||||
{
|
||||
bFound = FALSE;
|
||||
dwInputLen = lstrlen(szInput);
|
||||
ZeroMemory(szOutput, dwOutputSize);
|
||||
|
||||
if(dwInputLen < dwOutputSize)
|
||||
{
|
||||
switch(dwType)
|
||||
{
|
||||
case PP_FILENAME_ONLY:
|
||||
for(iCounter = dwInputLen - 1; iCounter >= 0; iCounter--)
|
||||
{
|
||||
if(szInput[iCounter] == '\\')
|
||||
{
|
||||
lstrcpy(szOutput, &szInput[iCounter + 1]);
|
||||
bFound = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(bFound == FALSE)
|
||||
lstrcpy(szOutput, szInput);
|
||||
|
||||
break;
|
||||
|
||||
case PP_PATH_ONLY:
|
||||
for(iCounter = dwInputLen - 1; iCounter >= 0; iCounter--)
|
||||
{
|
||||
if(szInput[iCounter] == '\\')
|
||||
{
|
||||
lstrcpy(szOutput, szInput);
|
||||
szOutput[iCounter + 1] = '\0';
|
||||
bFound = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(bFound == FALSE)
|
||||
lstrcpy(szOutput, szInput);
|
||||
|
||||
break;
|
||||
|
||||
case PP_ROOT_ONLY:
|
||||
if(szInput[1] == ':')
|
||||
{
|
||||
szOutput[0] = szInput[0];
|
||||
szOutput[1] = szInput[1];
|
||||
AppendBackSlash(szOutput, dwOutputSize);
|
||||
}
|
||||
else if(szInput[1] == '\\')
|
||||
{
|
||||
int iFoundBackSlash = 0;
|
||||
for(dwCounter = 0; dwCounter < dwInputLen; dwCounter++)
|
||||
{
|
||||
if(szInput[dwCounter] == '\\')
|
||||
{
|
||||
szOutput[dwCounter] = szInput[dwCounter];
|
||||
++iFoundBackSlash;
|
||||
}
|
||||
|
||||
if(iFoundBackSlash == 3)
|
||||
break;
|
||||
}
|
||||
|
||||
if(iFoundBackSlash != 0)
|
||||
AppendBackSlash(szOutput, dwOutputSize);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to check to see if a file exists.
|
||||
* If it does, return it's attributes */
|
||||
long FileExists(LPSTR szFile)
|
||||
{
|
||||
DWORD rv;
|
||||
|
||||
if((rv = GetFileAttributes(szFile)) == -1)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(rv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to locate the first non space character in a string,
|
||||
* and return a pointer to it. */
|
||||
LPSTR GetFirstNonSpace(LPSTR lpszString)
|
||||
{
|
||||
int i;
|
||||
int iStrLength;
|
||||
|
||||
iStrLength = lstrlen(lpszString);
|
||||
|
||||
for(i = 0; i < iStrLength; i++)
|
||||
{
|
||||
if(!isspace(lpszString[i]))
|
||||
return(&lpszString[i]);
|
||||
}
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Function to return the argument count given a command line input
|
||||
* format string */
|
||||
int GetArgC(LPSTR lpszCommandLine)
|
||||
{
|
||||
int i;
|
||||
int iArgCount;
|
||||
int iStrLength;
|
||||
LPSTR lpszBeginStr;
|
||||
BOOL bFoundQuote;
|
||||
BOOL bFoundSpace;
|
||||
|
||||
iArgCount = 0;
|
||||
lpszBeginStr = GetFirstNonSpace(lpszCommandLine);
|
||||
|
||||
if(lpszBeginStr == NULL)
|
||||
return(iArgCount);
|
||||
|
||||
iStrLength = lstrlen(lpszBeginStr);
|
||||
bFoundQuote = FALSE;
|
||||
bFoundSpace = TRUE;
|
||||
|
||||
for(i = 0; i < iStrLength; i++)
|
||||
{
|
||||
if(lpszCommandLine[i] == '\"')
|
||||
{
|
||||
if(bFoundQuote == FALSE)
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundQuote = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bFoundQuote = FALSE;
|
||||
}
|
||||
}
|
||||
else if(bFoundQuote == FALSE)
|
||||
{
|
||||
if(!isspace(lpszCommandLine[i]) && (bFoundSpace == TRUE))
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundSpace = FALSE;
|
||||
}
|
||||
else if(isspace(lpszCommandLine[i]))
|
||||
{
|
||||
bFoundSpace = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(iArgCount);
|
||||
}
|
||||
|
||||
/* Function to return a specific argument parameter from a given command line input
|
||||
* format string. */
|
||||
LPSTR GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int iArgCount;
|
||||
int iStrLength;
|
||||
LPSTR lpszBeginStr;
|
||||
LPSTR lpszDestTemp;
|
||||
BOOL bFoundQuote;
|
||||
BOOL bFoundSpace;
|
||||
|
||||
iArgCount = 0;
|
||||
lpszBeginStr = GetFirstNonSpace(lpszCommandLine);
|
||||
|
||||
if(lpszBeginStr == NULL)
|
||||
return(NULL);
|
||||
|
||||
lpszDestTemp = (char *)calloc(iDestSize, sizeof(char));
|
||||
if(lpszDestTemp == NULL)
|
||||
PrintError("Out of memory", ERROR_CODE_HIDE, 1);
|
||||
|
||||
ZeroMemory(lpszDest, iDestSize);
|
||||
iStrLength = lstrlen(lpszBeginStr);
|
||||
bFoundQuote = FALSE;
|
||||
bFoundSpace = TRUE;
|
||||
j = 0;
|
||||
|
||||
for(i = 0; i < iStrLength; i++)
|
||||
{
|
||||
if(lpszCommandLine[i] == '\"')
|
||||
{
|
||||
if(bFoundQuote == FALSE)
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundQuote = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bFoundQuote = FALSE;
|
||||
}
|
||||
}
|
||||
else if(bFoundQuote == FALSE)
|
||||
{
|
||||
if(!isspace(lpszCommandLine[i]) && (bFoundSpace == TRUE))
|
||||
{
|
||||
++iArgCount;
|
||||
bFoundSpace = FALSE;
|
||||
}
|
||||
else if(isspace(lpszCommandLine[i]))
|
||||
{
|
||||
bFoundSpace = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if((iIndex == (iArgCount - 1)) &&
|
||||
((bFoundQuote == TRUE) || (bFoundSpace == FALSE) ||
|
||||
((bFoundQuote == FALSE) && (lpszCommandLine[i] == '\"'))))
|
||||
{
|
||||
if(j < iDestSize)
|
||||
{
|
||||
lpszDestTemp[j] = lpszCommandLine[i];
|
||||
++j;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpszDestTemp[j] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RemoveQuotes(lpszDestTemp, lpszDest, iDestSize);
|
||||
free(lpszDestTemp);
|
||||
return(lpszDest);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
HRESULT hrResult;
|
||||
char szBuf[MAX_BUF];
|
||||
char szAppName[MAX_BUF];
|
||||
char szAppPath[MAX_BUF];
|
||||
char *listArchive[] = {"test1.xpi",
|
||||
"test2.xpi",
|
||||
"\0"};
|
||||
|
||||
if(GetModuleFileName(NULL, szBuf, sizeof(szBuf)) == 0L)
|
||||
PrintError("GetModuleFileName() failed", ERROR_CODE_SHOW, 1);
|
||||
|
||||
ParsePath(szBuf, szAppPath, sizeof(szAppPath), PP_PATH_ONLY);
|
||||
ParsePath(szBuf, szAppName, sizeof(szAppName), PP_FILENAME_ONLY);
|
||||
|
||||
hrResult = SmartUpdateJars(szAppName, szAppPath, listArchive);
|
||||
|
||||
if(hrResult == 999)
|
||||
wsprintf(szBuf, "%s done\nReboot required\n", szAppName);
|
||||
else
|
||||
wsprintf(szBuf, "%s done\n", szAppName);
|
||||
|
||||
PrintError(szBuf, ERROR_CODE_SHOW, hrResult);
|
||||
return(0);
|
||||
}
|
||||
|
||||
71
mozilla/xpinstall/wizard/windows/test/testxpi.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _TESTXPI_H_
|
||||
#define _TESTXPI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define PR_BEGIN_EXTERN_C extern "C" {
|
||||
#define PR_END_EXTERN_C }
|
||||
#else
|
||||
#define PR_BEGIN_EXTERN_C
|
||||
#define PR_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
typedef unsigned int PRUint32;
|
||||
typedef int PRInt32;
|
||||
|
||||
#define PR_EXTERN(type) type
|
||||
|
||||
#include "windows.h"
|
||||
#include "xpi.h"
|
||||
#include "..\\setup\\xpistub.h"
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define MAX_BUF 4096
|
||||
|
||||
#define ERROR_CODE_HIDE 0
|
||||
#define ERROR_CODE_SHOW 1
|
||||
|
||||
/* PP: Parse Path */
|
||||
#define PP_FILENAME_ONLY 1
|
||||
#define PP_PATH_ONLY 2
|
||||
#define PP_ROOT_ONLY 3
|
||||
|
||||
#define TEST_OK 0
|
||||
|
||||
void PrintError(LPSTR szMsg, DWORD dwErrorCodeSH, int iExitCode);
|
||||
void RemoveQuotes(LPSTR lpszSrc, LPSTR lpszDest, int dwDestSize);
|
||||
void RemoveBackSlash(LPSTR szInput);
|
||||
void AppendBackSlash(LPSTR szInput, DWORD dwInputSize);
|
||||
void ParsePath(LPSTR szInput, LPSTR szOutput, DWORD dwOutputSize, DWORD dwType);
|
||||
long FileExists(LPSTR szFile);
|
||||
int GetArgC(LPSTR lpszCommandLine);
|
||||
LPSTR GetArgV(LPSTR lpszCommandLine, int iIndex, LPSTR lpszDest, int iDestSize);
|
||||
|
||||
#endif
|
||||
|
||||
182
mozilla/xpinstall/wizard/windows/test/xpi.c
Normal file
@@ -0,0 +1,182 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include "testxpi.h"
|
||||
|
||||
typedef HRESULT (_cdecl *XpiInit)(const char *, pfnXPIProgress);
|
||||
typedef HRESULT (_cdecl *XpiInstall)(const char *, const char *, long);
|
||||
typedef void (_cdecl *XpiExit)(void);
|
||||
|
||||
static XpiInit pfnXpiInit;
|
||||
static XpiInstall pfnXpiInstall;
|
||||
static XpiExit pfnXpiExit;
|
||||
|
||||
extern HANDLE hXPIStubInst;
|
||||
|
||||
HRESULT InitializeXPIStub()
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szXPIStubFile[MAX_BUF];
|
||||
|
||||
hXPIStubInst = NULL;
|
||||
|
||||
/* get full path to xpistub.dll */
|
||||
if(GetFullPathName("xpistub.dll", sizeof(szXPIStubFile), szXPIStubFile, NULL) == FALSE)
|
||||
PrintError("File not found: xpistub.dll", ERROR_CODE_SHOW, 2);
|
||||
|
||||
/* load xpistub.dll */
|
||||
if((hXPIStubInst = LoadLibraryEx(szXPIStubFile, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, "Error loading library: %s\n", szXPIStubFile);
|
||||
PrintError(szBuf, ERROR_CODE_SHOW, 1);
|
||||
}
|
||||
if(((FARPROC)pfnXpiInit = GetProcAddress(hXPIStubInst, "XPI_Init")) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, "GetProcAddress() failed: XPI_Init\n");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW, 1);
|
||||
}
|
||||
if(((FARPROC)pfnXpiInstall = GetProcAddress(hXPIStubInst, "XPI_Install")) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, "GetProcAddress() failed: XPI_Install\n");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW, 1);
|
||||
}
|
||||
if(((FARPROC)pfnXpiExit = GetProcAddress(hXPIStubInst, "XPI_Exit")) == NULL)
|
||||
{
|
||||
wsprintf(szBuf, "GetProcAddress() failed: XPI_Exit\n");
|
||||
PrintError(szBuf, ERROR_CODE_SHOW, 1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
HRESULT DeInitializeXPIStub()
|
||||
{
|
||||
pfnXpiInit = NULL;
|
||||
pfnXpiInstall = NULL;
|
||||
pfnXpiExit = NULL;
|
||||
|
||||
if(hXPIStubInst)
|
||||
FreeLibrary(hXPIStubInst);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int GetTotalArchivesToInstall(LPSTR listArchive[])
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while(TRUE)
|
||||
{
|
||||
if(*listArchive[i] != '\0')
|
||||
++i;
|
||||
else
|
||||
return(i);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT SmartUpdateJars(LPSTR szAppName, LPSTR szAppPath, LPSTR listArchive[])
|
||||
{
|
||||
int i;
|
||||
int iTotalArchives;
|
||||
char szBuf[MAX_BUF];
|
||||
HRESULT hrResult;
|
||||
|
||||
hXPIStubInst = NULL;
|
||||
|
||||
if((hrResult = InitializeXPIStub()) == TEST_OK)
|
||||
{
|
||||
RemoveBackSlash(szAppPath);
|
||||
hrResult = pfnXpiInit(szAppPath, cbXPIProgress);
|
||||
if(hrResult != 0)
|
||||
{
|
||||
wsprintf(szBuf, "XpiInit() failed: %d", hrResult);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE, hrResult);
|
||||
}
|
||||
|
||||
iTotalArchives = GetTotalArchivesToInstall(listArchive);
|
||||
for(i = 0; i < iTotalArchives; i++)
|
||||
{
|
||||
if(FileExists(listArchive[i]) == FALSE)
|
||||
{
|
||||
printf("File not found: %s\n", listArchive[i]);
|
||||
|
||||
/* continue with next file */
|
||||
continue;
|
||||
}
|
||||
|
||||
hrResult = pfnXpiInstall(listArchive[i], "", 0xFFFF);
|
||||
if((hrResult != TEST_OK) && (hrResult != 999))
|
||||
{
|
||||
wsprintf(szBuf, "XpiInstall() failed: %d", hrResult);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE, hrResult);
|
||||
|
||||
/* break out of the for loop */
|
||||
break;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
pfnXpiExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
wsprintf(szBuf, "InitializeXPIStub() failed: %d", hrResult);
|
||||
PrintError(szBuf, ERROR_CODE_HIDE, hrResult);
|
||||
}
|
||||
|
||||
DeInitializeXPIStub();
|
||||
return(hrResult);
|
||||
}
|
||||
|
||||
void cbXPIStart(const char *URL, const char *UIName)
|
||||
{
|
||||
}
|
||||
|
||||
void cbXPIProgress(const char* msg, PRInt32 val, PRInt32 max)
|
||||
{
|
||||
char szFilename[MAX_BUF];
|
||||
|
||||
ParsePath((char *)msg, szFilename, sizeof(szFilename), PP_FILENAME_ONLY);
|
||||
if(max == 0)
|
||||
printf("Processing: %s\n", szFilename);
|
||||
else
|
||||
printf("Installing: %d/%d %s\n", val, max, szFilename);
|
||||
|
||||
ProcessWindowsMessages();
|
||||
}
|
||||
|
||||
void cbXPIFinal(const char *URL, PRInt32 finalStatus)
|
||||
{
|
||||
}
|
||||
|
||||
void ProcessWindowsMessages()
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
40
mozilla/xpinstall/wizard/windows/test/xpi.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef _XPI_H_
|
||||
#define _XPI_H_
|
||||
|
||||
HRESULT InitializeXPIStub(void);
|
||||
HRESULT DeInitializeXPIStub(void);
|
||||
HRESULT SmartUpdateJars(LPSTR szAppName, LPSTR szAppPath, LPSTR listArchive[]);
|
||||
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);
|
||||
int GetTotalArchivesToInstall(LPSTR listArchive[]);
|
||||
void ProcessWindowsMessages();
|
||||
|
||||
#endif /* _XPI_H_ */
|
||||
|
||||