RaUI/Source/UpdateTest/Form1.cs

41 lines
1.4 KiB
C#
Raw Normal View History

using ryCommon;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UpdateTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void BtnTest_Click(object sender, EventArgs e)
{
RyFiles.DeleteFile(Application.StartupPath + "\\Update");
RyFiles.CreateDirectory(Application.StartupPath + "\\Update");
RyFiles.CopyBigFile(Application.StartupPath + "\\ryProcessManager.zip", Application.StartupPath + "\\Update\\tmp.tmp");
Storage storage = new Storage();
storage.AddNode2("id", "MainProcName");
storage.SetAttrValue("Value", "ryProcessManager.exe");
storage.AddNode2("id", "MainProcPram");
storage.SetAttrValue("Value", "q");
storage.AddNode2("id", "KillProcList2");
storage.SetAttrValue("Value", "ryProcessManager.exe".ToBase64());
storage.AddNode2("id", "DelFileList");
storage.SetAttrValue("Value", "UserDb\\1".ToBase64());
storage.SaveToFile(Application.StartupPath + "\\tmp.updx");
RyFiles.RunFile(Application.StartupPath + "\\rycUpdate.exe", "update");
this.Close();
}
}
}