杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2211|回复: 0

Inno Setup 验证密码卸载

[复制链接]
发表于 2017-2-26 14:16:11 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. [Setup]
  2. AppName=UninsPassword
  3. AppVerName=UninsPassword
  4. DisableProgramGroupPage=true
  5. DisableStartupPrompt=true
  6. DefaultDirName={pf}\UninsPassword

  7. [Code]
  8. function AskPassword(): Boolean;
  9. var
  10.   Form: TSetupForm;
  11.   OKButton, CancelButton: TButton;
  12.   PwdEdit: TPasswordEdit;
  13. begin

  14.   Result := false;
  15.   Form := CreateCustomForm();
  16.   try
  17.     Form.ClientWidth := ScaleX(256);
  18.     Form.ClientHeight := ScaleY(100);
  19.     Form.Caption := '密码验证';
  20.     Form.BorderIcons := [biSystemMenu];
  21.     Form.BorderStyle := bsDialog;
  22.     Form.Center;

  23.     OKButton := TButton.Create(Form);
  24.     OKButton.Parent := Form;
  25.     OKButton.Width := ScaleX(75);
  26.     OKButton.Height := ScaleY(23);
  27.     OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 50);
  28.     OKButton.Top := Form.ClientHeight - ScaleY(23 + 10);
  29.     OKButton.Caption := '确定';
  30.     OKButton.ModalResult := mrOk;
  31.     OKButton.Default := true;

  32.     CancelButton := TButton.Create(Form);
  33.     CancelButton.Parent := Form;
  34.     CancelButton.Width := ScaleX(75);
  35.     CancelButton.Height := ScaleY(23);
  36.     CancelButton.Left := Form.ClientWidth - ScaleX(75 + 50);
  37.     CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
  38.     CancelButton.Caption := '取消';
  39.     CancelButton.ModalResult := mrCancel;
  40.     CancelButton.Cancel := True;

  41.     PwdEdit := TPasswordEdit.Create(Form);
  42.     PwdEdit.Parent := Form;
  43.     PwdEdit.Width := ScaleX(210);
  44.     PwdEdit.Height := ScaleY(23);
  45.     PwdEdit.Left := ScaleX(23);
  46.     PwdEdit.Top := ScaleY(23);


  47.     Form.ActiveControl := PwdEdit;

  48.     if Form.ShowModal() = mrOk then
  49.     begin
  50.       Result := PwdEdit.Text = 'removeme';
  51.       if not Result then
  52.             MsgBox('密码错误', mbInformation, MB_OK);
  53.     end;
  54.   finally
  55.     Form.Free();
  56.   end;
  57. end;
  58. function InitializeUninstall(): Boolean;
  59. begin
  60.   Result := AskPassword();
  61. end;
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-19 12:32 , Processed in 0.110568 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表