我有一个MS Access应用程序,需要一个Inno安装程序,该安装程序可以根据Windows版本确定要安装的Access运行时。我已经阅读了Inno Setup minversion和OnlyBelowVersion,但是Inno Setup代码是个谜。我雇了一个人来做这个,但是他们放弃了,我应该用VBA,C +或...来做。
我有一个Inno安装程序可用于Access运行时2010(附加),但Access 2010运行时不起作用,因为stdole.tlb已在Windows 10 April 2018版本10.0.17134中升级。
如果Windows版本是10.0.17134或更高版本,我需要添加代码来确定安装程序的Windows版本并安装Access runtime 2016。
#include <idp.iss>
[Code]
procedure InitializeWizard();
begin
//itd_init;
// if not Windows 10 then (need to determine Windows version)
idpaddfile('https://download.microsoft.com/download/2/6/0/260AA63A-A275-
4A92-950D-
CE20B490D0B9/AccessRuntime.exe',expandconstant('{tmp}\accRt.exe'));
//itd_addfile('https://download.microsoft.com/download/C/C/2/CC28BC00-
1AF0-44B9-8A5D-9D8C8E4899BB/accessrtsp2010-kb2687444-fullfile-x86-en-
us.exe',expandconstant('{tmp}\acRtsp2.exe'));
//else
https://download.microsoft.com/download/D/B/D/DBD20EF9-A945-4768-AEB0-
617BCEA2214A/accessruntime_4288-1001_x86_en-us.exe
// end if
//Start the download after the "Ready to install" screen is shown
//itd_downloadafter(wpReady);
idpdownloadafter(wpReady);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssInstall then begin //Lets install those files that were
downloaded for us
filecopy(expandconstant('{tmp} \ accRt.exe'),expandconstant('{tmp} \ accRt.exe'),false);
filecopy(expandconstant('{tmp} \ accSp2.exe'),expandconstant('{tmp} \ accSp2.exe'),false); 结束; 结束;
[Files]
; source: https://download.microsoft.com/download/2/6/0/260AA63A-A275-4A92-
950D-CE20B490D0B9/AccessRuntime.exe; DestDir: {pf}; Flags: ignoreversion
; source: ('https://download.microsoft.com/download/C/C/2/CC28BC00-1AF0-
44B9-8A5D-9D8C8E4899BB/accessrtsp2010-kb2687444-fullfile-x86-en-us.exe');
DestDir: {pf}; Flags: ignoreversion
;[_ISToolDownload]
;Source: https://download.microsoft.com/download/C/C/2/CC28BC00-1AF0-44B9-
8A5D-9D8C8E4899BB/accessrtsp2010-kb2687444-fullfile-x86-en-us.exe; DestDir:
{pf}; DestName: Access2010SP2; Tasks:
[Run]
;Filename: {app}\accessrtsp2010-kb2687444-fullfile-x86-en-us.exe
Filename: {tmp}\AccRt.exe /extract:{tmp}\AccRT;
#include "config.xml"
Filename: {tmp}\setup.exe; Parameters: /config {tmp}\config.xml;
;Filename: {tmp}\setup.exe /config config.xml
Filename: {tmp}\accsp2.exe;