using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Install.Core.Common
{
///
/// 安装信息
///
public class InstallInfo
{
///
/// 安装目录
///
public string InstallPath { get; set; }
///
/// 执行文件相对安装目录路径
///
public string Exe { get; set; }
///
/// 快捷方式名称
///
public string Name { get; set; }
///
/// 开机自启动
///
public bool IsAutoRun { get; set; }
///
/// 版本
///
public string Version { get; set; }
///
/// 安装包 中 最新版本
///
public string NewestVersion { get; set; }
///
/// 需要更新
///
public bool NeedToUpdate { get; set; }
[Newtonsoft.Json.JsonIgnore]
///
/// 在注册表中的keyname
///
public string KeyName
{
get
{
//对Exe 转换。
//1.去掉.exe
//2.把所有 . 转为 _
return ProcessName.Replace('.', '_');
}
}
[Newtonsoft.Json.JsonIgnore]
///
/// 任务管理器中的名称
///
public string ProcessName
{
get
{
//对Exe 转换。
//1.去掉.exe
return System.IO.Path.GetFileNameWithoutExtension(Exe);
}
}
[Newtonsoft.Json.JsonIgnore]
///
/// 快捷方式路径
///
public string ShortcutPath
{
get {
return $@"{InstallPath}\{Name}.lnk";
}
}
[Newtonsoft.Json.JsonIgnore]
///
/// 执行文件 的绝对路径
///
public string ExePath
{
get {
return $@"{InstallPath}\{Exe}";
}
}
}
}