NetSparkle doesn't work in Main thread

Aug 20, 2015 at 6:47 AM
Hi,

I'm new to NetSparkle, just wondering can I use NetSparkle without winform?

I put Sparkle to main thread, doesn't seems to work.

Any help will be appreciated.

static class Program
{
    private static Sparkle _sparkle;
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        // remove the netsparkle key from registry 
        try
        {
            Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkleTestApp");
        }
        catch { }

        _sparkle = new Sparkle("http://localhost/AutoUpdate/sparkletestcast.xml")
        {
            ShowDiagnosticWindow = true,
            TrustEverySSLConnection = true,
        };

        _sparkle.updateDetected += new UpdateDetected(_sparkle_updateDetected);

        _sparkle.StartLoop(true);
        while (true)
        {

        }
    }

    static void _sparkle_updateDetected(object sender, UpdateDetectedEventArgs e)
    {
        e.NextAction = nNextUpdateAction.showStandardUserInterface;
    }
}