如题!!!
在安装包里自定义一个页面,内有RadioButton,ComboBox等,如何实现自动下载
一个附件并且自动安装这一过程,该附件链接地址已有,求高手指教,希望能给
点例子或代码,谢谢!!!
------解决方案--------------------------------------------------------
参考:
- Delphi(Pascal) code
function InitializeSetup: Boolean;var Path:string; ResultCode: Integer; dotNetV2RegPath:string; dotNetV2DownUrl:string; dotNetV2PackFile:string; begin dotNetV2RegPath:='SOFTWARE\Microsoft\.NETFramework\policy\v2.0'; dotNetV2DownUrl:='\\lg-fs\Rnd\Software\1.Free to Install\Standard\dotnet framework\2.0\NetFx20SP1_x86.exe'; dotNetV2PackFile:='{src}\NetFx20SP1_x86.exe'; if RegKeyExists(HKLM, dotNetV2RegPath) then begin Result := true; end else begin if MsgBox('.Net Framework2.0 Running Environment not installed, install it now?', mbConfirmation, MB_YESNO) = idYes then begin Path := ExpandConstant(dotNetV2PackFile); if(FileOrDirExists(Path)) then begin Exec(Path, '/q', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); if RegKeyExists(HKLM, dotNetV2RegPath) then begin Result := true; end else begin MsgBox('Fail to install .Net Framework2.0, system will be not working, setup will quit!',mbInformation,MB_OK); end end else begin if MsgBox('Install directory does not contain .Net Framework setup package锛宒o you want to download it to install now?', mbConfirmation, MB_YESNO) = idYes then begin Path := ExpandConstant('{pf}\Internet Explorer\iexplore.exe'); Exec(Path, dotNetV2DownUrl , '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); MsgBox('Please install .Net Framework2.0锛宼hen run this setup',mbInformation,MB_OK); Result := false; end else begin MsgBox('.Net Framework2.0 is not installed, system will be not working, setup will quit!',mbInformation,MB_OK); Result := false; end end end else begin MsgBox('.Net Framework2.0 is not installed, system will be not working, setup will quit!',mbInformation,MB_OK); Result := false; end; end; StopInfoLogService();end;