opentoonz / opentoonz_docs

OpenToonz User Manual
http://opentoonz.readthedocs.io
28 stars 26 forks source link

"Portable" option during installation #200

Open ReturnMinusOne opened 3 years ago

ReturnMinusOne commented 3 years ago

Hello,

I'm always interested to try out experimental features or changes in OpenToonz, but the only builds available are for the installation version.

The 1.4 release notes mention "New Portable Test Builds via zip file download at Github (Windows Only)", but there are no builds in the zip file.

It seems that it must be built locally. According to the instructions, this requires:

This is an extremely cumbersome way to try out the latest software, especially when users are asked to do it before submitting bug reports or feature requests.

If the OpenToonz installer had an option to simply unpack the contents to a self-contained folder, users could try out new features without uninstalling or overwriting the latest stable release.

It would also obviate the risks involved in migrating projects from one stable release to the next: if the new version doesn't function quite as expected, the user could immediately move back to the anterior one.

I hope the team will consider either adding a "Portable" option in the installation settings, for all supported platforms, or at least adding an alternate portable version for new releases.

Thank you.

(Platform: Windows 10)

RodneyBaker commented 3 years ago

You may be interested in this feature request: opentoonz/opentoonz#3670

In the meantime there are a number of ways we can get access to portable releases as all windows installs can be turned into portables. There are also the github action builds that are portable and the appveyor build that is a few steps away from being a portable just requiring a renaming of directory and placement in the root directory of the Opentoonz executable.

Github Action builds for Windows, Mac and Linux can be found here: https://github.com/opentoonz/opentoonz/actions

You'll find those builds to be portable.

RodneyBaker commented 3 years ago

Of further potential interest to this request...

The current Windows installer can ALMOST do this 'create portable' option. The problem appears to be that we cannot tell the installer where to place the Opentoonz program files which defaults to C:\Program Files\Opentoonz.

We can however indicate where we want the stuff directory to be located as well as what the directory name should be called.

Given this we can use the current installer to almost do the whole process of creating a portable. Steps: Run the WIndows installer When prompted for placement of the stuff directory use a path such as "C:\renameMe\portablestuff"

Note: The important part of this step is the name 'portablestuff'. This is required for Opentoonz to recognize that the program is portable. If Opentoonz see the portablestuff directory and its contents it will use that instead of the default location at C:\Opentoonz stuff.

Now we proceed with the rest of the installation of Opentoonz.

When complete we navigate to where Opentoonz was installed (C:\Program Files\Opentoonz) and select the constents of that directory and Copy. We then navigate to C:\renameMe\ and paste the contents

Now rename the directory 'renameMe' to an appropriate name and move the directory wherever desired. This is now a portable copy of Opentoonz.

This suggests to me that while ideally we would just adjust the installer to also contain a provision for creating a portable that by allowing the user to dictate where Opentoonz gets installed we can create a portable simply by indicating the correct paths.

IMPORTANT note; One might think that we can simply direct the stuff files to be placed at C:\Program Files\Opentoonz\portablestuff and they would be right. HOWEVER, WIndows does not like this location for portable applications and while we can use that approach we would want to copy the entire directory C:\Program Files\Opentoonz and its contents to another location such as the desktop or a USB stick to ensure the program will operate properly as created content will otherwise try to be saved into the Program Files location. I believe in most cases if the portablestuff directory is located in Program Files it will fail to run so... don't forget to remove or rename the portablestuff directory at that location in order to allow it to run. Give this a try and check out any error messages. :)

Another close option: When installing with current installer do the following:

  1. Start installation of Opentoonz as normal
  2. When prompted for location of stuff directory specify "C:\Program Files\Opentoonz\portablestuff.bak (please note the temporary .bak added to this directory name)
  3. Complete the installation
  4. Copy the Opentoonz directory and contents from C:\Program FIles\Opentoonz to the desktop (or other desired location)
  5. Open the Opentoonz directory and remove the .bak extension from the stuff directory name Run the program and it will state while loading that it is running as a portable

Why use the .bak extension?
There is a conflict between how WIndows will run the program and how Opentoonz checks for the presence of the portablestuff director (and contents). By naming the stuff directory (while installing) as "portablestuff.bak" it allows the installed program to still run but sets up the stuff directory to be used also. I want to investigate this further because rather than .bak it might be even better to specify a date (i.e. portablestuff.20210627) to facilitate archiving etc. In short, Opentoonz and Windows don't like to run with the stuff directory inside Program Files.

