none
Custom USMT xml files to backup and restore Firefox and Chrome

    Question

  • I found lots of old suggestions on getting Firefox to backup but the part that bugged me the most was that it went against Microsoft's suggestion of not modifying the original xml files. For good reason too, because they could be replaced and you would lose your customizations. I also found that the suggestions didn't work because of changes in the newer versions of Firefox. Below I will post the code that works with new versions of Firefox, hopefully it will help others.

    Now if anyone knows how to get Chrome to work, I'd appreciate that. I'm working on it, but no need to reinvent the wheel if someone has working code already.

    This is just the firefox section, it will not work if you only save this code without the required xml and migration tags.

    Note: As best as I could tell the lastest version of Firefox writes to HKLM\Software\Mozilla\Mozilla Firefox\*.*\Main and not to bin where the previous code was looking.

      <!-- Mozilla Firefox -->
      <component context="UserAndSystem" type="Application">
        <displayName>Firefox</displayName>
        <environment name="GlobalEnv"/>
        <environment name="GlobalEnvX64"/>
        <paths>
          <path type="File">%CSIDL_APPDATA%\Mozilla\Firefox\</path>
        </paths>
        <role role="Settings">
          <detection>
            <conditions>
    	  <condition>MigXmlHelper.DoesObjectExist("Registry","%HklmWowSoftware%\Mozilla\Mozilla Firefox *.*\bin [PathToExe]")</condition>
              <condition>MigXmlHelper.DoesObjectExist("Registry","%HklmWowSoftware%\Mozilla\Mozilla Firefox\*.*\Main [PathToExe]")</condition>
            </conditions>
          </detection>
          <rules context="User">
            <destinationCleanup>
              <objectSet>
                <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\*\Cache\* [*]</pattern>
              </objectSet>
            </destinationCleanup>
            <include>
              <objectSet>
                <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\* [*]</pattern>
                <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\* [*]</pattern>
              </objectSet>
            </include>
            <exclude>
              <objectSet>
                <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\Crash Reports\* [*]</pattern>
                <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\Profiles\*\ [pluginreg.dat]</pattern>
                <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\*\Cache\* [*]</pattern>
              </objectSet>
            </exclude>
            <merge script="MigXmlHelper.SourcePriority()">
              <objectSet>
                <pattern type="File">%CSIDL_APPDATA%\Mozilla\Firefox\* [*]</pattern>
                <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla\Firefox\Profiles\* [*]</pattern>
              </objectSet>
            </merge>
          </rules>
        </role>
      </component>


    If this post is helpful please vote it as Helpful or click Mark for answer.


    • Edited by Dan_Vega Thursday, April 2, 2015 7:37 PM
    Thursday, April 2, 2015 7:36 PM

Answers

  • I guess I answered myself. I got Chrome (currently version 41) to backup and restore. I replaced the above detection condition code with this:

    <condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_LOCAL_APPDATA%\Google\Chrome")</condition>


    If this post is helpful please vote it as Helpful or click Mark for answer.


    • Edited by Dan_Vega Thursday, April 2, 2015 9:51 PM
    • Marked as answer by Dan_Vega Friday, April 3, 2015 6:45 PM
    Thursday, April 2, 2015 9:50 PM

All replies

  • By the way here are the conditions I tried but it doesn't seem to detect and grab the files for Chrome.

      <!-- Google Chrome -->
      <component context="UserAndSystem" type="Application">
        <displayName>Google Chrome</displayName>
        <environment name="GlobalEnv"/>
        <environment name="GlobalEnvX64"/>
        <role role="Settings">
          <destinationCleanup>
            <objectSet>
              <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\*\Cache\* [*]</pattern>
            </objectSet>
          </destinationCleanup>
          <detection>
            <conditions>
              <condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_PROGRAM_FILESX86%\Google\Chrome\Application [chrome.exe]")</condition>
              <condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_PROGRAM_FILES%\Google\Chrome\Application [chrome.exe]")</condition>
            </conditions>
          </detection>
          <rules context="User">
            <include>
              <objectSet>
                <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\* [*]</pattern>
              </objectSet>
            </include>
            <exclude>
              <objectSet>
                <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\*\Cache\* [*]</pattern>
              </objectSet>
            </exclude>
            <merge script="MigXmlHelper.SourcePriority()">
              <objectSet>
                <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\Chrome\User Data\* [*]</pattern>
              </objectSet>
            </merge>
          </rules>
        </role>
      </component>


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Thursday, April 2, 2015 8:49 PM
  • I guess I answered myself. I got Chrome (currently version 41) to backup and restore. I replaced the above detection condition code with this:

    <condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_LOCAL_APPDATA%\Google\Chrome")</condition>


    If this post is helpful please vote it as Helpful or click Mark for answer.


    • Edited by Dan_Vega Thursday, April 2, 2015 9:51 PM
    • Marked as answer by Dan_Vega Friday, April 3, 2015 6:45 PM
    Thursday, April 2, 2015 9:50 PM
  • Hello

    is this still working for new version of FF and chrome?

    could you give more detail on how to implement this into MDT?

    thanks

    Tuesday, January 16, 2018 6:59 PM
  • It should still work.

    To use custom USMT rules, you'll need to edit your customsettings.ini to specify them.

    USMTMigFiles001=MigApp.xml
    USMTMigFiles002=MigUser.xml
    USMTMigFiles003=CustomUser.xml
    USMTMigFiles004=CustomApp.xml

    First you need to specify the original xml files that came with MDT, they are the first two in the list above. Then you would specify your custom file(s).

    For information on creating custom xml files look at Create a custom .xml file


    Daniel Vega

    Wednesday, January 17, 2018 2:58 PM
  • Additionally, there are now 64-bit and 32-bit builds of Firefox and Chrome.  The variable %HklmWoWSoftware% will only find entries in WOW6432Node of the registry, and newer versions of these browsers don't write there.  You can add a second detection section to search the native hive:

          <detection>
            <conditions>
        	    <condition>MigXmlHelper.DoesObjectExist("Registry","HKLM\Software\Mozilla\Firefox")</condition>
            </conditions>
          </detection>


    To be complete, you can add your own global variable for this hive in the section <namedElements> like this:

          <variable name="HklmSoftware">
            <text>HKLM\SOFTWARE</text>
          </variable>

    • Edited by Kurt B. Mayer Monday, April 2, 2018 10:14 PM Updated answer.
    Monday, April 2, 2018 10:11 PM
  • That exists by default:

    <variable name="HklmWowSoftware">
            <text>HKLM\Software</text>

    Thursday, July 26, 2018 9:14 PM
  • I believe all of this and more is covered in EhlerTechs Custom XML collection for USMT.

    They also contain XML's for not scanning system folders and other drives, as well as a method for handling Modern App settings.

    My favorite though is their GUI for USMT, that lets me use USMT completely indepenently from our MDT or SCCM.

    Greetings from Milan
    Janine

    Saturday, August 11, 2018 7:21 AM