ravibpatel/AutoUpdater.NET

AutoUpdate.NET does not install

Opened this issue · 1 comments

    AutoUpdater.Start("myxml");
    AutoUpdater.ShowSkipButton = false;
    AutoUpdater.ShowRemindLaterButton = false;
    AutoUpdater.RunUpdateAsAdmin = true;
    AutoUpdater.UpdateMode = Mode.ForcedDownload;
    AutoUpdater.ReportErrors = true;
    AutoUpdater.Mandatory = true;

The file is being downloaded to the folder where the software is already installed, it unzips the files but does not install the new version, how can I solve this to replace the old version and install the new one

I'm using netframework 4.8.

I am zipping the complete release folder with the setup and installation msi.

I need the update to be done automatically.

You should zip the updated app directly or use MSI file as update file directly. If your MSI file needs another file to work, then you can zip everything and set ExecutablePath to MSI path. For example, if your MSI file name is setup.msi then the following should work.

AutoUpdater.ExecutablePath = "setup.msi";

By default, it extracts the zip file in application directory. You can change that behavior by modifying InstallationPath. You will also need to change the ExecutablePath if you do that.

var currentDirectory = new DirectoryInfo(Application.StartupPath);
if (currentDirectory.Parent != null)
{
    AutoUpdater.InstallationPath = Path.Combine(currentDirectory.Parent.FullName, "temp");
}
AutoUpdater.ExecutablePath = "temp/setup.msi";