cryptomator / cryptomator-win

Cryptomator .exe installer for Windows
GNU General Public License v3.0
21 stars 12 forks source link

Silent installation flags are not honored by Dokan installer #38

Closed luislavena closed 3 years ago

luislavena commented 3 years ago

Hello folks,

Was trying to update winget manifest for Cryptomator and seems that recent versions of the integrated Dokan installer are no longer honoring the silent installation flags, which is causing failure for unattended installation.

You can see the details here: https://github.com/microsoft/winget-pkgs/pull/5568#issuecomment-751407775

Seems Dokan installer are invoked directly with msiexec, but no other flag/options are passed.

Do you have a recommendation to deal with this?

Thank you in advance for your time and making Cryptomator available on Windows! ❤️ ❤️ ❤️

Cheers.

overheadhunter commented 3 years ago

We're no experts in installers. Seems like you are, though. 😉 So I guess, if you're willing to give feedback and are patient with us, we can improve the situation significantly. @infeo experimented with a MSI based installer recently. This should simplify automation.

luislavena commented 3 years ago

Hello @overheadhunter, thank you for your promptly response. Definitely can help in any way that is possible! 😸

I'm not up-to-date with MSI installers capabilities (last time was 2010 with WiX), so I assume that by changing Cryptomator installer to MSI, you could use Dokan MSI directly: https://github.com/dokan-dev/dokany/wiki/How-to-package-your-application-with-Dokan#msi-files-and-wix

But for experience I know that changing installer technology involves a lot of effort, so perhaps we can take a shortcut and use some combination of msiexec flags and Pascal scripting to detect the options selected by the user.

I'm not sure I've a suitable environment to compile Cryptomator locally in order to build the installer, but will happily contribute with feedback and changes on the existing installer if those are welcome.

Thank you again for your fast response and for sharing Cryptomator with all of us. ❤️ ❤️ ❤️

Have a nice weekend!

infeo commented 3 years ago

so perhaps we can take a shortcut and use some combination of msiexec flags and Pascal scripting to detect the options selected by the user.

Luckily, SO already delivers the answer on how to do it with Innosetup: https://stackoverflow.com/a/38359089/11761871

Still, the goal is to lift the crrently experimental msi package into a fully featured installer.

infeo commented 3 years ago

@luislavena is it enough to pass the silent/verysilent flags to dokan or do we need more flags? In the latter case i don't think we should continue here with innosetup, since a whole pascal section of converting innosetup flags to their msi equivalent would be needed.

luislavena commented 3 years ago

Hello @infeo, I think it should be enough, but need to confirm if Dokan needs /norestart to avoid restarting when finished installing the package.

Will be doing a quick test in a VM shortly and let you know if those settings will be enough. Also will build the installer locally for testing in that VM too.

luislavena commented 3 years ago

Hello @infeo, thank you for your patience.

Been out-of-date in relation to dev tools on Windows itself that was not able to test building the installer fully 😥

But, I was able to confirm within a Windows Sandbox that is not necessary to pass /norestart to Dokan for the installation to complete without automatically reboot. 😊

Let me know if there is anything else I can provide you.

Once again, thank you for your promptly responses and your hard work on Cryptomator! ❤️ ❤️ ❤️

Cheers.

infeo commented 3 years ago

@luislavena There is indeed another question. The installation of Cryptomator is blocked (and a message is shown), if there is an outdated Dokan driver installed on the system. Hence, also an update of Cryptomator would fail, if it is shipped with a newer Dokany version.

Is this behaviour for winget packages acceptable or does an installation always have to work (or return an error or something else)?

luislavena commented 3 years ago

@infeo winget is a bit limited so it cannot use dependencies (https://github.com/microsoft/winget-cli/issues/163), neither does package upgrades, yet.

Does the installer return an error when failed installation, or just display a message?

If Cryptomator failed to be installed (due the Dokan incompatibility) and return an error, I think is OK to accept that error scenario and allow the user to install dokan manually (winget install dokan) before installing Cryptomator.

Cheers.

luislavena commented 3 years ago

Seems that the message is not returning error to the user:

https://user-images.githubusercontent.com/4182/110959762-cad9c080-832c-11eb-9713-f55a0147c47b.mp4

SO to the rescue 😁: https://stackoverflow.com/a/39788977/117298

infeo commented 3 years ago

In af5d70c3ef8e341cb0c4b4813af07b93d949c658 i moved the requirement check for a supported dokan version from the component selection view to the PrepareToInstall view, which returns the correct status code if the requirement is not fullfilled.

But it seems like inno setup does not set the $? or $LASTEXITCODE variables. To test it, one needs to use Start-Process powershell command:

PS > $process = Start-Process -Wait -PassThru -FilePath `.\Cryptomator-1.5.13.exe` -ArgumentList "/silent"
PS > $process.ExitCode()
7

Edit: Added the return value.

luislavena commented 3 years ago

Was that latest version of PowerShell? I'm using Windows Sandbox to test (stock PS) and getting this after installing an incompatible version of Dokan:

PS C:\Users\WDAGUtilityAccount\Downloads> $process = Start-Process -Wait -PassThru .\Cryptomator-1.5.13-x64.exe -ArgumentList "/silent"
PS C:\Users\WDAGUtilityAccount\Downloads> $process.ExitCode
1

Really sorry for adding extra work to you @infeo, was not my intention when submitted this 😿

infeo commented 3 years ago

Was that latest version of PowerShell?

Yes, the freshly released Powershell 7.1.3.

But i would not overthink this here, I just looked for a way to check if inno setup really returns an error code and not only according to the docs. Since this is the case, i would say the feature is implemented. :-)

luislavena commented 3 years ago

Exactly! Thank you very much @infeo and if something different shows up in the future, we now have a recollection of things we tried and limitations we found 😊

Looking forward next release, once again, thank you and all involved for working and sharing Cryptomator with the world! ❤️ ❤️ ❤️