bNobo / needabreak

NEED A BREAK! is an application intended to help you take care of your health while you work on a computer.
GNU General Public License v3.0
8 stars 5 forks source link

Add an installer #6

Closed bNobo closed 4 years ago

bNobo commented 4 years ago

Create an installer in order to permit end-user to easily install and update the application.

bNobo commented 4 years ago

It raises several questions :

I've just discovered this extension and will take a look on it : https://marketplace.visualstudio.com/items?itemName=caphyon.AdvancedInstallerforVisualStudio2019

bNobo commented 4 years ago

Advanced Installer is definitively not an option: it is a commercial product, the free version is too limited for my needs. For instance the free version do not permit to automatically launch the application after installation.

bNobo commented 4 years ago

In order to store binaries or setup, Github recommand using Releases : https://help.github.com/en/github/managing-large-files/distributing-large-binaries

There also are several other solutions:

bNobo commented 4 years ago

I will stick using ClickOnce because it is the most convenient way to create a setup and easily allow auto-update of the application. I'll have to buy an Authenticode digital certificate one day in order to get rid of the UAC message.

I just published a v1.0.0 release with setup files attached in a zip. I also created a GitHub page to hold the update location used by ClickOnce. It should allow auto-update.

I encountered an interesting problem while testing : the setup once uploaded to git did not work anymore. It was because the ClickOnce manifest is hashed with CRLF line endings and git replace CRLF with LF during commit. The hash did not match the file anymore and the setup was considered corrupted. I have solved the problem with this command :

git config --local core.autocrlf false

It disables the automatic CRLF correction for the project.

The error in the installation logs was

[03/04/2020 18:17:59] System.Deployment.Application.InvalidDeploymentException (HashValidation)
        - Le manifeste d'application possède un hachage calculé différent de celui spécifié ou aucun hachage n'est spécifié. 
        - Source : System.Deployment
        - Trace de la pile :
            à System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
            à System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
            à System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
            à System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
            à System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
            à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
            à System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            à System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
        --- Exception interne ---
        System.Deployment.Application.InvalidDeploymentException (HashValidation)
        - Le fichier NeedABreak.exe.manifest possède un hachage calculé différent de celui spécifié dans le manifeste.
        - Source : System.Deployment
        - Trace de la pile :
            à System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, Hash hash)
            à System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, HashCollection hashCollection)
            à System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
bNobo commented 4 years ago

I put the GitHub page holding setup files in the gh-pages branch. This issue can be considered closed now.