INNO 常见代码

[Files]
Source: "F:\软件发布\dzj\nocompress\*"; DestDir: "{app}\data"; Flags: ignoreversion nocompression
Source: "F:\软件发布\dzj\13-1-31\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs nocompression
Source: "F:\软件发布\dzj\other\dotnetfx20.exe"; DestDir: "{tmp}"; Flags: ignoreversion dontcopy

[code]
function CheckDotNet2_0():boolean;
begin
  Result:= RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
end;

function CopyFile(): Boolean;
var ResultCode: Integer;
Psrc :string;

begin
  Psrc:= '/c xcopy '+ExpandConstant('{src}')+'\nocompress\*.* ' +ExpandConstant('{app}')+'\data\';
  Exec(ExpandConstant('{cmd}'), Psrc,'', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
  Result:=true;
end;

function InitializeSetup(): Boolean;
var Path:string;
ResultCode: Integer;
begin
   if (CheckDotNet2_0() = false) then
     begin
    ExtractTemporaryFile('F:\软件发布\dzj\other\dotnetfx20.exe');
    Exec(ExpandConstant('{tmp}/dotnetfx20.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
  end;
Result:=true;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssinstall then
  begin
    CopyFile();
  end;
end;

 

[Run]
;Filename: "{cmd}"; Parameters: "/c xcopy {src}\nocompress\*.* {app}\data"; Flags: hidewizard


[Registry]
Root: HKLM; Subkey: "Software\ShanLian"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\ShanLian\sutraSoft"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\ShanLian\sutraSoft"; ValueType: string; ValueName: "PATH"; ValueData: "{app}"
Root: HKLM; Subkey: "Software\ShanLian\sutraSoft"; ValueType: string; ValueName: "Version"; ValueData: #MyAppVersion

转载于:https://www.cnblogs.com/windrunner/archive/2013/02/02/2889742.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值