Perhaps more info than you desire here but I'm writing this down so that all may know more about the process of creating a portable copy of Opentoonz as well as some pitfalls to avoid in the process of manually creating a portable.

Note that the github build for WIndows is already a portable and so none of this process is required. Just downlaod, unzip the contents and run the Opentoonz.exe file.

ReturnMinusOne commented 3 years ago

Thank you.

My main motivation for posting this issue was accessing the latest version without having to build anything, which you solved by mentioning the GitHub actions.

On the Actions page, I selected the latest Windows nightly build, clicked the name, and was able to download a zip archive containing all the necessary files in one place.


I also tested your advice about turning an OpenToonz installation into a portable version.

The "Program Files" conflict didn't really affect me, since I install most software, including OpenToonz, in the "C:" root.

I uninstalled OpenToonz completely, so when I re-ran the installer, I was asked to choose the install directory (as well as the "Stuff" folder).

After installing, I moved the folder to various locations, and everything still worked; my projects and custom keyboard shortcuts remained as they were.

All I needed to relocate were FFmpeg and my test project's scene files (whose locations, logically, are stored as absolute paths since they could be anywhere on the system). Levels were also loaded without issue once the scenes were found.

(Edit: It turns out FFmpeg's location can be stored as a relative path, starting from OpenToonz's main folder. For example: "./ffmpeg".)

And by copying this portable folder, I could then uninstall OpenToonz (allowing me to choose the install directory during the next installation, if need be) and still keep a portable version after the original was deleted.

So yes, having an option in the installer would be far more convenient, but until that happens, there are still other avenues for making OpenToonz portable.

Thanks again, I had no idea these options existed. Still, I feel I should leave this issue open until it's addressed directly one way or another.

RodneyBaker commented 3 years ago

Glad to see you've had some good success. I'll close my previous feature request as it is linked to this new report. The primary difference between that one and this is my thoughts related to archiving where the program in a way becomes secondary to the production/project files... the program that was used to create the assets is archived alone with the project. If I can find a better way to present that idea I will open a new request. Your report here should be sufficent to point developers to the desire to have an option to create a portable via the installer.

ReturnMinusOne commented 3 years ago

I forgot to mention, I did see your thread when I was looking for prior issues related to portability, but I thought it was specifically about project archival, and figured it was a different topic.

The idea of exporting all of the assets for a project in a zip archive does have value, so it may be worth its own dedicated issue.

RodneyBaker commented 3 years ago

The idea of exporting all of the assets for a project in a zip archive does have value, so it may be worth its own dedicated issue.

The compressed zip file feature has been on file since back in 2016 so we have that one covered to some degree. See opentoonz/opentoonz#669 for more information.

ReturnMinusOne commented 3 years ago

I'll be glad if that gets implemented one day.

RodneyBaker commented 6 months ago

Returning to this because it is so close to being there already...

In cases where the installer determines Opentoonz is being 'installed' for the first time it allows us to set both the Program location as well as the stuff directory location. Unfortunately, subsequent uses of the installer only display the option to change the stuff directory location... it skips the dialogue allowing the Program path to be changed.

As such we only get the one chance to create a portable if we:

A question then is this: Can we modify the current installation script so that it never bypasses the option to change the Program path? I think we can... just have to discover how.

RodneyBaker commented 6 months ago

A follow up to the last post...

In cases where the user doesn't want to install Opentoonz and desires to create a portable AND has never installed Opentoonz on the system before... this is quite direct and possible.

In cases where the user does have Opentoonz previously installed a workaround to getting the installer to allow the path to be edited to facilate creation of the portable they can uninstall the program which in turn will allow the path dialogue to appear again.

I will guess the install script is checking the Windows registry to determine if Opentoonz program path has been set and if found skips that dialogue... assuming the user wishes to install to the same location.

There is certrainly potential here for having the installer create the portable but that will extend only to Windows as the Innosetup installer is Windows only.

TLDR: I confirm that when the Installer doesn't recognize Opentoonz as being previously installed we can create a portable by properly entering the paths for the program files and stuff directory in the path dialogue.

RodneyBaker commented 2 months ago

Moving this to Opentoonz Docs where the process of turning any copy of Opentoonz into a portable application can be fully described and understood as a means to move forward with an eye to the broader scope of the benefits (and constraints) involved.

Of note: During initial installation of Opentoonz... if OT has not been installed before or it is a clean install... the user can create a portable copy of Opentoonz even now by designating the correct directory locations for both program and stuff folders. Two things might be all it would take to implement this request in rough form:

This process is mostly exclusive to Windows users but there is some cross over. This aspect of differences is not well documented.