【C#】Winform解决方案打包成.exe 安装版Windows桌面应用程序

c# 将WinForm项目打包成exe安装包,并创建快捷方式 (vs2019) (可同时创建用户的程序菜单中的程序运行exe程序,及其图标(.ico格式))第五步:添加程序运行时环境1. 阅读详情
AI摘要

本文详细介绍了如何在Visual Studio 2019中使用Setup Project来打包和创建安装程序。包括安装Microsoft Visual Studio Installer Project扩展,创建Setup项目,添加项目输出,设置快捷方式和图标,以及打包后的部署和卸载流程。

踩了几天的坑,慢慢爬出来了。

帮助一下新手友人吧,高手请绕路。

IDE Version:Visual Studio 2019

1.安装Microsoft Visual Studio Installer Project

(1)打开Visual Studio 2019,扩展->管理扩展

(2)搜索install,下载图中的扩展即可(我已经安装了,所以没有下载按钮)

按照操作安装即可

2.打包

(1)右键 解决方案->添加->新建项目

(2)搜索setup->选择 Setup Project->下一步

 (3)填写项目名称、选择位置->创建

 预览

 (4)右键 项目->在文件资源管理器中打开文件夹(是右键 项目,不是解决方案)

复制所有文件 

点击Application Folder 在右边的栏粘贴

右键 Application Folder -> Add ->项目输出

选择项目->发布项->确定

 

注意:由于vs版本差异,有的版本可能没有 “发布项”,那么可以选择 “主输出” 尝试(笔者已尝试,可以使用)。

 右键 发布项 from "项目名" (Active)  -> Create Shortcut to 发布项 from "项目名" (Active)

 快捷方式生成了

 选中 快捷方式->选择icon->Browser(不想添加icon略过)

选择 Browser

 

 

 

 可以重命名

 把他拖到 User's Desktop

右键 解决方案->重新生成解决方案 

没问题 

 右键 setup1->生成

 没问题

 右键 setup1->安装

然后就傻瓜式安装就可以了

 

 如果想在其他机器安装,右键 setup1->在文件资源管理器中打开文件夹

 

 进入Debug目录

把这两个文件一起带走就行了

 

安装完成之后,桌面会生成快捷方式

 运行测试一下

 没问题

 如果要卸载,Win+r ->appwiz.cpl(控制面板->卸载程序)

找到对应程序卸载即可

将WinForm项目打包成exe安装包,并创建快捷方式 (vs2019) c# 将WinForm项目打包成exe安装包,并创建快捷方式 (vs2019) 阅读详情

相关推荐

【小白专用】WinForm项目打包成一个exe安装包教程(VS2022)

winform程序打包为安装文件

zgscwxd的博客 1万+

WinForm项目打包成一个exe安装包教程(VS2022)

右击Application Folder ---> Add ---> 文件 --->把C:\Windows\System32下的msiexec.exe文件添加到Application Folder中。右击 Application Folder ---> Add --->项目输出,选择项目、主输出 ---> 确定。右击Application Folder(应用程序文件夹)---> Add ---> 文件,将你的icon文件导入。右击您新建的Setup项目---> 属性--->点击Prerequisites…

蓝多多的小仓库 1万+

C# 创建Windows窗体应用程序(WinForm程序)

1)WinForm?Windows窗体应用程序 WinForm 是 Windows Form 的简称,是基于 .NETFramework 平台的客户端(PC软件)开发技术,一般使用C#编程。 C# WinForm 编程需要创建「Windows窗体应用程序」项目。 .NET 提供了大量 Windows 风格的控件和事件,我们...

zs1342084776的博客 4万+

C# (江湖熟手)- winform程序打包为安装文件

c# 程序打包和安装教程

qq_25702235的博客 1万+

winform嵌入外部exe文件

前段时间有个需求,就是在winform程序里嵌入外部的exe文件,经过查找资料,最终将外部的exe文件完美的嵌入到了winform窗体里了。 由于之前没怎么用过c#,所以对c#并不是很熟悉,下面我的demo中可能会有从网上荡下来的某个方法,如有侵权,可以联系我,不说了,上代码,代码里有详细的注解: using System; using System.Collections.Generic;

gao123ming的专栏 1万+

C#将网页嵌入桌面应用并打包为EXE完整教程

在现代桌面应用程序开发中,将网页内容嵌入到C#应用中已成为一种常见且高效的做法。通过使用如WebBrowser控件等技术,开发者能够在本地应用中展示HTML内容,实现与Web技术的无缝融合,从而提升界面交互能力和功能扩展性。此外,将整个C#项目打包为一个独立的.exe文件,不仅能简化部署流程,还能增强应用的可移植性和用户体验。这种方式特别适用于需要离线运行或分发给非技术人员使用的场景。本章将为读者奠定理论基础,并引出后续章节中关于控件集成、界面交互与应用打包等核心技术的深入讲解。

weixin_34520664的博客 757

