/// <summary> /// Constructor /// </summary> /// <param name="sparkle">the sparkle instance</param> /// <param name="item"></param> /// <param name="appIcon">application icon</param> /// <param name="windowIcon">window icon</param> /// <param name="Unattend"><c>true</c> if this is an unattended install</param> public NetSparkleDownloadProgress(Sparkle sparkle, NetSparkleAppCastItem item, Image appIcon, Icon windowIcon, Boolean Unattend) { InitializeComponent(); if (appIcon != null) imgAppIcon.Image = appIcon; if (windowIcon != null) Icon = windowIcon; // store the item _sparkle = sparkle; _item = item; //_referencedAssembly = referencedAssembly; _unattend = Unattend; // init ui btnInstallAndReLaunch.Visible = false; lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName + " " + item.Version); progressDownload.Maximum = 100; progressDownload.Minimum = 0; progressDownload.Step = 1; // show the right Size = new Size(Size.Width, 107); lblSecurityHint.Visible = false; }
public frmLogin() { InitializeComponent(); this.Icon = Properties.Resources.MezeoVault; //this.HandleCreated += new EventHandler(frmLogin_HandleCreated); // this.HandleDestroyed += new EventHandler(frmLogin_HandleDestroyed); notificationManager = new NotificationManager(); notificationManager.NotificationHandler = this.niSystemTray; //niSystemTray.ContextMenuStrip = cmSystemTrayLogin; mezeoFileCloud = new CloudService(); LoadResources(); string RSSFeed = BasicInfo.GetUpdateURL(); TimeSpan checkFrequency = new TimeSpan(Convert.ToInt32(global::Mezeo.Properties.Resources.BrUpdateTimer), 0, 0); if (RSSFeed.Length != 0) { _sparkle = new Sparkle(RSSFeed); _sparkle.StartLoop(true, false, checkFrequency); } EventQueue.InitEventQueue(BasicInfo.MacAddress); }
/// <summary> /// Constructor /// </summary> /// <param name="sparkle">the sparkle instance</param> /// <param name="item"></param> /// <param name="appIcon">application icon</param> /// <param name="windowIcon">window icon</param> /// <param name="Unattend"><c>true</c> if this is an unattended install</param> public NetSparkleDownloadProgress(Sparkle sparkle, NetSparkleAppCastItem item, Image appIcon, Icon windowIcon, Boolean Unattend) { InitializeComponent(); if (appIcon != null) { imgAppIcon.Image = appIcon; } if (windowIcon != null) { Icon = windowIcon; } // store the item _sparkle = sparkle; _item = item; //_referencedAssembly = referencedAssembly; _unattend = Unattend; // init ui btnInstallAndReLaunch.Visible = false; lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName + " " + item.Version); progressDownload.Maximum = 100; progressDownload.Minimum = 0; progressDownload.Step = 1; // show the right Size = new Size(Size.Width, 107); lblSecurityHint.Visible = false; }
public NetSparkleCheckerWaitUI() { // init ui InitializeComponent(); // get cmdline args String[] args = Environment.GetCommandLineArgs(); #if DEBUG // enable dialog Boolean bShowDiagnosticWindow = true; #else // disable dialog Boolean bShowDiagnosticWindow = false; #endif // init sparkle _sparkle = new Sparkle(args[2], args[1], bShowDiagnosticWindow); // set labels lblRefFileName.Text = args[1]; lblRefUrl.Text = args[2]; if (_sparkle.ApplicationIcon != null) imgAppIcon.Image = _sparkle.ApplicationIcon; if (_sparkle.ApplicationWindowIcon != null) Icon = _sparkle.ApplicationWindowIcon; bckWorker.RunWorkerAsync(); }
public Form1() { InitializeComponent(); _sparkle = new Sparkle("http://www.slesa.de/download/updates/HelloSparkle/versioninfo.xml"); _sparkle.ShowDiagnosticWindow = true; _sparkle.StartLoop(true); }
public Shell() { InitializeComponent(); Application.AddMessageFilter(this); _sparkle = new Sparkle(Settings.Default.VersionInfoUri); _sparkle.ApplicationIcon = Properties.Resources.r4dio_app.ToBitmap(); _sparkle.ApplicationWindowIcon = Properties.Resources.r4dio_app; _sparkle.StartLoop(true, true); }
/// <summary> /// Secondary MainForm initialisation. /// </summary> public void Initialise() { Application.AddMessageFilter(this); bool useBeta = Preferences.StandardPreferences.UseBeta; _sparkle = new Sparkle(useBeta ? Constants.BetaAppCastURL : Constants.AppCastURL); _sparkle.installAndRelaunch += _sparkle_installAndRelaunch; _sparkle.StartLoop(true); }
public MainWindow() { InitializeComponent(); // remove the netsparkle key from registry try { Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkleTestAppWPF"); } catch { } _sparkle = new Sparkle("http://update.applimit.com/netsparkle/versioninfo.xml"); //, "NetSparkleTestApp.exe"); _sparkle.ShowDiagnosticWindow = true; _sparkle.StartLoop(true, true); }
public NetSparkleDownloadProgress(Sparkle sparkle, NetSparkleAppCastItem item, String referencedAssembly, Image appIcon, Icon windowIcon, Boolean Unattend) { InitializeComponent(); if (appIcon != null) { imgAppIcon.Image = appIcon; } if (windowIcon != null) { Icon = windowIcon; } // store the item _sparkle = sparkle; _item = item; _referencedAssembly = referencedAssembly; _unattend = Unattend; // init ui btnInstallAndReLaunch.Visible = false; lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName + " " + item.Version); progressDownload.Maximum = 100; progressDownload.Minimum = 0; progressDownload.Step = 1; // show the right Size = new Size(Size.Width, 107); lblSecurityHint.Visible = false; // get the filename of the download lin String[] segments = item.DownloadLink.Split('/'); String fileName = segments[segments.Length - 1]; // get temp path _tempName = Environment.ExpandEnvironmentVariables("%temp%\\" + fileName); // start async download WebClient Client = new WebClient(); Client.DownloadProgressChanged += Client_DownloadProgressChanged; Client.DownloadFileCompleted += Client_DownloadFileCompleted; Uri url = new Uri(item.DownloadLink); Client.DownloadFileAsync(url, _tempName); }
public Form1() { InitializeComponent(); _sparkle = new Sparkle("http://develop.waveface.com:4343/extensions/windowsUpdate/versioninfo_dev.xml") { ShowDiagnosticWindow = true, TrustEverySSLConnection = true, //EnableSystemProfiling = true, //SystemProfileUrl = new Uri("http://update.applimit.com/netsparkle/stat/profileInfo.php") }; //_sparkle.updateDetected += new UpdateDetected(_sparkle_updateDetected); //_sparkle.EnableSilentMode = true; //_sparkle.HideReleaseNotes = true; _sparkle.StartLoop(true,TimeSpan.FromSeconds(10)); }
/// <summary> /// Form to show update available /// </summary> public Form1() { InitializeComponent(); _sparkle = new Sparkle("https://update.applimit.com/netsparkle/versioninfo.xml") { ShowDiagnosticWindow = true, TrustEverySSLConnection = true, //EnableSystemProfiling = true, //SystemProfileUrl = new Uri("http://update.applimit.com/netsparkle/stat/profileInfo.php") }; _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected); //_sparkle.EnableSilentMode = true; //_sparkle.HideReleaseNotes = true; _sparkle.StartLoop(true); }
public static bool CheckDSA(Sparkle sparkle, NetSparkleAppCastItem item, String tempName) { Boolean bDSAOk = false; // check if we have a dsa signature in appcast if (item.DSASignature == null || item.DSASignature.Length == 0) { sparkle.ReportDiagnosticMessage("No DSA check needed"); bDSAOk = true; } else { // report sparkle.ReportDiagnosticMessage("Performing DSA check"); // get the assembly if (File.Exists(tempName)) { // check if the file was downloaded successfully String absolutePath = Path.GetFullPath(tempName); if (!File.Exists(absolutePath)) { throw new FileNotFoundException(); } // get the assembly reference from which we start the update progress // only from this trusted assembly the public key can be used Assembly refassembly = System.Reflection.Assembly.GetEntryAssembly(); if (refassembly != null) { // Check if we found the public key in our entry assembly if (NetSparkleDSAVerificator.ExistsPublicKey("NetSparkle_DSA.pub")) { // check the DSA Code and modify the back color NetSparkleDSAVerificator dsaVerifier = new NetSparkleDSAVerificator("NetSparkle_DSA.pub"); bDSAOk = dsaVerifier.VerifyDSASignature(item.DSASignature, tempName); } } } } return(bDSAOk); }
public NetSparkleDownloadProgress(Sparkle sparkle, NetSparkleAppCastItem item, String referencedAssembly, Image appIcon, Icon windowIcon, Boolean Unattend) { InitializeComponent(); if (appIcon != null) imgAppIcon.Image = appIcon; if (windowIcon != null) Icon = windowIcon; // store the item _sparkle = sparkle; _item = item; _referencedAssembly = referencedAssembly; _unattend = Unattend; // init ui btnInstallAndReLaunch.Visible = false; lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName + " " + item.Version); progressDownload.Maximum = 100; progressDownload.Minimum = 0; progressDownload.Step = 1; // show the right Size = new Size(Size.Width, 107); lblSecurityHint.Visible = false; // get the filename of the download lin String[] segments = item.DownloadLink.Split('/'); String fileName = segments[segments.Length - 1]; // get temp path _tempName = Environment.ExpandEnvironmentVariables("%temp%\\" + fileName); // start async download WebClient Client = new WebClient(); Client.DownloadProgressChanged += Client_DownloadProgressChanged; Client.DownloadFileCompleted += Client_DownloadFileCompleted; Uri url = new Uri(item.DownloadLink); Client.DownloadFileAsync(url, _tempName); }
public MainWindow() { InitializeComponent(); _sparkle = new Sparkle("http://mediascribe.jarrod.co.nz/appcast.xml"); _sparkle.StartLoop(true); UnityContainer unityContainer = new UnityContainer(); unityContainer.RegisterType<IController, Controller>(new ContainerControlledLifetimeManager()); //JDW NOTE: we need to set the data context BEFORE initializing the controller, since initialization //will perform a navigation that we need to catch in mainwindow's viewmodel... but AFTER creating the //the controller, since we need its reference inside the viewmodel. this.DataContext = new WindowHeaderViewModel(unityContainer); controller = unityContainer.Resolve<IController>(); //We need to register the controller with Unity, before calling the initialize method. this is why the the logic isn't housed //in the controller constructor. controller.Initialize(this, mainTabControl, unityContainer); }
public static bool CheckDSA(Sparkle sparkle, NetSparkleAppCastItem item, String tempName) { Boolean bDSAOk = false; // check if we have a dsa signature in appcast if (item.DSASignature == null || item.DSASignature.Length == 0) { sparkle.ReportDiagnosticMessage("No DSA check needed"); bDSAOk = true; } else { // report sparkle.ReportDiagnosticMessage("Performing DSA check"); // get the assembly if (File.Exists(tempName)) { // check if the file was downloaded successfully String absolutePath = Path.GetFullPath(tempName); if (!File.Exists(absolutePath)) throw new FileNotFoundException(); // get the assembly reference from which we start the update progress // only from this trusted assembly the public key can be used Assembly refassembly = System.Reflection.Assembly.GetEntryAssembly(); if (refassembly != null) { // Check if we found the public key in our entry assembly if (NetSparkleDSAVerificator.ExistsPublicKey("NetSparkle_DSA.pub")) { // check the DSA Code and modify the back color NetSparkleDSAVerificator dsaVerifier = new NetSparkleDSAVerificator("NetSparkle_DSA.pub"); bDSAOk = dsaVerifier.VerifyDSASignature(item.DSASignature, tempName); } } } } return bDSAOk; }
public NetSparkleDownloadProgress(Sparkle sparkle, NetSparkleAppCastItem item, String referencedAssembly, Image appIcon, Icon windowIcon, Boolean Unattend) { InitializeComponent(); if (appIcon != null) { imgAppIcon.Image = appIcon; } if (windowIcon != null) { Icon = windowIcon; } // store the item _sparkle = sparkle; _item = item; _referencedAssembly = referencedAssembly; _unattend = Unattend; // init ui btnInstallAndReLaunch.Visible = false; lblHeader.Text = lblHeader.Text.Replace("APP", item.AppName + " " + item.Version); progressDownload.Maximum = 100; progressDownload.Minimum = 0; progressDownload.Step = 1; // show the right Size = new Size(Size.Width, 107); lblSecurityHint.Visible = false; // get the filename of the download link String[] segments = item.DownloadLink.Split('/'); String fileName = segments[segments.Length - 1]; //trim url parameters if (fileName.LastIndexOf('?') > 0) { fileName = fileName.Substring(0, fileName.LastIndexOf('?')); } //sanitize filename fileName = MakeValidFileName(fileName); //if no extension present make msi the default extension if (Path.GetExtension(fileName).Length == 0) { fileName += ".msi"; } // get temp path _tempName = Environment.ExpandEnvironmentVariables("%temp%\\" + fileName); //check if file already exists and add counter while (File.Exists(_tempName)) { _tempName = Path.GetDirectoryName(_tempName) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(_tempName) + DateTime.Now.ToFileTimeUtc() + Path.GetExtension(_tempName); } // start async download WebClient Client = new WebClient(); Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(Client_DownloadProgressChanged); Client.DownloadFileCompleted += new AsyncCompletedEventHandler(Client_DownloadFileCompleted); Uri url = new Uri(item.DownloadLink); Client.DownloadFileAsync(url, _tempName); }
public static void Install(Sparkle sparkle, String tempName) { // get the commandline String cmdLine = Environment.CommandLine; String workingDir = Environment.CurrentDirectory; // generate the batch file path String cmd = Environment.ExpandEnvironmentVariables("%temp%\\" + Guid.NewGuid() + ".cmd"); String installerCMD; // get the file type if (Path.GetExtension(tempName).ToLower().Equals(".exe")) { // build the command line installerCMD = tempName; } else if (tempName.ToLower().EndsWith(".msi.zip")) { string unpacked = UnpackZip(tempName).First(); Install(sparkle, unpacked); return; } else if (Path.GetExtension(tempName).ToLower() == ".zip") { installerCMD = tempName; } else if (Path.GetExtension(tempName).ToLower().Equals(".msi")) { // build the command line installerCMD = "msiexec /i \"" + tempName + "\""; if (sparkle.EnableServiceMode) { installerCMD += " /qn"; } } else { sparkle.ReportDiagnosticMessage("Updater not supported, please execute " + tempName + " manually"); //MessageBox.Show("Updater not supported, please execute " + tempName + " manually", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(-1); return; } // generate the batch file sparkle.ReportDiagnosticMessage("Generating MSI batch in " + Path.GetFullPath(cmd)); StreamWriter write = new StreamWriter(cmd); if (sparkle.EnableServiceMode) write.WriteLine("net stop \"" + sparkle.ServiceName + "\""); write.WriteLine(installerCMD); write.WriteLine("cd " + workingDir); if (sparkle.EnableServiceMode) write.WriteLine("net start \"" + sparkle.ServiceName + "\""); else write.WriteLine(cmdLine); write.Close(); // report sparkle.ReportDiagnosticMessage("Going to execute batch: " + cmd); // start the installer helper Process process = new Process(); process.StartInfo.FileName = cmd; process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.Start(); // quit the app Environment.Exit(0); }
/// <summary> /// Initialize the controller. /// </summary> /// <param name="firstRun">Whether it is the first time that CmisSync is being run.</param> public virtual void Initialize(Boolean firstRun) { this.firstRun = firstRun; // Create the CmisSync folder and add it to the bookmarks bool syncFolderCreated = CreateCmisSyncFolder(); if (syncFolderCreated) { //Dont add bookmark for Oris4 AddToBookmarks(); } if (firstRun) { ConfigManager.CurrentConfig.Notifications = true; } folderLock = new FolderLock(FoldersPath); autoUpdater = new Sparkle("http://update.oris4.com/versioninfo.xml") { //ShowDiagnosticWindow = true, //EnableSystemProfiling = true, //SystemProfileUrl = new Uri("http://update.oris4.com/profile.html"), }; autoUpdater.StartLoop(true, true); }
public static void Install(Sparkle sparkle, String tempName) { // get the commandline String cmdLine = Environment.CommandLine; String workingDir = Environment.CurrentDirectory; // generate the batch file path String cmd = Environment.ExpandEnvironmentVariables("%temp%\\" + Guid.NewGuid() + ".cmd"); String installerCMD; // get the file type if (Path.GetExtension(tempName).ToLower().Equals(".exe")) { // build the command line installerCMD = "\"" + tempName + "\""; } else if (Path.GetExtension(tempName).ToLower().Equals(".msi")) { // build the command line installerCMD = "msiexec /i \"" + tempName + "\""; if (sparkle.EnableServiceMode) { installerCMD += " /qn"; } } else { sparkle.ReportDiagnosticMessage("Updater not supported, please execute " + tempName + " manually"); //MessageBox.Show("Updater not supported, please execute " + tempName + " manually", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(-1); return; } // generate the batch file sparkle.ReportDiagnosticMessage("Generating MSI batch in " + Path.GetFullPath(cmd)); // StreamWriter defaults to using an instance of UTF8Encoding // the UTF8Encoding may cause unreadable code problems in simplified Chinese OS // so I changed the encoding here StreamWriter write = new StreamWriter(cmd, true, Encoding.Default, 512); if (sparkle.EnableServiceMode) { write.WriteLine("net stop \"" + sparkle.ServiceName + "\""); } write.WriteLine(installerCMD); write.WriteLine("cd \"" + workingDir + "\""); if (sparkle.EnableServiceMode) { write.WriteLine("net start \"" + sparkle.ServiceName + "\""); } else { write.WriteLine("\"" + cmdLine + "\""); } write.Close(); // report sparkle.ReportDiagnosticMessage("Going to execute batch: " + cmd); // start the installer helper Process process = new Process(); process.StartInfo.FileName = cmd; process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.Start(); // quit the app Environment.Exit(0); }
/// <summary> /// Initiates an update check for the application. /// </summary> /// <returns>True if the update process was started successfully, false otherwise.</returns> public void CheckForUpdate() { _sparkle.StopLoop(); _sparkle = new Sparkle( String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"]) ? "http://lstratman.github.io/EasyConnect/updates/EasyConnect.xml" : ConfigurationManager.AppSettings["appCastUrl"]); _sparkle.ApplicationWindowIcon = Icon; _sparkle.ApplicationIcon = Icon.ToBitmap(); _sparkle.checkLoopFinished += _sparkle_checkLoopFinished; _sparkle.StartLoop(true, true); }
/// <summary> /// Default constructor. /// </summary> public MainForm() { InitializeComponent(); Init(); if (_sparkle == null) { _sparkle = new Sparkle( String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"]) ? "http://lstratman.github.io/EasyConnect/updates/EasyConnect.xml" : ConfigurationManager.AppSettings["appCastUrl"]); _sparkle.ApplicationWindowIcon = Icon; _sparkle.ApplicationIcon = Icon.ToBitmap(); _sparkle.StartLoop(true, true); } }
/// <summary> /// Check for product updates. /// </summary> private void mainCheckForUpdates_Click(object sender, EventArgs e) { bool useBeta = Preferences.StandardPreferences.UseBeta; _sparkle = new Sparkle(useBeta ? Constants.BetaAppCastURL : Constants.AppCastURL); // Make sure INI file changes get preserved Preferences.Save(); NetSparkleConfiguration config = _sparkle.GetApplicationConfig(); NetSparkleAppCastItem latestVersion; Boolean bUpdateRequired = _sparkle.IsUpdateRequired(config, out latestVersion); _sparkle.installAndRelaunch += _sparkle_installAndRelaunch; if (bUpdateRequired) { _sparkle.ShowUpdateNeededUI(latestVersion); } else { MessageBox.Show(String.Format(Resources.LatestVersion, Program.VersionString), Resources.LatestVersionTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } }