王宏健的专栏 ---- 健康快乐

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

Command 程序示例,可以带参数运行

program softInfo;

uses
  Forms,
   Windows,  Dialogs,  shellapi,  inifiles,  SysUtils ;

{$R *.res}
   procedure install();
   begin
       MessageDlg('install',mtWarning,[mbOK],0) ;
   end;

   procedure uninstall();
   var iniValue,iniFile,xmlFile:string; productID:integer;
   begin
       MessageDlg('uninstall',mtWarning,[mbOK],0) ;
   end;

var
   paramName:string;
begin
   Application.Initialize;

   if ParamCount > 0 then paramName:=LowerCase(ParamStr(1));
   if (paramName='install') or (paramName='-install')  or (paramName='') then install();
   if (paramName='uninstall') or (paramName='-uninstall') then uninstall();
 
   Application.Run;
end.

///////////////////////////////////////////////////  运行示例 ////////////////////////////////

softInfo.exe -install

posted on 2004-11-29 16:58  LuckyJan  阅读(210)  评论(0)    收藏  举报