C#winform打包成可安装exe文件(vs2022版本)

c#打包成可安装exe文件,可以在其他没有vs的电脑端使用

weixin_46078387的博客 8890

工业级越界行为识别数据集:YOLOv8/v9直接训练的围栏异常检测资源

越界行为识别是智能安防与工业安全中的基础视觉任务,其核心在于对人员、车辆等目标跨越物理边界(如围栏、警戒线、作业禁区)的精准检测与分割。该技术依赖于高质量实例分割标注、归一化坐标格式及场景鲁棒性设计,具备低延迟、高召回、强泛化等工程价值,广泛应用于智慧工地电子围栏、化工厂禁区告警、物流园区越界监控及变电站安全巡检等真实工业场景。本数据集以YOLOv8/v9为基准构建,提供万张实拍+合成图像、像素级Segmentation标注、分层划分与完备元数据,开箱即用,直击工业落地中数据清洗、格式转换与标注不一致等关键

weixin_30080745的博客 316

C# Winform项目打包为.exe(vs2022版本)

选中Application Folder右击 ,选中Add点击项目文件,找到你winform项目打开找到bin目录下Debug文件。全选里面的文件(踩过的坑:假如Debug文件下有你创建的配置文件夹是无法被选中的,我建议你跑到c盘用户目录下去建立配置文件夹存放你的配置文件)。选中setup1项目,点击重新生成就ok了(但是这样打包的项目在安装的时候需要有网才能安装相应的运行依赖。看下面的操作(狗头))这个目录下,并把名称改为:NDP472-KB4054530-x86-x64-AllOS-CHS.exe。

skyyayy的博客 2万+

STM32 ADC+DMA实战:手把手教你驱动XGZP6847A压力传感器(附完整代码)

本文详细介绍了如何使用STM32的ADC和DMA外设驱动XGZP6847A压力传感器,包括硬件连接、ADC配置、DMA高效传输实现以及数据处理与校准方法。通过实战案例和完整代码,帮助开发者快速掌握高精度压力数据采集技术,适用于工业控制和医疗设备等领域。

weixin_42570484的博客 404

Cesium体渲染实战:从医学CT到气象数据的3D可视化全攻略

本文详细介绍了如何利用Cesium体渲染技术实现医学CT和气象数据的3D可视化。从数据预处理到交互式渲染,涵盖了DICOM和NetCDF格式的处理技巧,以及性能优化的实战策略,帮助开发者高效处理复杂的三维数据集。

weixin_28717431的博客 420

【C#】C#调用进程打开一个exe程序

可以调用的程序可以不是C#程序,可以是其他应用程序,例如windows自带的一些工具,或者其他语言做的程序,只要是exe都可以启动进程。

杰西笔记 3576

【保姆级教程/代码】使用PRIDE PPP-AR软件解算ZTD、反演GNSS PWV,并评估精度

在本算例中,我下载了BJFS站2024年的IGS ZTD产品,用于评估PRIDE PPP-AR软件解算出ZTD结果的精度。

weixin_43910227的博客 2369

C#理论 —— Windows 窗体应用WinForm

文章目录1. WinForm - Windows窗体应用程序1.1 WinForm工程创建1.2 工具箱1.3 窗体属性1.3.1 实例:创建一个新窗体1.4 窗体事件1.4.1 实例:通过窗体的不同事件改变窗体的背景颜色1.5 窗体方法1.5.1 实例:窗体方法使用1.6 消息框MessageBox1.6.1 实例:Message的应用1.7 控件 1. WinForm - Windows窗体应用程序 WinForm 是 Windows Form 的简称,是基于 .NET Framework 平台的客户

- 2万+

LoRa项目实战:手把手教你为ESP32选配和焊接天线(从PCB到信号测试)

本文详细介绍了为ESP32选配和焊接LoRa天线的全流程,包括天线选型、PCB布局设计、焊接工艺及信号测试。重点解析了PCB板载天线、导线天线和陶瓷贴片天线的适用场景与性能特点,并提供专业的焊接技巧和信号测试方案,帮助开发者优化LoRa模块的无线通信性能。

weixin_30470643的博客 393

Windows下玩转Spark:零基础本地集群搭建与实战演示

本文详细介绍了在Windows系统下零基础搭建Spark本地集群的完整流程,包括环境准备、集群启动、实战案例演示及性能优化技巧。通过Standalone模式快速部署,结合WordCount等经典案例帮助初学者快速掌握Spark数据处理,特别适合Windows环境下的大数据开发入门学习。

weixin_33734785的博客 424

C# Winform中嵌入exe程序?

在 C# WinForms 应用程序中,有时需要嵌入外部的 EXE 程序,使得用户能够在一个统一的界面中使用多个程序。这种功能可以通过 Windows API 和一些特定的技术实现。本文将介绍如何在 WinForms 应用程序中嵌入外部 EXE 程序。什么是嵌入 EXE 程序嵌入 EXE 程序是指在一个 WinForms 应用程序中启动并显示另一个 EXE 程序的窗口。这样做的好处是可以整合多个程...

