Re: Adding a dll
Jonathan Watt <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpinstall |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Daniel Veditz wrote:
> Start over... always helps to get all the requirements up front :-)
>
> To put it into the browser directory you need to get the file into browser.xpi.
>
> back to the makexpi.pl script -- instead of adding to the xpcom block you'll
> need a new chunk
>
> if($inComponentName =~ /browser/i)
> {
> # copy gdiplus.dll to browser dir
> ... code from before...
> }
>
> Then add the conditional install code to the browser.jst script template
> instead of xpcom.jst
Right, so if I understood what you mean then:
For Firefox I change
http://lxr.mozilla.org/mozilla/source/toolkit/mozapps/installer/makexpi.pl
http://lxr.mozilla.org/mozilla/source/browser/installer/windows/browser.jst
For Mozilla I change
http://lxr.mozilla.org/mozilla/source/xpinstall/packager/windows/makexpi.pl
http://lxr.mozilla.org/mozilla/source/xpinstall/packager/win_gre/makexpi.pl
http://lxr.mozilla.org/mozilla/source/xpinstall/packager/windows/browser.jst
In the makexpi.pl scripts I add:
if($inComponentName =~ /browser/i)
{
# copy gdiplus.dll to browser dir
if(-e "$topsrcdir/../redist/microsoft/system/gdiplus.dll")
{
copy("$topsrcdir/../redist/microsoft/system/gdiplus.dll",
"$inStagePath/$inComponentName");
}
}
and in the browser.jst templates I add something like:
// install gdiplus.dll into the *application* directory
// we don't care if addFile() fails (if the file does not exist in
the archive)
// bacause it will still install
fileGdiPlus = getFolder(fWindowsSystem, "gdiplus.dll");
rv = File.exists(fileGdiPlus);
logComment("fileExists() returned: " + rv);
if(rv == false)
{
logComment("File not found: " + fileGdiPlus);
if (is_win2k || is_winme || is_winnt4 || is_win98) // obtain somehow
{
addFile("/Microsoft/Shared/gdiplus.dll",
"$Version$",
"gdiplus.dll", // dir name in jar to extract
fProgram, // Where to put this file
(Returned from getFolder)
"", // subdir name to create relative
to fProgram
WIN_SHARED_FILE);
logComment("addFile() of gdiplus.dll returned: " + err);
}
}
else
{
logComment("File found: " + fileGdiPlus);
}
Once I figure out how to set is_win2k, is_winme, is_winnt4 and is_win98
I'll test this out and let you know how it went.
Thanks very much Dan!
Jonathan