zoukankan
html css js c++ java
程序安装时检查是否已经安装.NETFramework
添加新项中添加一个安装程序类
using
System;
using
System.Collections;
using
System.ComponentModel;
using
System.Configuration.Install;
using
Microsoft.Win32;
using
System.Diagnostics;
using
System.IO;
namespace
DOTNETCheck
{
/**/
///
<summary>
///
CheckDotnet 的摘要说明。
///
</summary>
[RunInstaller(
true
)]
public
class
CheckDotnet : System.Configuration.Install.Installer
{
/**/
///
<summary>
///
必需的设计器变量。
///
</summary>
private
System.ComponentModel.Container components
=
null
;
public
CheckDotnet()
{
//
该调用是设计器所必需的。
InitializeComponent();
//
TODO: 在 InitComponent 调用后添加任何初始化
}
Component Designer generated code
#region
Component Designer generated code
/**/
///
<summary>
///
设计器支持所需的方法 - 不要使用代码编辑器修改
///
此方法的内容。
///
</summary>
private
void
InitializeComponent()
{
components
=
new
System.ComponentModel.Container();
}
#endregion
public
override
void
Install(System.Collections.IDictionary stateSaver)
{
//
入口
RegistryKey key
=
null
;
key
=
Registry.LocalMachine.CreateSubKey(
"
Software\\Microsoft\\.NETFramework\\policy\\v1.0
"
);
if
(key
==
null
||
key.GetValue(
"
3705
"
)
==
null
)
{
Process MyProcess
=
new
Process();
MyProcess.StartInfo.FileName
=
"
dotnetfx.exe
"
;
MyProcess.StartInfo.WindowStyle
=
ProcessWindowStyle.Hidden;
MyProcess.Start();
MyProcess.WaitForExit();
//
等待程序执行
MyProcess.Close();
}
}
}
}
查看全文
相关阅读:
m.baidu.com/?tn=simple 开始有广告了。。。
一些话
sublime text3中如何使用PHP编译系统
遇到了一个特别有意思的题
RVS PA-1800 功放参数
TP框架修改后台路径方法
换手机号之前需要看看
layui跨域问题的解决
Send me
单细胞文章分享:Molecular Diversity of Midbrain Development in Mouse, Human, and Stem Cells
原文地址:https://www.cnblogs.com/cxd4321/p/667765.html
最新文章
C#/ASP.NET定时任务执行管理器组件–FluentScheduler定时器
MongoDB数据库的CURD的一些基本语句
Entity Framework关于SQL注入安全问题
IIS上部署Net.Core
c# 传递Null的string值导致的调用C++的dll报错 Attempted to read or write protected memory.
LinkedIn的即时消息:在一台机器上支持几十万条长连接
MySQL数据类型-decimal详解
Mongodb的安装
用C#调用C++DLL(x64),总是提示找不到DLL
golang gui library 库
热门文章
golang 编译或链接 c语言动态、静态库的方法, golang 与 c语言 相互调用
golang 删除用go get 安装的package
fish shell 下gopath的设置问题
golang使用vet进行语法检查
glide从入门到精通使用
golang使用vendor目录来管理依赖包
golang语言中的context详解,Go Concurrency Patterns: Context
awesome go library 库,推荐使用的golang库
汇编语言转换成c语言,或者汇编语言转换成golang的汇编,c语言转换成golang的方法
快捷方式文件生成方式
Copyright © 2011-2022 走看看