rddim / FreeTubePortable

FreeTube in PortableApps.com Format
https://portableapps.com/node/64694
29 stars 4 forks source link

can you add the flag AllowMultipleInstances=true #2

Closed Janaue closed 4 months ago

Janaue commented 2 years ago

I want to launch several FreeTubePortable in parallel, with different profiles. For FirefoxPortable, there is a flag AllowMultipleInstances=true to activate in FirefoxPortable.ini in the root directory of PortableApps\FirefoxPortable, but I dont see one for FreeTubePortable. Is it possible you create this?

rddim commented 2 years ago

Hello, @Janaue

Sorry for the delay and thank you for your patience. I wanted to make a few changes and test them before responding. Actually AllowMultipleInstances=true will do nothing for parallel running of FreeTubePortable, but SingleAppInstance=false will.

Also as I mentioned before in https://github.com/FreeTubeApp/FreeTube/issues/746#issuecomment-1146320361 adding a --user-data-dir="%PAL:DataDir%\FreeTube" to the CommandLineArguments= will do the main part of the portable profile - to work from the Data folder.

There is a known issue with --user-data-dir="%PAL:DataDir%\FreeTube" that I can not resolve - the UNC stop working. The workaround is to add --no-sandbox which will disable the sandbox. Use it at your own risk!

This is the content that you need to replace in \FreeTubePortable\App\AppInfo\Launcher\FreeTubePortable.ini file before running in parallel:

[Launch]
ProgramExecutable=FreeTube\FreeTube.exe
CommandLineArguments=--user-data-dir="%PAL:DataDir%\FreeTube"
WaitForOtherInstances=false
SingleAppInstance=false
DirectoryMoveOK=yes
SupportsUNC=yes

[Activate]
Registry=true

[RegistryKeys]
-=HKCU\Software\Classes\freetube

For the parallel running there are several options:

Option 1 Create a copy of the whole FreeTubePortable folder (~240mb) with different name or different place

Option 2 - save a space and be updated

  1. Create a copy of the FreeTubePortable.exe in the same folder with new name (for example) FreeTubePortable-2nd.exe
  2. Create a copy of the \FreeTubePortable\App\AppInfo\Launcher\FreeTubePortable.ini in the same Launcher folder with the same name as copied FreeTubePortable.exe (for example) FreeTubePortable-2nd.ini
  3. For the new profile:
    • Change the --user-data-dir="%PAL:DataDir%\FreeTube" in the copied file to --user-data-dir="%PAL:DataDir%\FreeTube-2nd" or what profile name you would like OR
    • Add --user-data-dir="%PAL:DataDir%\FreeTube-2nd" to the AdditionalParameters= in the FreeTubePortable-2nd.ini in the root FreeTubePortable directory (get the file from \Other\Source and rename it) - this option will override the default.

Option 3 This is interesting option that work like the Firefox Portable 2nd Profile

  1. In the main PortableApps directory create a folder like FreeTubePortable2ndProfile
  2. Inside FreeTubePortable2ndProfile create a folder App
  3. From the FreeTubePortable copy the FreeTubePortable.exe to the FreeTubePortable2ndProfile
  4. From the FreeTubePortable\App copy the whole AppInfo folder to the new FreeTubePortable2ndProfile\App folder
  5. Replace the content of the \FreeTubePortable2ndProfile\App\AppInfo\Launcher\FreeTubePortable.ini with this:
    
    [Launch]
    ProgramExecutable=..\..\FreeTubePortable\App\FreeTube\FreeTube.exe
    CommandLineArguments=--user-data-dir="%PAL:DataDir%\FreeTube"
    WaitForOtherInstances=false
    SingleAppInstance=false
    DirectoryMoveOK=yes
    SupportsUNC=yes

[Activate] Registry=true

[RegistryKeys] -=HKCU\Software\Classes\freetube


Please, note that the both `FreeTubePortable` and `FreeTubePortable2ndProfile` must be stored in the same main folder

---
After all
* At this time I don't plan to create a new separated app for secondary profile. If there is interest may be I will do.
* For using a UNC (use it at your own risk of course) I suggest to add the `--no-sandbox` to the `AdditionalParameters=` in the `\FreeTubePortable\FreeTubePortable.ini`. This argument can be at one line with `--user-data-dir="%PAL:DataDir%\FreeTube"` without problems.
* For **Option 2** I have added an option to keep all other `*.ini` files while update the app, because the main `FreeTubePortable.ini` will be also updated.
* I hope I will release the new v0.17.1 with the new changes these week.
rddim commented 2 years ago

v0.17.1 is released