mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.11k stars 104 forks source link

Portable wsltty won't install to requested folder, breaking updates #359

Open Raven-Singularity opened 1 month ago

Raven-Singularity commented 1 month ago

The installer for wsltty allows you to select an install folder, but installs it to a sub-directory of this folder.

For instance I tell the installer to install wsltty to:

C:\Portable_Apps\General\Terminal_Emulators\MinTTY-WSL

But instead it installs it to:

C:\Portable_Apps\General\Terminal_Emulators\MinTTY-WSL\wsltty

This forces me to move all the files up one level, to the location I actually requested. This move then breaks all the prebuilt wsltty shortcuts. This move also prevents me from automatically installing updates for wsltty, because the installer then puts the updated files into a sub-folder of the old files.

At that point my only options for performing an update of wsltty are:

  1. Use Windows Explorer to drag-and-drop the files inside the new folder over top of the old files to merge them. But I have messed up a lot of directory structures trying to use this merge feature in the past, now I don't trust it, and don't want to use it.
  2. Creating a custom tar archive from inside the new wsltty folder, then extracting it over the top level of my old files. But that's too much work every update.
  3. Manually dragging each folder of updated files onto the respective folder in my old install. Even more time-consuming than the previous method.
  4. Rename the folder every update to include the version number, then copy over my configuration, icons, and update my shortcuts to point to the updated location. This is the least time-consuming, but still quite frustrating -- I should be able to update my wsltty portable in-place.

I don't think the installer should demand a specific install directory name -- especially for portable apps -- which by their nature are installed to very random places like secondary hard drives or USB memory sticks.

If you simply want wsltty to be the default install folder, most wizard-style installers let you browse for a folder, and then append the default name like \wsltty\ to it. After browsing for a folder, the user can then manually erase the default sub-folder from the text before installing.

Example wizard-style installer that allows the path to be edited after choosing an install folder:

Wizard_Installer

In the wsltty installer, there is no way to edit the path after browsing for a folder, it immediately copies files to a sub-directory of the chosen folder.

There are FOSS wizard-style installers available that could avoid this issue, for example:

Inno Setup:

mintty commented 1 month ago

With most installers, the question of whether you install to a given directory or into it is quite ambiguous. However, nothing has changed in the wsltty installer, and its final installation directory has always been called wsltty. Maybe the Windows function BrowseForFolder has changed? Thanks for mentioning your favourite installer. However, when I used to take a look at them, almost every installer would need considerable time of investigation into its configuration philosophy and details, which I cannot afford, that's why wsltty uses rather primitive ancient tools for it.

Raven-Singularity commented 4 days ago

The issue is that when users choose a custom folder, that isn't where the installer installs to. It installs to a sub-folder of the chosen folder. It doesn't make sense preventing portable users from installing into a custom named folder.

mintty commented 3 days ago

About update installation: yes, I can easily check whether the selected folder already contains a wsltty installation and use it in that case, rather than a new subdirectory.

About proposing a proper subdirectory on initial install and allow to rename it: that would be a nice installer feature but the Windows folder browser function used does not offer such flexibility. Some software package provide that feature, many don't, so it does not help to claim the latter would not make sense, it's just how it is, by limitations of installer environments. I can try to provide a script that would refresh shortcuts etc. after renaming the installation folder.

About alternative installers, I commented before. Currently, wsltty uses only Windows on-board tools, which should also provide more trust in the package. If you demonstrate an easy packaging alternative with a better installer, I will consider it, but I can't spend much time into fiddling around that myself.