|
@@ -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
|
}
|