Browse Source

Merge commit '65bf2fb35af45c50822c16544a01a999e9df74e6' into ZhangXueYang

ZhangXueYang
zhangxueyang 3 years ago
parent
commit
9108ad10be

+ 1411
- 0
Common/system/RegistryHelper.cs
File diff suppressed because it is too large
View File


+ 77
- 2
XHZB.Desktop/App.cs View File

@@ -271,7 +271,7 @@ namespace XHZB.Desktop
271 271
             UnZipFFmpeg();
272 272
             try
273 273
             {
274
-                if (args != null&&args.Length>1)
274
+                if (args != null&&args.Length>0)
275 275
                 {
276 276
                     AESAccountStr = args[0];
277 277
                     AESPassWordStr = args[1];
@@ -283,7 +283,6 @@ namespace XHZB.Desktop
283 283
             catch (Exception ex)
284 284
             {
285 285
                 LogHelper.WriteErrLog("参数接收失败:" + ex.Message, ex);
286
-                throw;
287 286
             }
288 287
             try
289 288
             {
@@ -629,5 +628,81 @@ namespace XHZB.Desktop
629 628
             return filepath;
630 629
         }
631 630
         #endregion
631
+
632
+        #region 写入注册表
633
+        /// <summary>
634
+        /// 注册表
635
+        /// </summary>
636
+        public static RegistryHelper reg = new RegistryHelper("XHZB\\", RegDomain.ClassesRoot);
637
+
638
+        public static void WriteRegistry()
639
+        {
640
+            if(IsSubKeyExist())
641
+            {
642
+                //存在时对比位置
643
+                string regStr = ReadRegeditKey();
644
+                string pathStr = FileToolsCommon.GetFileAbsolutePath("/星火直播.exe").Replace("/","\\\\");
645
+                if(regStr!= pathStr)
646
+                {
647
+
648
+                }
649
+            }
650
+            else
651
+            {
652
+
653
+            }
654
+        }
655
+        /// <summary>
656
+        /// 判断注册表是否存在
657
+        /// </summary>
658
+        public static bool IsSubKeyExist()
659
+        {
660
+            return reg.IsSubKeyExist();
661
+        }
662
+        /// <summary>
663
+        /// 读取注册表键值
664
+        /// </summary>
665
+        /// <returns></returns>
666
+        public static string ReadRegeditKey()
667
+        {
668
+            if(reg.IsRegeditKeyExist("URL Protocol"))
669
+            {
670
+                return reg.ReadRegeditKey("URL Protocol").ToString();
671
+            }
672
+            else
673
+            {
674
+                return "";
675
+            }
676
+        }
677
+
678
+        public static void CreateRegeditKey()
679
+        {
680
+            reg.CreateSubKey();
681
+            string pathStr = FileToolsCommon.GetFileAbsolutePath("/星火直播.exe").Replace("/", "\\\\");
682
+            reg.WriteRegeditKey("@","星火直播");
683
+            reg.WriteRegeditKey("URL Protocol", pathStr);
684
+
685
+
686
+            RegistryHelper reg1 = new RegistryHelper("XHZB\\DefaultIcon\\", RegDomain.ClassesRoot);
687
+            reg1.CreateSubKey();
688
+            reg1.WriteRegeditKey("@", pathStr+",1");
689
+            //reg1.CreateSubKey("XHZB\\DefaultIcon\\");
690
+
691
+            RegistryHelper reg2 = new RegistryHelper("XHZB\\shell\\open\\command\\", RegDomain.ClassesRoot);
692
+            reg2.CreateSubKey();
693
+            reg2.WriteRegeditKey("@", "\""+pathStr + "\"\"%1\"");
694
+            //reg.CreateSubKey("XHZB\\shell\\open\\command\\");
695
+
696
+            //[HKEY_CLASSES_ROOT\XHZB]
697
+            //"URL Protocol" = "E:\\项目\\星火直播\\XHZB\\XHZB.Desktop\\bin\\Debug\\星火直播.exe"
698
+            //@= "XHZBProtocol"
699
+            //[HKEY_CLASSES_ROOT\XHZB\DefaultIcon]
700
+            //@= "E:\\项目\\星火直播\\XHZB\\XHZB.Desktop\\bin\\Debug\\星火直播.exe,1"
701
+            //[HKEY_CLASSES_ROOT\XHZB\shell]
702
+            //[HKEY_CLASSES_ROOT\XHZB\shell\open]
703
+            //[HKEY_CLASSES_ROOT\XHZB\shell\open\command]
704
+            //@= "\"E:\\项目\\星火直播\\XHZB\\XHZB.Desktop\\bin\\Debug\\星火直播.exe\"\"%1\""
705
+        }
706
+        #endregion
632 707
     }
633 708
 }

+ 16
- 0
XHZB.Desktop/LoginWindow.xaml.cs View File

@@ -71,6 +71,22 @@ namespace XHZB.Desktop
71 71
         {
72 72
             InitializeComponent();
73 73
 
74
+            //try
75
+            //{
76
+            //    MessageWindow.Show("值1:" + APP.AESAccountStr);
77
+            //    MessageWindow.Show("值2:" + APP.AESPassWordStr);
78
+            //}
79
+            //catch (Exception ex)
80
+            //{
81
+
82
+            //}
83
+
84
+            if (!APP.CheckScreenCapturerRecorder())
85
+            {
86
+                MessageWindow.Show("首次运行需安装环境,请在确定后依次点击“English-OK-Next>-Next>Install”完成安装!");
87
+                APP.InstallScreenCapturerRecorder();
88
+            }
89
+
74 90
             WindowStartupLocation = WindowStartupLocation.CenterScreen;
75 91
 
76 92
             string typestr = APP.isDebug ? "测试版" : "正式版";

+ 3
- 3
XHZB.Desktop/Properties/AssemblyInfo.cs View File

@@ -7,11 +7,11 @@ using System.Windows;
7 7
 // 有关程序集的一般信息由以下
8 8
 // 控制。更改这些特性值可修改
9 9
 // 与程序集关联的信息。
10
-[assembly: AssemblyTitle("XHZB.Desktop")]
10
+[assembly: AssemblyTitle("星火直播")]
11 11
 [assembly: AssemblyDescription("")]
12 12
 [assembly: AssemblyConfiguration("")]
13
-[assembly: AssemblyCompany("")]
14
-[assembly: AssemblyProduct("XHZB.Desktop")]
13
+[assembly: AssemblyCompany("河南星火燎原软件科技有限公司")]
14
+[assembly: AssemblyProduct("星火直播")]
15 15
 [assembly: AssemblyCopyright("Copyright ©  2021")]
16 16
 [assembly: AssemblyTrademark("")]
17 17
 [assembly: AssemblyCulture("")]

+ 0
- 7
XHZB.Desktop/ToolbarWindow.xaml.cs View File

@@ -50,13 +50,6 @@ namespace XHZB.Desktop
50 50
         public ToolbarWindow()
51 51
         {
52 52
             InitializeComponent();
53
-
54
-            if (!APP.CheckScreenCapturerRecorder())
55
-            {
56
-                MessageWindow.Show("首次运行需安装环境,请在确定后依次点击“English-OK-Next>-Next>Install”完成安装!");
57
-                APP.InstallScreenCapturerRecorder();
58
-            }
59
-
60 53
             txbName.Text = APP.LoginUser.username;
61 54
 
62 55
             heiban_btn.Click += Heiban_btn_Click;

Loading…
Cancel
Save