
摘要:某些 Inno Setup 用户要求在可能的情况下要求要卸载软件的用户输入密码。例如,防病毒软件可能是此要求的候选者。下面的 Inno Setup 代码显示仅在密码正确的情况下卸载软件。此方法非常弱,很容易找到密码。因此,想要使用此策略来保护其软件免受卸载的人,需要编写更安全的代码。如果用户要卸载并且不知道密码文件是否…
某些 Inno Setup 用户要求在可能的情况下要求要卸载软件的用户输入密码。例如,防病毒软件可能是此要求的候选者。下面的 Inno Setup 代码显示仅在密码正确的情况下卸载软件。此方法非常弱,很容易找到密码。因此,想要使用此策略来保护其软件免受卸载的人,需要编写更安全的代码。如果用户要卸载并且不知道密码文件是否仍然可以从应用程序的文件夹中删除。在此示例中,卸载密码为 removeme 。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 [Code]
function AskPassword(): Boolean;
var
Form: TSetupForm;
OKButton, CancelButton: TButton;
PwdEdit: TPasswordEdit;
begin
Result := false;
Form := CreateCustomForm();
try
Form.ClientWidth := ScaleX(256);
Form.ClientHeight := ScaleY(100);
Form.Caption := '卸载密码';
Form.BorderIcons := [biSystemMenu];
Form.BorderStyle := bsDialog;
Form.Center;
OKButton := TButton.Create(Form);
OKButton.Parent := Form;
OKButton.Width := ScaleX(75);
OKButton.Height := ScaleY(23);
OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 50);
OKButton.Top := Form.ClientHeight - ScaleY(23 + 10);
OKButton.Caption := '确定';
OKButton.ModalResult := mrOk;
OKButton.Default := true;
CancelButton := TButton.Create(Form);
CancelButton.Parent := Form;
CancelButton.Width := ScaleX(75);
CancelButton.Height := ScaleY(23);
CancelButton.Left := Form.ClientWidth - ScaleX(75 + 50);
CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
CancelButton.Caption := '取消';
CancelButton.ModalResult := mrCancel;
CancelButton.Cancel := True;
PwdEdit := TPasswordEdit.Create(Form);
PwdEdit.Parent := Form;
PwdEdit.Width := ScaleX(210);
PwdEdit.Height := ScaleY(23);
PwdEdit.Left := ScaleX(23);
PwdEdit.Top := ScaleY(23);
Form.ActiveControl := PwdEdit;
if Form.ShowModal() = mrOk then
begin
Result := PwdEdit.Text = 'removeme';
if not Result then
MsgBox('密码错误:禁止卸载。', mbInformation, MB_OK);
end;
finally
Form.Free();
end;
end;
以上就是大眼仔旭为您提供的 Inno Setup 安装程序在卸载时增加卸载密码解决方案,复制以上代码到 Inno Setup 脚本中修改相关代码保存即可。
声明:大眼仔旭 | 本文采用署名-非商业性使用-相同方式共享 4.0 国际许可协议[CC BY-NC-SA]进行授权
文章名称:《为您的 Inno Setup 安装程序在卸载时增加卸载密码解决方案》
文章固定链接:https://www.dayanzai.me/inno-setup-uninstall.html
本站资源仅供个人学习交流,请于下载后 24 小时内删除,不允许用于商业用途,否则法律问题自行承担。
文章名称:《为您的 Inno Setup 安装程序在卸载时增加卸载密码解决方案》
文章固定链接:https://www.dayanzai.me/inno-setup-uninstall.html
本站资源仅供个人学习交流,请于下载后 24 小时内删除,不允许用于商业用途,否则法律问题自行承担。
转载声明
猜你喜欢
- 2022-12-21下载微软官方 Windows 7 ISO for 2018 集成补丁版本镜像
- 2015-09-04超强名片设计软件 BusinessCards MX 5.0 汉化中文免费版
- 2020-11-24韩国首尔政府推出免费商用字体 – 首尔汉江体
- 2026-01-15Simplix UpdatePack7R2 26.1.15 Windows 7 SP1/Server 2008 R2 SP1 更新补丁
- 2019-10-2124合一的PDF工具 CleverPDF 3.0.0 中文多语免费版
相关推荐
- 2022-02-24YouTube 网页视频下载器 YTD Video Downloader Pro 5.9.22.1 中文便携版
- 2025-07-15微软宣布 2026 年起 Windows 10 用户将无法再获得 Microsoft 365 新功能更新
- 2026-07-05Adobe Acrobat 优质平替 PDF 编辑器 SoftMaker FlexiPDF 2025.420 中文版
- 2021-06-04在 CentOS 7 云服务器上将 PHP 从 5.4 升级到 7.0
- 2025-10-10微星显卡超频工具 MSI Afterburner 4.6.6 Build 16757 中文免费版
全部评论: (0条)
^_^ 暂无评论!
发表评论
MORE>>微软应用
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
MORE>>安卓应用
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
MORE>>教程资源
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
MORE>>其它资源
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
最新标签
Adobe
Autodesk
ChatGPT
GitHub
Inno Setup 技巧
Inno Setup 教程
JetBrains
Linux 发行版
Linux 系统
Microsoft
Office
OpenAI
PDF 工具
PDF 编辑器
PDF 阅读器
Win10 技巧
Windows 10
Windows 10 技巧
Windows 11
Windows 11 小技巧
Windows 11 技巧
Wise Soft
WordPress 技巧
代码编辑器
免费商用字体
免费字体
免费字体下载
免费软件
办公软件
卸载工具
固态硬盘检测工具
图像处理工具
图像查看器
图像浏览器
安卓视频编辑器
安装包制作工具
屏幕录像
屏幕录像工具
屏幕录像软件
开源字体
开源软件
思维导图
截图工具
数据恢复
数据恢复工具
文本编辑器
格式转换工具
桌面录像
汉化工具
系统优化工具
系统增强
系统增强工具
编程开发
视频播放器
视频编辑器
视频转换器
视频转换工具
解压缩工具
音乐播放器
音频转换工具




