You are here

Updating wipes App folder customizations

10 posts / 0 new
Last post
choin
Offline
Last seen: 1 year 2 months ago
Joined: 2023-04-01 23:57
Updating wipes App folder customizations

- Install Portable Firefox
- Customize it with stuff
- Update using original Portable installer
- Discover that your customizations were wiped

The problem is, from what I understand, that the installer will wipe the App\Firefox and App\Firefox64 folders. But a lot of customizations rely on additional files located in these folders.

Right now, to update Portable Firefox, I resort to installing a new version into a fresh folder, then copying its contents over my original installation. That way my customizations are preserved.

ANTICHRISTUS REX
ANTICHRISTUS REX's picture
Offline
Last seen: 8 hours 8 sec ago
Translator
Joined: 2019-07-19 07:09
Data folder

Customizations (plugins & extensions) are saved on the Data folder, I don't know how yours are saved somewhere else.

“My brain is only a receiver, in the Universe there is a core from which we obtain knowledge, strength and inspiration. I have not penetrated into the secrets of this core, but I know that it exists.”

― Nikola Tesla ―

choin
Offline
Last seen: 1 year 2 months ago
Joined: 2023-04-01 23:57
Here is how
John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 44 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Profile Folder, App Folders Deleted

Is there some reason you're not putting userChrome.js within the profile folder as the documentation says that's where it's supposed to go? http://kb.mozillazine.org/UserChrome.js

The app folder for all apps is wiped by design under normal circumstances. Very specific carve-outs are made in specific apps for things like plugins but that's about it. With Firefox, for instance, we preserve the plugins, searchplugins, and distribution folders (where you can adjust the updater).

Sometimes, the impossible can become possible, if you're awesome!

choin
Offline
Last seen: 1 year 2 months ago
Joined: 2023-04-01 23:57
In my case 2 files are added

In my case 2 files are added near the .exe:
defaults\pref\config-prefs.js
config.js

I'd assume a lot of these are out of the official specs, yet a lot of it works and thus it has a good user base. Firefox still provides great capabilities for customization and I doubt it changes in future.

One thing I can suggest is to check how original installer works and try to follow that logic. I don't know for sure but it's possible that it doesn't wipe any extra files.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 44 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
App Is Wiped

The whole app directory is wiped by design except for specific exceptions made within the installer.ini for each app. I wrote the PA.c Installer and it's designed to work that way.

The config.js and similar are designed for organizations to preload restrictions to Firefox within organization-wide installations. From the documentation, it seems to only be used to disable or lock down specific things. What specifically are you trying to accomplish with your personal install and is this the only way to do it? I'm guessing you're trying to use Firefox Dev and bypass extension signing.

Sometimes, the impossible can become possible, if you're awesome!

choin
Offline
Last seen: 1 year 2 months ago
Joined: 2023-04-01 23:57
I'm not using Dev.

I'm not using Dev.

You could probably check the link and see what the file does. Disabling extension signing is among those things.

// skip 1st line
lockPref('xpinstall.signatures.required', false);
lockPref('extensions.install_origins.enabled', false);

try {
const cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile);
cmanifest.append('utils');
cmanifest.append('chrome.manifest');
Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest);

const objRef = ChromeUtils.import('resource://gre/modules/addons/AddonSettings.jsm');
const temp = Object.assign({}, Object.getOwnPropertyDescriptors(objRef.AddonSettings), {
REQUIRE_SIGNING: { value: false }
});
objRef.AddonSettings = Object.defineProperties({}, temp);

Cu.import('chrome://userchromejs/content/BootstrapLoader.jsm');
} catch (ex) {};

try {
Cu.import('chrome://userchromejs/content/userChrome.jsm');
} catch (ex) {};

If you were interested enough you could also check every add-on that is offered and decide whether it's worth changing your installation logic. But know that this is just one branch where they are published. There are more.

I'm using the application like I want and I chose to use it in portable mode. Too bad it doesn't have this mode out of the box. So I described what I needed to do to update it. Maybe if someone confirms that the Portable Firefox can be safely updated with the original auto-updater there wouldn't be a problem.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 44 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Can Preserve, Other Files?

Ok, that all makes sense. I can adjust the Firefox Portable installer to specifically preserve those files using installer directives like so:

[FilesToPreserve]
PreserveFile1=App\Firefox\config.js
PreserveFile2=App\Firefox64\config.js
PreserveFile3=App\Firefox\defaults\pref\config-prefs.js
PreserveFile4=App\Firefox64\defaults\pref\config-prefs.js

Are there any other files that require being within the Firefox application directory to work? From my quick reading of the instructions on the github page you linked and look in the zip files it looks like everything else can go into the profile.

Sometimes, the impossible can become possible, if you're awesome!

choin
Offline
Last seen: 1 year 2 months ago
Joined: 2023-04-01 23:57
I don't think there are other

I don't think there are other files that are needed for customization to work. Yes, the rest go into the Data/profiles folder.

Note that the config.js file seems to not be hard-coded into Firefox, but is linked in defaults\pref\config-prefs.js
Though I checked some places and this filename seems more or less standard across them all.

Thank you for this! I hope people using customization find information about Portable edition being more friendly to them.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 44 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Confirmed For Future Releases

The patch has been made and it will be in future releases.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments