Bug 747205. Webapps installer follow-ups. r=timA a=desktop-only
authorFelipe Gomes <felipc@gmail.com>
Thu, 19 Apr 2012 18:47:54 -0700
changeset 95283 ebec7bc561e1905612befb1d07292903e702472c
parent 95282 ac6e651207d3fe55b8f168c28c9568b00a6c8306
child 95284 22bfdebf5cae295b3aa946406d7654c356b55801
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstimA, desktop-only
bugs747205
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 747205. Webapps installer follow-ups. r=timA a=desktop-only
browser/modules/WebappsInstaller.jsm
webapprt/win/webapp-uninstaller.nsi.in
--- a/browser/modules/WebappsInstaller.jsm
+++ b/browser/modules/WebappsInstaller.jsm
@@ -121,19 +121,20 @@ function NativeApp(aData) {
  *
  * %APPDATA%/${FolderName}
  *   - webapp.ini
  *   - webapp.json
  *   - ${AppName}.exe
  *   - ${AppName}.lnk
  *   / uninstall
  *     - webapp-uninstaller.exe
- *     - shortcut_logs.ini
+ *     - shortcuts_log.ini
+ *     - uninstall.log
  *   / chrome/icons/default/
- *     - topwindow.ico
+ *     - default.ico
  *
  * After the app runs for the first time, a profiles/ folder will also be
  * created which will host the user profile for this app.
  */
 
 /**
  * Constructor for the Windows native app shell
  *
@@ -187,24 +188,24 @@ WinNativeApp.prototype = {
     this.installDir = Services.dirsvc.get("AppData", Ci.nsIFile);
     this.installDir.append(this.launchURI.host + ";" + 
                            this.launchURI.scheme + ";" +
                            this.launchURI.port);
 
     this.uninstallDir = this.installDir.clone();
     this.uninstallDir.append("uninstall");
 
-    this.uninstallerFile = this.installDir.clone();
+    this.uninstallerFile = this.uninstallDir.clone();
     this.uninstallerFile.append("webapp-uninstaller.exe");
 
     this.iconFile = this.installDir.clone();
     this.iconFile.append("chrome");
     this.iconFile.append("icons");
     this.iconFile.append("default");
-    this.iconFile.append("topwindow.ico");
+    this.iconFile.append("default.ico");
 
     this.processFolder = Services.dirsvc.get("CurProcD", Ci.nsIFile);
 
     this.desktopShortcut = Services.dirsvc.get("Desk", Ci.nsILocalFile);
     this.desktopShortcut.append(this.appNameAsFilename + ".lnk");
     this.desktopShortcut.followLinks = false;
 
     this.startMenuShortcut = Services.dirsvc.get("Progs", Ci.nsILocalFile);
@@ -300,40 +301,39 @@ WinNativeApp.prototype = {
     webappINI.append("webapp.ini");
 
     let factory = Cc["@mozilla.org/xpcom/ini-processor-factory;1"]
                     .getService(Ci.nsIINIParserFactory);
 
     let writer = factory.createINIParser(webappINI).QueryInterface(Ci.nsIINIParserWriter);
     writer.setString("Webapp", "Name", this.appName);
     writer.setString("Webapp", "Profile", this.installDir.leafName);
-    writer.setString("Webapp", "Executable", this.appNameAsFilename + ".exe");
+    writer.setString("Webapp", "Executable", this.appNameAsFilename);
     writer.setString("WebappRT", "InstallDir", this.processFolder.path);
-    writer.setString("Branding", "BrandFullName", this.appName);
-    writer.setString("Branding", "BrandShortName", this.appName);
     writer.writeFile();
 
-    // ${UninstallDir}/shortcut_logs.ini
+    // ${UninstallDir}/shortcuts_log.ini
     let shortcutLogsINI = this.uninstallDir.clone().QueryInterface(Ci.nsILocalFile);
-    shortcutLogsINI.append("shortcut_logs.ini");
+    shortcutLogsINI.append("shortcuts_log.ini");
 
     writer = factory.createINIParser(shortcutLogsINI).QueryInterface(Ci.nsIINIParserWriter);
-    writer.setString("STARTMENU", "Shortcut", this.appNameAsFilename + ".lnk");
-    writer.setString("DESKTOP", "Shortcut", this.appNameAsFilename + ".lnk");
+    writer.setString("STARTMENU", "Shortcut0", this.appNameAsFilename + ".lnk");
+    writer.setString("DESKTOP", "Shortcut0", this.appNameAsFilename + ".lnk");
     writer.setString("TASKBAR", "Migrated", "true");
+    writer.writeFile();
 
     writer = null;
     factory = null;
 
     // ${UninstallDir}/uninstall.log
     let uninstallContent = 
       "File: \\webapp.ini\r\n" +
       "File: \\webapp.json\r\n" +
       "File: \\webapprt.old\r\n" +
-      "File: \\chrome\\icons\\default\\topwindow.ico";
+      "File: \\chrome\\icons\\default\\default.ico";
     let uninstallLog = this.uninstallDir.clone();
     uninstallLog.append("uninstall.log");
     writeToFile(uninstallLog, uninstallContent, function() {});
   },
 
   /**
    * Writes the keys to the system registry that are necessary for the app operation
    * and uninstall process.
@@ -390,16 +390,19 @@ WinNativeApp.prototype = {
     shortcut.setShortcut(target, this.installDir.clone(), null,
                          this.shortDescription, this.iconFile, 0);
 
     let desktop = Services.dirsvc.get("Desk", Ci.nsILocalFile);
     let startMenu = Services.dirsvc.get("Progs", Ci.nsILocalFile);
 
     shortcut.copyTo(desktop, this.appNameAsFilename + ".lnk");
     shortcut.copyTo(startMenu, this.appNameAsFilename + ".lnk");
+
+    shortcut.followLinks = false;
+    shortcut.remove(false);
   },
 
   /**
    * This variable specifies if the icon retrieval process should
    * use a temporary file in the system or a binary stream. This
    * is accessed by a common function in WebappsIconHelpers.js and
    * is different for each platform.
    */
@@ -552,18 +555,16 @@ MacNativeApp.prototype = {
     applicationINI.append("webapp.ini");
 
     let factory = Cc["@mozilla.org/xpcom/ini-processor-factory;1"]
                     .getService(Ci.nsIINIParserFactory);
 
     let writer = factory.createINIParser(applicationINI).QueryInterface(Ci.nsIINIParserWriter);
     writer.setString("Webapp", "Name", this.appName);
     writer.setString("Webapp", "Profile", this.appProfileDir.leafName);
-    writer.setString("Branding", "BrandFullName", this.appName);
-    writer.setString("Branding", "BrandShortName", this.appName);
     writer.writeFile();
 
     let infoPListContent = '<?xml version="1.0" encoding="UTF-8"?>\n\
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n\
 <plist version="1.0">\n\
   <dict>\n\
     <key>CFBundleDevelopmentRegion</key>\n\
     <string>English</string>\n\
--- a/webapprt/win/webapp-uninstaller.nsi.in
+++ b/webapprt/win/webapp-uninstaller.nsi.in
@@ -146,17 +146,17 @@ Function .onInit
 FunctionEnd
 
 Function un.onInit
   StrCpy $LANGUAGE 0
 
   ${un.GetParent} "$INSTDIR" $INSTDIR
   ${un.GetLongPath} "$INSTDIR" $INSTDIR
 
-  ReadINIStr $AppFilename "$INSTDIR\webapp.ini" "WebappRT" "Executable"
+  ReadINIStr $AppFilename "$INSTDIR\webapp.ini" "Webapp" "Executable"
   ReadINIStr $AppName "$INSTDIR\webapp.ini" "Webapp" "Name"
 
   ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}"
     Abort
   ${EndUnless}
 
   StrCpy $AppRTTempDir "$TEMP\moz_webapprt"
   RmDir /r "$AppRTTempDir"