zls365365的博客 1067

51单片机智能小车

最近学校举办了一个智能小车比赛,比赛内容为用手机蓝牙控制小车拥有5个功能,分别是超声波舵机避障,测距(显示在LCD1602上), 红外跟随,循迹还有蓝牙控制小车前进后退左转又转以及停止。 文章目录 蓝牙控制所有功能 一、蓝牙控制前进后退左转右转停止 二、舵机超声波避障加测距 三、红外跟随 四、循迹 五、代码部分 六、完整代码 前言 基于51单片机的智能小车是比较基础的小车,很适合初学者学习 提示:以下是本篇文章正文内容,下面案例可供参考 一、整体思路 这款小...

m0_55977420的博客 1万+

C# Winform窗体应用程序中调用第三方Exe文件

C# Winform窗体应用程序中调用第三方Exe文件 //命名空间 using System.Runtime.InteropServices; using System.Windows.Forms; 对调用第三方exe应用程序时涉及到的接口进行简单封装 public class ThirdExeInterface { [DllImport("User32.dll", EntryPoint = "SetParent")] private static extern IntPtr SetPare

CXYLVCHF的博客 3081

无人机芯片模块技术要点分析

恶劣环境下信号稳定性:无人机在恶劣环境下工作时,遥感系统采集的信号往往很不稳定,视频信号处理芯片需要具备强抗干扰能力,能辨别脉冲脉宽为50ns以上、幅度为0V~4.5V的输入信号。这种架构能兼顾强大的运算能力和灵活的接口控制。芯片小型化:麻省理工学院的研究人员已设计出仅20平方毫米的微型芯片,可处理无人机飞行所需的惯性数据和相机图像,为微型无人机的发展奠定了基础。光子集成芯片(PIC) :研究显示,与电子芯片相比,光子计算芯片在延迟、计算容量和能效上都有数量级的提升,有望解决当前无人机系统的计算瓶颈。

YUNZHUO666的博客 1404

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

C# 实现 WinForm 全屏置顶

我们在运行一些 Windows 应用程序的时候,需要将其运行在窗体置顶的模式(使其它应用窗体无法遮挡在置顶应用窗体之上),并且进入全屏状态。本文将介绍如何使用 C# 来实现 WinForm 的全屏置顶的基本功能。

初九之潜龙勿用 7139

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C#入门教程(一)visual studio与winform

C#入门教程(一)visual studio概述1.新建项目1.1 配置所需环境1.1.1 安装Visual Studio1.1.2 安装C++、C#、桌面所需的组件1.1.3 新建工程文件夹1.2 新建C# .NET Framework框架的Windows桌面应用1.2.1 打开VS1.2.2 创建窗体1.2.3 配置新项目2. 设置前台2.1 设置主窗体前台2.1.1 设置主窗体分辨率尺寸2.1.2 设置主窗体框体标题2.2 放置控件2.2.1 放置Button2.2.2 放置Label2.2.3 放置

虎鲸不是鱼 1万+

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

C#winform嵌套另一个exe程序

一共有二种方法,也不知道作者从哪里复制来的,先感谢原作者。 首先建立一个程序,加2个按钮,为了区分,界面修改成红色。 第一种: 1.建立一个主程序,加一个panel1,为了区分背景是绿色 2.代码调用 3.所有代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.

故里2130 1万+

c# 将winform窗体应用程序编译成dll

c# 将winform窗体应用程序编译成dll 建立一个winform窗体工程 编辑窗体及功能 运行、调试 在“解决方案资源管理器”中 ,选中项目,鼠标右键“属性” 在弹出对话框中选中“应用程序” ,如图所示: 找到“输出类型”,下拉框中的值应该是“Windows 应用程序”,将其改成“类库” 设置完成以后,重新编译就会生成dll文件。 编译好的dll就在工程目录下bin\Debug 或者 bin\Release。 调用dll时需要知道的: MyWinformDl

CXYLVCHF的博客 7011

C# WinForms 中嵌入 EXE 程序

在 C# WinForms 应用程序中,有时我们希望嵌入并控制其他 EXE 程序。这可以通过 Windows 提供的 API 来实现。本文将介绍如何在 WinForms 应用程序中嵌入并控制外部 EXE 程序。什么是嵌入 EXE 程序嵌入 EXE 程序是指在一个 WinForms 应用程序中启动并控制另一个 EXE 程序的过程。这可以通过设置子窗口来实现,其中子窗口承载外部程序的窗口。实现步骤1....

zls365365的博客 840
上一篇: 【服务端】linux搭建redis集群
下一篇: 【C#UI库】NanUI学习(一) NanUIDemo、打包与测试 C# 打包成exe
一zhi小白
博客等级 码龄7年 126粉丝 19原创
评论 17
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值