major source structure and module name change - continue4

This commit is contained in:
soochoi
2006-06-08 21:38:52 +00:00
parent 1d82ff5d6a
commit 6ac32abb91
36 changed files with 51 additions and 15 deletions

Binary file not shown.

View File

@@ -0,0 +1,119 @@
// install.js
// XpiInstaller
var XpiInstaller = {
// --- Editable items begin ---
extFullName: 'Novell CASA', // The name displayed to the user (don't include the version)
extShortName: 'casa', // The leafname of the JAR file (without the .jar part)
extVersion: '1.0',
extAuthor: 'CSL.Manojna',
extLocaleNames: null, // e.g. ['en-US', 'en-GB']
extSkinNames: null, // e.g. ['classic', 'modern']
extPostInstallMessage: 'Extension successfully installed.', // Set to null for no post-install message
// --- Editable items end ---
profileInstall: true,
silentInstall: false,
install: function()
{
var jarName = this.extShortName + '.jar';
var profileDir = Install.getFolder('Profile', 'chrome');
// Parse HTTP arguments
this.parseArguments();
// Check if extension is already installed in profile
if (File.exists(Install.getFolder(profileDir, jarName)))
{
if (!this.silentInstall)
{
Install.alert('Updating existing Profile install of ' + this.extFullName + ' to version ' + this.extVersion + '.');
}
this.profileInstall = true;
}
else if (!this.silentInstall)
{
// Ask user for install location, profile or browser dir?
this.profileInstall = Install.confirm('Install ' + this.extFullName + ' ' + this.extVersion + ' to your Profile directory (OK) or your Browser directory (Cancel)?');
}
// Init install
var dispName = this.extFullName + ' ' + this.extVersion;
var regName = '/' + this.extAuthor + '/' + this.extShortName;
Install.initInstall(dispName, regName, this.extVersion);
// Find directory to install into
var installPath;
if (this.profileInstall) installPath = profileDir;
else installPath = Install.getFolder('chrome');
// Add JAR file
Install.addFile(null, 'chrome/' + jarName, installPath, null);
// Register chrome
var jarPath = Install.getFolder(installPath, jarName);
var installType = this.profileInstall ? Install.PROFILE_CHROME : Install.DELAYED_CHROME;
// Register content
Install.registerChrome(Install.CONTENT | installType, jarPath, 'content/' + this.extShortName + '/');
// Register locales
for (var locale in this.extLocaleNames)
{
var regPath = 'locale/' + this.extLocaleNames[locale] + '/' + this.extShortName + '/';
Install.registerChrome(Install.LOCALE | installType, jarPath, regPath);
}
// Register skins
for (var skin in this.extSkinNames)
{
var regPath = 'skin/' + this.extSkinNames[skin] + '/' + this.extShortName + '/';
Install.registerChrome(Install.SKIN | installType, jarPath, regPath);
}
// Perform install
var err = Install.performInstall();
if (err == Install.SUCCESS || err == Install.REBOOT_NEEDED)
{
if (!this.silentInstall && this.extPostInstallMessage)
{
Install.alert(this.extPostInstallMessage);
}
}
else
{
this.handleError(err);
return;
}
},
parseArguments: function()
{
// Can't use string handling in install, so use if statement instead
var args = Install.arguments;
if (args == 'p=0')
{
this.profileInstall = false;
this.silentInstall = true;
}
else if (args == 'p=1')
{
this.profileInstall = true;
this.silentInstall = true;
}
},
handleError: function(err)
{
if (!this.silentInstall)
{
Install.alert('Error: Could not install ' + this.extFullName + ' ' + this.extVersion + ' (Error code: ' + err + ')');
}
Install.cancelInstall(err);
}
};
XpiInstaller.install();

View File

@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>{CE9E7AA3-C32A-444b-9BF1-703DAADC0E3C}</em:id>
<em:name>Novell CASA</em:name>
<em:version>1.0</em:version>
<em:description>Common Authentication Service Adapter</em:description>
<em:creator>CSL.Manojna</em:creator>
<!-- optional items -->
<em:contributor>Jim Norman</em:contributor>
<em:homepageURL>http://www.novell.com</em:homepageURL>
<em:iconURL>chrome://casa/skin/CASA_48.png</em:iconURL>
<em:aboutURL>chrome://casa/content/about.xul</em:aboutURL>
<em:file>
<Description about="urn:mozilla:extension:file:casa.jar">
<em:package>content/</em:package>
<!-- optional items -->
<em:skin>skin/classic/</em:skin>
</Description>
</em:file>
<em:targetApplication> <!-- Firefox -->
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>0.9</em:minVersion>
<em:maxVersion>1.5.1</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication> <!-- Mozilla Suite -->
<Description>
<em:id>{86c18b42-e466-45a9-ae7a-9b95ba6f5640}</em:id>
<em:minVersion>1.7</em:minVersion>
<em:maxVersion>1.8</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>