Create  Edit  Diff  XUL Wiki  Index  Search  Changes  History  Source  RSS  wikifarm  Login

Mozillaへのインストールのスクリプト

var extension={
name:"test extension",
version:"1.0",
description:"This is test",
innerName:"test",
locales:new Array("en-US","ja-JP"),
components:new Array(),
preferences:new Array("test.js"),
skin:new Array("classic"),
inJarPackage:false
}

var rv=initInstall(extension.description,extension.name,extension.version);
logComment("initInstall: " + rv);

for(var i in extension.preferences){
var pref = getFolder("Program","defaults/pref")
addFile(null,null,"defaults/preferences/"+extension.preferences[i],pref,"");
}

for(i in extension.components){
var components = getFolder("Components");
addFile("","components/"+extension.components[i],components,"");
}

var chrome;
var jar_or_folder=null;
if(extension.inJarPackage){
chrome = getFolder("Chrome");
addFile(extension.name, extension.version, "chrome/"+extension.innerName+".jar", chrome, "");
jar_or_folder=getFolder("Chrome", extension.innerName+".jar");
}else{
chrome = getFolder("Chrome",extension.innerName);
addDirectory("","chrome/"+extension.innerName, chrome,"");
jar_or_folder=getFolder("Chrome", extension.innerName);
}

registerChrome(CONTENT | DELAYED_CHROME, jar_or_folder, "content/"+extension.innerName+"/");
for(i in extension.locales){
registerChrome(LOCALE  | DELAYED_CHROME, jar_or_folder, "locale/"+extension.locales[i]+"/"+extension.innerName+"/");
}
for(i in extension.skin){
registerChrome(SKIN  | DELAYED_CHROME, jar_or_folder, "skin/"+extension.skin[i]+"/"+extension.innerName+"/");
}

rv = getLastError();

if(SUCCESS==rv){
performInstall(rv);
}else{
cancelInstall(rv);
}
Last modified:2005/02/07 19:25:32
Keyword(s):
References: