HOHO,发现了一个好咚咚,分享一下。

NSIS(Nullsoft Scriptable Install System)是为Windows创建安装程序的工具,开源免费。快速友好的安装程序是软件产品重要部分。文中还展示了一段打包脚本,包含安装和卸载相关的注册表写入、文件复制、快捷方式创建等操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

NSIS:

Nullsoft Scriptable Install System

An installer is the first experience of a user with your application. Slow or unsuccesful software installations are the most irritating computer problems. A quick and user friendly installer is therefore an essential part of your software product.

NSIS (Nullsoft Scriptable Install System) is a tool that allows programmers to create such installers for Windows. It is released under an open source license and is completely free for any use.

Link: http://nsis.sourceforge.net/

贴一段刚写的打包脚本看看,但愿不算泄密,God bless,可以看到基本上没有什么废话,也不需要什么注释,有点计算机和英文能力地都看得懂,老外比较搞笑,在提供的例子里居然能找到,Microsoft shit, I like f*ck sheep... 晕倒

------------------------------------------------------------------

Name "Run test"
Caption "Run's test"
OutFile "setup.exe"

LicenseText "A test text, make sure it's all there"

InstallDir "$PROGRAMFILES\SMS_Client"

Page directory
Page instfiles

Section ""

DetailPrint "Welcome to setup program..."
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "Install_Dir" "$INSTDIR"
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "AutoMoveToHistory" "true"
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "AutoCleanTrashCan" "true"
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "AutoReceiveInterval" "10"
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "TimeFormat" "HH:MI"
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "AutoCleanDays" "7"
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "AutoMoveDays" "3"
WriteRegStr "HKCU" "SOFTWARE\Comgi\TrafficStation" "WSDL" "
http://bdcb.m-mall.cn/TrafficService/services/TrafficService"

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "DisplayName" "BigNSISTest (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BigNSISTest" "UninstallString" '"$INSTDIR\bt-uninst.exe"'

SetOutPath $INSTDIR
File /a "F:\BDCB SMS Client\StationSMSClient.exe"
File /a "F:\BDCB SMS Client\data.dat"
File /a "F:\BDCB SMS Client\dotnetfx.exe"
File /a "F:\BDCB SMS Client\OnlineUpdater.exe"
File /a "F:\BDCB SMS Client\TrafficClient_1.2.0.0.dll"
File /a "F:\BDCB SMS Client\TrafficClient.chm"
File /a "F:\BDCB SMS Client\StationSMSClient.exe.config"
WriteUninstaller "uninst.exe"

CreateDirectory "$SMPROGRAMS\康击短信"
CreateShortCut "$SMPROGRAMS\康击短信\卸载程序.lnk" "$INSTDIR\uninst.exe"
CreateShortCut "$SMPROGRAMS\康击短信\短信应用.lnk" "$INSTDIR\StationSMSClient.exe"
CreateShortCut "$SMPROGRAMS\康击短信\帮助文档.lnk" "$INSTDIR\TrafficClient.chm"
CreateShortCut "$DESKTOP\短信应用.lnk" "$INSTDIR\StationSMSClient.exe"

Exec "$INSTDIR\dotnetfx.exe"

SectionEnd

Section "Uninstall"

Delete "$INSTDIR\StationSMSClient.exe"
Delete "$INSTDIR\dotnetfx.exe"
Delete "$INSTDIR\OnlineUpdater.exe"
Delete "$INSTDIR\TrafficClient_1.2.0.0.dll"
Delete "$INSTDIR\TrafficClient.chm"
Delete "$INSTDIR\StationSMSClient.exe.config"
Delete "$SMPROGRAMS\康击短信\短信应用.lnk"
Delete "$DESKTOP\短信应用.lnk"
Delete "$SMPROGRAMS\康击短信\帮助文档.lnk"
Delete "$SMPROGRAMS\康击短信\卸载程序.lnk"
Delete "$INSTDIR\uninst.exe"

SectionEnd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值