正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
很早之前记得有朋友问到如何让自己的安装包在目标机上卸载时,进行密码确认,避免本机其他用户误卸载程序。
卸载需要密码确认,那自然是在安装时由用户设置卸载密码,代码如下:
- function OnBegin()
- string szQuestion, szDefault, svResult, svValue;
- begin
- // TODO: Perform custom initialization steps, check requirements, etc.
-
- if (!MAINTENANCE) then
- // set variable value during first time install
- szQuestion = "Please enter your uninstall password";
- szDefault = "Default";
- AskText ( szQuestion , szDefault , svResult );
-
- //set the variable using the TextSub object
- TextSub.Value("MyVar") = svResult;
- else
- // retrieve value during maintenance setup
- svValue = TextSub("MyVar");
-
- szQuestion = "Please enter your uninstall password";
- szDefault = "";
- AskText ( szQuestion , szDefault , svResult );
-
- if ( StrCompare(svResult,svValue) != 0 ) then
- MessageBox("Uninstall password is invalid, please contact with your adminstrator.", SEVERE);
- abort;
- endif;
- endif;
- end;
复制代码 |