diff --git a/xpinstall/packager/stage_mfcembed.pl b/xpinstall/packager/stage_mfcembed.pl index 0a8e795d2e8..3d899fd1b8e 100644 --- a/xpinstall/packager/stage_mfcembed.pl +++ b/xpinstall/packager/stage_mfcembed.pl @@ -49,18 +49,21 @@ sub StageProduct StageUtils::CleanupStage($aDirStage, $aProductName); StageUtils::CleanupDistPackages("$aDirSrcDist/packages", $aProductName); - StageUtils::CopyAdditionalPackage("$dirMozPackager/pkgs-mfcembed-win", $dirDistPackagesProductName); - StageUtils::CopyAdditionalPackage("$dirMozPackager/pkgs-mfcembed-win-supp", $dirDistPackagesProductName); + StageUtils::CopyAdditionalPackage("$dirMozPackager/xpcom-win.pkg", $dirDistPackagesProductName); + StageUtils::CopyAdditionalPackage("$dirMozPackager/pkgs-mfcembed-win", $dirDistPackagesProductName); + StageUtils::CopyAdditionalPackage("$dirMozPackager/pkgs-mfcembed-win-supp", $dirDistPackagesProductName); StageUtils::CopyAdditionalPackage("$dirMozRoot/embedding/config/basebrowser-win-supp", $dirDistPackagesProductName); StageUtils::CopyAdditionalPackage("$dirMozRoot/embedding/config/gre-win-supp", $dirDistPackagesProductName); - mkdir("$aDirStage", 775) if (!(-e "$aDirStage")); - mkdir("$aDirStage/$aProductName", 775) if (!(-e "$aDirStage/$aProductName")); + mkdir("$aDirStage", 775) if (!(-e "$aDirStage")); + mkdir("$aDirStage/$aProductName", 775) if (!(-e "$aDirStage/$aProductName")); + mkdir("$aDirStage/$aProductName/mfcembed", 775) if (!(-e "$aDirStage/$aProductName/mfcembed")); # Call pkgcp.pl on each of the package list - system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/bin\" -d \"$dirStageProductName\" -f \"$dirDistPackagesProductName/pkgs-mfcembed-win\" -o $aOsPkg -v"); - system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/gre_app_support\" -d \"$dirStageProductName\" -f \"$dirDistPackagesProductName/pkgs-mfcembed-win-supp\" -o $aOsPkg -v"); - system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/bin\" -d \"$dirStageProductName\" -f \"$dirDistPackagesProductName/basebrowser-win-supp\" -o $aOsPkg -v"); - system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/bin\" -d \"$dirStageProductName\" -f \"$dirDistPackagesProductName/gre-win-supp\" -o $aOsPkg -v"); + system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist\" -d \"$dirStageProductName\" -f \"$dirDistPackagesProductName/xpcom-win.pkg\" -o $aOsPkg -v"); + system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/bin\" -d \"$dirStageProductName/mfcembed\" -f \"$dirDistPackagesProductName/pkgs-mfcembed-win\" -o $aOsPkg -v"); + system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/gre_app_support\" -d \"$dirStageProductName/mfcembed\" -f \"$dirDistPackagesProductName/pkgs-mfcembed-win-supp\" -o $aOsPkg -v"); + system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/bin\" -d \"$dirStageProductName/mfcembed\" -f \"$dirDistPackagesProductName/basebrowser-win-supp\" -o $aOsPkg -v"); + system("perl \"$dirMozPackager/pkgcp.pl\" -s \"$aDirSrcDist/bin\" -d \"$dirStageProductName/mfcembed\" -f \"$dirDistPackagesProductName/gre-win-supp\" -o $aOsPkg -v"); } diff --git a/xpinstall/packager/stage_mozilla.pl b/xpinstall/packager/stage_mozilla.pl index 3815456bb0d..12f0cb3e066 100644 --- a/xpinstall/packager/stage_mozilla.pl +++ b/xpinstall/packager/stage_mozilla.pl @@ -53,10 +53,6 @@ sub StageProduct StageUtils::CopyAdditionalPackage("$dirMozPackager/packages-win", $dirDistPackagesProductName); # StageUtils::GeneratePackagesFromSinglePackage($inOs, "$dirMozPackager/packages-win", $dirDistPackagesProductName); - # Not needed right now since it only copies xpcom-win.pkg. - # This pkg file should be part of the GRE build. - #StageUtils::CopyAdditionalPackage("$dirMozPackager/xpcom-win.pkg", $dirDistPackagesProductName); - # Call CreateStage() to create the aProductName stage dir using the packages # in dist/packages. StageUtils::CreateStage($aDirSrcDist, $dirStageProductName, $dirDistPackagesProductName, $aOsPkg); diff --git a/xpinstall/packager/win_mfcembed/config.it b/xpinstall/packager/win_mfcembed/config.it index 17bbf8de167..f3889a5adb2 100644 --- a/xpinstall/packager/win_mfcembed/config.it +++ b/xpinstall/packager/win_mfcembed/config.it @@ -94,6 +94,33 @@ Default Setup Type=Setup Type 0 ; TRUE Refresh Icons=FALSE +; Setting to control whether or not GRE should be installed to app's dir +; to be used as a private/local GRE. +; +; Possible values (default is 'Shared'): +; Local +; Shared +; +; If this key is set to 'Local', make +; sure to provide a GRE Private Key= below! +GRE Type=Shared + +; Private key that overrides the default shared key +; (HKEY_LOCAL_MACHINE\Software\mozilla.org\GRE) set by GRE's installer. +; This key will be created under HKEY_LOCAL_MACHINE and should be +; declared in the following format: +; +; Software\[company name]\[product name] +; (ie: Software\mozilla.org\GRE_PRIVATE) +; +; If it is not in the above format, the GRE installer/uninstaller can +; fail to work properly. +; The value to Prodduct Name Internal= (at the beginning of this +; config.ini file) will be appended as follows: +; +; Software\mozilla.org\GRE_PRIVATE_[Product Name Internal] +GRE Private Key=Software\mozilla.org\GRE_PRIVATE + ; This section contains info on how to send error information in case of ; either a download or xpinstall error. ; By default, this feature is enabled, unless disabled. @@ -174,8 +201,10 @@ Readme App=notepad.exe ; 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=Component MFCEmbed -C1=Component Uninstaller +C0=Component XPCOM +C1=Component GRE +C2=Component MFCEmbed +C3=Component Uninstaller [Dialog Select Components] Show Dialog=FALSE @@ -386,16 +415,33 @@ Close All Process Windows=TRUE ; will be superseded. ; -;[Component XPCOM] -;Description Short=Mozilla XPCOM -;;*** LOCALIZE ME BABY *** -;Description Long=Install Engine -;Archive=xpcom.xpi -;$InstallSize$:xpcom -;$InstallSizeSystem$ -;$InstallSizeArchive$:xpcom.xpi -;Attributes=SELECTED|INVISIBLE|FORCE_UPGRADE -;Force Upgrade File0=[SETUP PATH]\xpcom.dll +[Component XPCOM] +Description Short=Mozilla XPCOM +;*** LOCALIZE ME BABY *** +Description Long=Install Engine +Archive=xpcom.xpi +$InstallSize$:xpcom +$InstallSizeSystem$ +$InstallSizeArchive$:xpcom.xpi +Attributes=SELECTED|INVISIBLE|DOWNLOAD_ONLY + +[Component GRE] +;*** LOCALIZE ME BABY *** +Description Short=GRE +;*** LOCALIZE ME BABY *** +Description Long=Gecko Runtime Environment +Archive=gre-win32-installer.zip +Archive Uncompressed=gre-win32-installer.exe +$InstallSize$:gre +$InstallSizeSystem$ +$InstallSizeArchive$:gre-win32-installer.zip +Attributes=SELECTED|UNCOMPRESS|SUPERSEDE|LAUNCHAPP|INVISIBLE +Parameter=-mmi -ma -app $ProductName$ -app_path "[SETUP PATH]\$MainExeFile$" +SupersedeType=GRE +SupersedeWinReg0=HKEY_LOCAL_MACHINE\Software\mozilla.org\GRE +SupersedeVersion0=1.3.0.0 +SupersedeMinVersion=1.3.0.0 +SupersedeMaxVersion=1.3.0.0 [Component MFCEmbed] Description Short=MFCEmbed @@ -430,6 +476,11 @@ $InstallSize$:xpcom Cleanup=TRUE ;*** LOCALIZE ME BABY *** Message=Preparing Install, please wait... +; Status= values: Disabled, Enabled +; If nothing is set, default value is Enabled. If set to Disabled, +; it will then use GRE as the xpinstall engine, in which case, there +; should be a GRE component in this installer package! +Status=Enabled [Redirect] Status=Disabled @@ -673,9 +724,3 @@ Description1=North America ;*** LOCALIZE ME BABY *** Domain1=$ArchiveUrl$ -;RunApp section -[RunApp0] -Timing=pre launchapp -Wait=TRUE -Target=gre-win32-installer.exe -Parameters=-mmi -ma -app mfcembed -app_path "[SETUP PATH]"\mfcembed.exe diff --git a/xpinstall/packager/win_mfcembed/makeall.pl b/xpinstall/packager/win_mfcembed/makeall.pl index a9855170e40..362b148b128 100644 --- a/xpinstall/packager/win_mfcembed/makeall.pl +++ b/xpinstall/packager/win_mfcembed/makeall.pl @@ -75,7 +75,27 @@ ParseArgv(@ARGV); $gDirPackager = "$topsrcdir/xpinstall/packager"; $gDirDistInstall = "$inDistPath/inst_mfcembed"; -$gDirStageProduct = "$inStagePath"; +$gDirDistInstGre = "$inDistPath/inst_gre"; +$gDirStageProduct = "$inStagePath/mfcembed"; +$seiFileNameGeneric = "nsinstall.exe"; +$seiFileNameSpecific = "mfcembed-win32-installer.exe"; +$seiStubRootName = "mfcembed-win32-stub-installer"; +$seiFileNameSpecificStub = "$seiStubRootName.exe"; +$seuFileNameSpecific = "MfcEmbedUninstall.exe"; +$seuzFileNameSpecific = "mfcembeduninstall.zip"; +$seiGreFileNameSpecific = "gre-win32-installer.exe"; +$seizGreFileNameSpecific = "gre-win32-installer.zip"; + +# set environment vars for use by other .pl scripts called from this script. +if($versionParts[2] eq "0") +{ + $versionMain = "$versionParts[0]\.$versionParts[1]"; +} +else +{ + $versionMain = "$versionParts[0]\.$versionParts[1]\.$versionParts[2]"; +} +print "The display version is: $versionMain\n"; # Build GRE installer package first before building Mozilla! GRE installer is required by the mozilla installer. @@ -91,30 +111,21 @@ if(system("perl \"$gDirPackager/make_stage.pl\" -pn mfcembed -os win -sd \"$inSt die "\n Error: perl \"$gDirPackager/make_stage.pl\" -pn mfcembed -os win -sd \"$inStagePath\" -dd \"$inDistPath\"\n"; } +# Copy the GRE installer to the Ns' stage area +if(!(-e "$gDirDistInstGre/$seiGreFileNameSpecific")) +{ + die "\"$gDirDistInstGre/$seiGreFileNameSpecific\": file missing\n"; +} +mkdir "$gDirStageProduct/gre"; +copy("$gDirDistInstGre/$seiGreFileNameSpecific", "$gDirStageProduct/gre") || + die "copy(\"$gDirDistInstGre/$seiGreFileNameSpecific\", \"$gDirStageProduct/gre\"): $!\n"; + # Until we really figure out what to do with this batch file, this will get it # into the installer, at least print "\n Copying runapp.bat $gDirStageProduct/mfcembed/gre_app_support\n"; copy("runapp.bat", "$gDirStageProduct/mfcembed/gre_app_support") || die "copy runapp.bat $gDirStageProduct/mfcembed/gre_app_support: $!\n"; - -$seiFileNameGeneric = "nsinstall.exe"; -$seiFileNameSpecific = "mfcembed-win32-installer.exe"; -$seiStubRootName = "mfcembed-win32-stub-installer"; -$seiFileNameSpecificStub = "$seiStubRootName.exe"; -$seuFileNameSpecific = "MfcEmbedUninstall.exe"; -$seuzFileNameSpecific = "mfcembeduninstall.zip"; - -# set environment vars for use by other .pl scripts called from this script. -if($versionParts[2] eq "0") -{ - $versionMain = "$versionParts[0]\.$versionParts[1]"; -} -else -{ - $versionMain = "$versionParts[0]\.$versionParts[1]\.$versionParts[2]"; -} -print "The display version is: $versionMain\n"; $ENV{WIZ_nameCompany} = "mozilla.org"; $ENV{WIZ_nameProduct} = "MfcEmbed"; $ENV{WIZ_nameProductInternal} = "MfcEmbed"; # product name without any version string @@ -140,7 +151,8 @@ if(!(-d "$gDirStageProduct")) } # List of components for to create xpi files from -@gComponentList = ("mfcembed"); +@gComponentList = ("xpcom", + "mfcembed"); if(VerifyComponents()) # return value of 0 means no errors encountered { @@ -180,19 +192,17 @@ else mkdir ("$gDirDistInstall/setup",0775); } +if(!(-e "$inDistPath/inst_gre/$seiGreFileNameSpecific")) +{ + die "\"$inDistPath/inst_gre/$seiGreFileNameSpecific\": file missing\n"; +} +MakeExeZip("$inDistPath/inst_gre", $seiGreFileNameSpecific, $seizGreFileNameSpecific); if(MakeXpiFile()) { exit(1); } -# Grab xpcom from mozilla build -copy("$gDirDistInstall/../install/xpi/xpcom.xpi", "$gDirDistInstall") || - die "copy $gDirDistInstall/../install/xpi/xpcom.xpi $gDirDistInstall: $!\n"; -copy("$gDirDistInstall/../install/xpi/xpcom.xpi", "$gDirDistInstall/xpi") || - die "copy $gDirDistInstall/../install/xpi/xpcom.xpi $gDirDistInstall/xpi: $!\n"; - - if(MakeUninstall()) { exit(1); diff --git a/xpinstall/packager/win_mfcembed/mfcembed.jst b/xpinstall/packager/win_mfcembed/mfcembed.jst index 4aaff558e76..e69de29bb2d 100644 --- a/xpinstall/packager/win_mfcembed/mfcembed.jst +++ b/xpinstall/packager/win_mfcembed/mfcembed.jst @@ -1,178 +0,0 @@ -function IsWinnt() -{ - /* Determines if the script is running under NT or not. - * - */ - var winreg = getWinRegistry(); - var subkey; - var valname; - var szCurrentVersion; - - winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE); - subkey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"; - valname = "CurrentVersion"; - szCurrentVersion = winreg.getValueString(subkey, valname); - logComment("szCurrentVersion: " + szCurrentVersion); - if((szCurrentVersion == "") || (szCurrentVersion == null)) - { - return false; - } - else - { - return true; - } -} - -function registerKeys() -{ - var subkey; //the name of the subkey you are poking around in - var err; - var winreg; - var tmpstr; - - winreg = getWinRegistry(); - winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE); - - createRootRegKey(winreg); - registerMainKeys(winreg); - registerMozillaKeys(winreg); -} - -function createRootRegKey(winreg) -{ - var subkey; - var tmpstr; - var tmpstr2; - var index; - - tmpstr = new String(regRootKey); - index = tmpstr.indexOf("\\"); - subkey = ""; - - while(index > 0) - { - subkey = subkey + tmpstr.substring(0, index); - winreg.createKey(subkey,""); - - tmpstr2 = tmpstr.substring(index+1, tmpstr.length); - tmpstr = new String(tmpstr2); - - index = tmpstr.indexOf("\\"); - subkey = subkey + "\\"; - } - - if(tmpstr.length > 0) - { - subkey = subkey + tmpstr; - logComment("subkey: " + subkey); - winreg.createKey(subkey,""); - } - - winreg.createKey(subkey + "\\$UserAgent$",""); -} - -function registerMainKeys(winreg) -{ - var subkey; //the name of the subkey you are poking around in - var err; - - err = winreg.setValueString(regRootKey, "CurrentVersion", "$UserAgent$"); - - winreg.createKey(regRootKey + "\\$UserAgent$", ""); - - subkey = regRootKey + "\\$UserAgent$\\Main"; - winreg.createKey(subkey,""); - err = winreg.setValueString(subkey, "Install Directory", fProgram); - - subkey = regRootKey + "\\$UserAgent$\\Uninstall"; - winreg.createKey(subkey,""); - err = winreg.setValueString(subkey, "Uninstall Log Folder", fProgram + "Uninstall"); - err = winreg.setValueString(subkey, "Description", "$ProductName$ ($UserAgentShort$)"); -} - -function registerMozillaKeys(winreg) -{ - var regKey; - var subkey; //the name of the subkey you are poking around in - var err; - - regKey = "Software\\Mozilla"; - winreg.createKey(regKey, ""); - winreg.createKey(regKey + "\\MfcEmbed $UserAgent$", ""); - - subkey = regKey + "\\MfcEmbed $UserAgent$\\bin"; - winreg.createKey(subkey, ""); - err = winreg.setValueString(subkey, "PathToExe", fProgram + "$MainExeFile$"); - - subkey = regKey + "\\MfcEmbed $UserAgent$\\Extensions"; - winreg.createKey(subkey, ""); - err = winreg.setValueString(subkey, "Components", fProgram + "\\Components"); - err = winreg.setValueString(subkey, "Plugins", fProgram + "\\Plugins"); -} - -// main -var srDest; -var err; -var err2; -var fProgram; -var fSubdir; -var fWindowsSystem; -var fileComponentRegStr; -var fileComponentReg; -var restrictedAccess; -var fileToRegister; -var regRootKey; - -regRootKey = new String("Software\\$CompanyName$\\MFCEmbed"); - -srDest = $SpaceRequired$:bin; -err = initInstall("$ProductName$", "MFCEmbed", "$Version$"); -logComment("initInstall: " + err); - -fProgram = getFolder("Program"); -logComment("fProgram: " + fProgram); - -if(verifyDiskSpace(fProgram, srDest)) -{ - setPackageFolder(fProgram); - - err = addDirectory("", - "", - "gre_app_support", // dir name in jar to extract - fProgram, // Where to put this file (Returned from GetFolder) - "", // subdir name to create relative to fProgram - true); // Force Flag - logComment("addDirectory() of Program returned: " + err); - - err = addDirectory("", - "", - "Embed", // dir name in jar to extract - fProgram, // Where to put this file (Returned from GetFolder) - "", // subdir name to create relative to fProgram - true); // Force Flag - logComment("addDirectory() of Program returned: " + err); - - fSubdir = getFolder("Program", "plugins"); - File.dirCreate(fSubdir); - - fSubdir = getFolder("Program", "components"); - File.dirCreate(fSubdir); - - // check return value - if( err == SUCCESS ) - { - registerKeys(); -// // we don't want to fail on errors for the above -// resetError(); - - err = performInstall(); - logComment("performInstall() returned: " + err); - } - else - cancelInstall(err); -} -else - cancelInstall(INSUFFICIENT_DISK_SPACE); - - -// end main diff --git a/xpinstall/packager/win_mfcembed/runapp.bat b/xpinstall/packager/win_mfcembed/runapp.bat index ae161975f98..e69de29bb2d 100755 --- a/xpinstall/packager/win_mfcembed/runapp.bat +++ b/xpinstall/packager/win_mfcembed/runapp.bat @@ -1,10 +0,0 @@ -@echo OFF -REM -------------------------------------------------------- -REM Modify GRE_DIR below to match your GRE install location -REM -------------------------------------------------------- -set GRE_VERSION=1.3a -set GRE_DIR=c:\Program Files\mozilla.org\GRE\%GRE_VERSION% - -set PATH=%PATH%;%GRE_DIR%;%GRE_DIR%\components -mfcembed.exe -console - diff --git a/xpinstall/wizard/windows/setup/extra.c b/xpinstall/wizard/windows/setup/extra.c index 76e8676427c..6af74bcb9fb 100644 --- a/xpinstall/wizard/windows/setup/extra.c +++ b/xpinstall/wizard/windows/setup/extra.c @@ -2306,6 +2306,10 @@ HRESULT LaunchApps() HRESULT ProcessGre(greInfo *aGre) { char greUninstallCommand[MAX_BUF]; + + if(!aGre) + return(WIZ_OK); + /* If aGre->homePath does not exist, it means that a compatible version of GRE was * not found on the system, so we need to install one. We also need to get the * path to where it's going to install the GRE for in case we need to use it @@ -2327,7 +2331,8 @@ HRESULT ProcessGre(greInfo *aGre) * in the config.ini file. */ /* Unset "Component GRE"'s SELECTED attribute so it doesn't get spawned again later from LaunchApps() */ - aGre->siCGreComponent->dwAttributes &= ~SIC_SELECTED; + if(aGre->siCGreComponent) + aGre->siCGreComponent->dwAttributes &= ~SIC_SELECTED; /* Log the GRE uninstall command to call in order for this app's uninstaller to * uninstall GRE.