Episode renaming settings are lost after OS re-installation

All your suggestions, requests and ideas for future development
Locked
User avatar
Sheldon
Posts: 188
Joined: 14 Apr 2014, 14:39

Episode renaming settings are lost after OS re-installation

Post by Sheldon »

Hi,

I run the portable version of FileBot on Windows Vista.

The tool is absolutely awesome and by the way I would like to say thanks and congrats for the great work you did on this program so far. I really enjoy working with it.

But at the weekend I guess I found an issue. I would not call it a bug.
After the re-installation of my Windows Vista I started FileBot and recognized that my custom episode renaming settings were lost. It seems that they are written to some file in the windows user directory or the registry. In my opinion this settings should go to the INI-File in the FileBot directory.

If possible this would be my change request. Just have a look at it.

Thanks in advance!

Kind regards,

Sheldon
User avatar
rednoah
The Source
Posts: 24016
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Episode renaming settings are lost after OS re-installat

Post by rednoah »

It works.

You need to run it with FileBot.exe so the settings in FileBot.l4j.ini get applied and it runs in portable mode. You're probably running FileBot.jar directly, so the settings that make it run in portable mode can't be applied.
:idea: Please read the FAQ and How to Request Help.
User avatar
Sheldon
Posts: 188
Joined: 14 Apr 2014, 14:39

Re: Episode renaming settings are lost after OS re-installat

Post by Sheldon »

Thanks for the fast reply!

This is true! I directly run the FileBot.jar because I launch it with the Java Launcher Portable. I do not have Java installed in my OS. This means the exe will not work on my system. Is there any way to make the jar applying the ini? If it is a metter of parametrization I can implement it to the launcher if you provide me the required parameters.

Kind regards,

Sheldon
User avatar
rednoah
The Source
Posts: 24016
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Episode renaming settings are lost after OS re-installat

Post by rednoah »

Still, all you need to know is in FileBot.l4j.ini and you just need to set these options in the java call.

Your Java Launcher Portable is broken then, cause it could easily set these properties as well, they'd just have to override user.home and java.util.prefs.PreferencesFactory instead of the default user home and default registry preferences system.

Can make any standard Java application portable by overriding just a few settings:
-Djava.io.tmpdir
-Duser.home
-Djava.library.path
-Djava.util.prefs.PreferencesFactory


I guess that would be the point of your portable launcher. So now you can report the same bug with Java Launcher Portable. ;)

PS: Mentioning that you're using a custom launcher would have been helpful in the original post.
:idea: Please read the FAQ and How to Request Help.
User avatar
Sheldon
Posts: 188
Joined: 14 Apr 2014, 14:39

Re: Episode renaming settings are lost after OS re-installat

Post by Sheldon »

Hi,

thanks for your answer

Sorry for not mentioning the launcher in the original post. In detail I use the portable launcher from PortableApps.com. And it's not only the launcher that is portable in my case. Java itself is also portable. So there is no regular Java installation.

By the way. To consider Java to be installed on a machine is not really a good idea for portable apps.
If you come to a system without Java you are lost. That's where portable Java comes into play.

As I can see from the ini file it would be enough to replace %EXEDIR% by the local app folder, right?
Can this be done generaly by setting %EXEDIR% so that I don't have to replace all.

Update:
I tried it and it didn't work. So how can I use the settings in the ini? What does your exe file do?
I simply run the FileBot.jar using the PortableApps Java Laucher Portable. This is a cmmom jar call.
So the special part must be in your exe. What is it?

Kind regards

Sheldon
User avatar
rednoah
The Source
Posts: 24016
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Episode renaming settings are lost after OS re-installat

Post by rednoah »

Not really, you can have a look at filebot.cmd if you wanna see how the java call is supposed to look like. You'll have to differentiate between Java properties and application arguments.

PS: I repeat, these "magic portable settings" is what your Java launcher should be setting by default, since it's supposed to be portable, and make apps run portable.
:idea: Please read the FAQ and How to Request Help.
User avatar
Sheldon
Posts: 188
Joined: 14 Apr 2014, 14:39

Re: Episode renaming settings are lost after OS re-installat

Post by Sheldon »

There is a misunderstanding. The launcher simply just launches an app. Means running the jar. Nothing else.
It should not and it doesn't change any settings in any file for any app. So your app and the launcher are completely seperate. The launcher doesn't even know what exactly he starts. This is just a parameter he receives.
So it's a simple starting procedure.

Ok! Let's do it another way! Step by step!

Assume I run the jar without any parameters and create some renaming setting for episodes f.e.
Where will this be stored? Or better! Which setting holds the folder and filename and how can I set this as a concrete property like C:\filebot\.... f.e.. This would help a lot.

Kind regards

Sheldon
User avatar
rednoah
The Source
Posts: 24016
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Episode renaming settings are lost after OS re-installat

Post by rednoah »

No, you don't understand. Your Java launcher launches Java applications, as such it has full control of what Java properties it passes on to the java call.

By setting these Java properties in the java call you can make ANY Java application portable even if the application was not designed to be portable:
-Djava.io.tmpdir
-Duser.home
-Djava.library.path
-Djava.util.prefs.PreferencesFactory


If you do java -jar FileBot.jar then these options will set to the system default.

java.io.tmpdir => %TEMP%
user.home=> %USERPROFILE%
java.library.path => %PATH% plus some
java.util.prefs.PreferencesFactory => WindowsPreferences stores user preferences in the Registry somewhere

That's my guess, but this depends on the JRE defaults and is highly system specific. A good Portable Java Launcher would override these settings with something more portable.

PS: Your launcher fails. Now go and make a bug report so they can fix it. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
Sheldon
Posts: 188
Joined: 14 Apr 2014, 14:39

Re: Episode renaming settings are lost after OS re-installat

Post by Sheldon »

Please don't discuss the launcher. This is used for very big apps like Mozilla Firefox, Thunderbird and Open Office for nearly 10 years and proofed by thousdands of users.

Sorry, but so far you didn't answer any of my questions.
Where do you store the settings in my scenario. I can't find any settings file.
What does the exe exactly do jar?
How do you use the ini?
Please don't tell me that you store the portable information somethere in Java enviroment.
From the cmd file it seems so.

Please! I need a concrete answer.
User avatar
rednoah
The Source
Posts: 24016
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Episode renaming settings are lost after OS re-installat

Post by rednoah »

I have answered your questions twice already.

I can only assume you don't know what %TEMP% or %USERPROFILE% means, in which case Google is your friend.

1.
FileBot.exe just calls FileBot.jar with java.exe and passes all the options defined in FileBot.ini as Java cmdline arguments.

2.
You don't use FileBot.ini, only FileBot.exe does. But you can you the same options and make your own java call.

3.
Are you on Windows? Then the preferences are stored in the Registry (and not the Java environment). Quick Google search shows it's most likely gonna be in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs.


PS: Mozilla Firefox, Thunderbird and Open Office are not Java applications. I merely remarked upon the FACT
that the Java launcher for launching Java applications could use some improvement.

THREAD CLOSED
:idea: Please read the FAQ and How to Request Help.
Locked