- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用以下脚本安装 Java 程序。我面临着这个脚本的两个问题。
如果您知道解决这些问题的方法,请告诉我。我真的很感谢你的时间
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Test"
#define MyAppVersion "1.0"
#define MyAppPublisher "Test"
#define MyAppURL "gmail.com"
#define MyAppExeName "abc.exe"
#define MinJRE "1.6"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
;(To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{200DC169-9647-4295-91B4-B1D1D8482B82}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={userdocs}\xsxsxs\bvb
DisableDirPage=yes
DefaultGroupName=test
DisableProgramGroupPage=yes
AllowNoIcons=yes
LicenseFile=C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\TemsOfUse.txt
OutputDir=C:\test\test
OutputBaseFilename=test
SetupIconFile=C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\Icon\icon.ico
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Dirs]
Name: "{app}\Graphics"
Name: "{app}\lib"
Name: "{app}\Database"
Name: "{app}\Grades"
Name: "{app}\HelpFiles"
Name: "{app}\images"
Name: "{app}\Scripts"
[Files]
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\Graphics\*"; DestDir: "{app}\Graphics"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\DataBase\*"; DestDir: "{app}\DataBase"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\Grades\*"; DestDir: "{app}\Grades"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\test"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:uninstallProgram,test}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}";check:InitializeSetup; Flags: nowait postinstall skipifsilent
[Code]
function installJRE(): Boolean;
var
Result1 : Boolean;
ErrorCode: Integer;
begin
Result1 := false;
Result1 := MsgBox('Java is required to run the program you are trying to install. Please click on Yes button given below to close this installer and be directed to a website were you can download and install Java.',
mbConfirmation, MB_YESNO) = idYes;
if Result1 = false then
begin
// user can install the Java later also
Result:=true;
end else
begin
Result:=false;
ShellExec('open', 'http://www.oracle.com/technetwork/java/javase/downloads/jre6downloads-1902815.html','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
end;
function InitializeSetup(): Boolean;
var
jreVersion: String;
begin
Result := False;
if ((RegValueExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\JavaSoft\Java Runtime Environment','CurrentVersion'))) then
begin
RegQueryStringValue(HKLM,'Software\JavaSoft\Java Runtime Environment','CurrentVersion',jreVersion);
if CompareStr(jreVersion,'{#MinJRE}') > 0 then
begin
Result:=true;
end else
begin
if(installJRE) then
Result:=true;
end;
end else
if(installJRE) then
Result:=true;
end;
end.
最佳答案
为什么 InitializeSetup 函数在用作 Check 函数时会被多次调用?
您正在使用 InitializeSetup
事件方法作为 Check
函数,是什么导致此方法被多次调用。第一次初始化设置时(作为真实事件方法)和下一次 Check
确定,文件条目是否来自 [Run]
部分应该打开。
基本上,使用事件方法 Check
功能不对。您甚至不应该手动调用它们,只需让安装程序应用程序触发它们即可。在您的情况下,而是创建一个函数来检查是否安装了 JRE 并为您的 Check
使用这样的函数.
如何获取 Java SE 运行时环境版本?
您不需要将设置作为 64 位运行。您可以简单地从 WOW 注册表节点读取以获取 64 位 Windows 上的 64 位 JRE 版本。我会尝试使用这样的东西:
[Run]
Filename: "{app}\MyApp.exe"; Flags: nowait postinstall skipifsilent; Check: IsJREInstalled
[Code]
#define MinJRE "1.6"
#define WebJRE "http://www.oracle.com/technetwork/java/javase/downloads/jre6downloads-1902815.html"
function IsJREInstalled: Boolean;
var
JREVersion: string;
begin
// read JRE version
Result := RegQueryStringValue(HKLM32, 'Software\JavaSoft\Java Runtime Environment',
'CurrentVersion', JREVersion);
// if the previous reading failed and we're on 64-bit Windows, try to read
// the JRE version from WOW node
if not Result and IsWin64 then
Result := RegQueryStringValue(HKLM64, 'Software\JavaSoft\Java Runtime Environment',
'CurrentVersion', JREVersion);
// if the JRE version was read, check if it's at least the minimum one
if Result then
Result := CompareStr(JREVersion, '{#MinJRE}') >= 0;
end;
function InitializeSetup: Boolean;
var
ErrorCode: Integer;
begin
Result := True;
// check if JRE is installed; if not, then...
if not IsJREInstalled then
begin
// show a message box and let user to choose if they want to download JRE;
// if so, go to its download site and exit setup; continue otherwise
if MsgBox('Java is required. Do you want to download it now ?',
mbConfirmation, MB_YESNO) = IDYES then
begin
Result := False;
ShellExec('', '{#WebJRE}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
end;
end;
关于inno-setup - 需要有关 Inno Setup 脚本的帮助 - 检查 jre 安装的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14783959/
我需要编辑或替换 About Setup 中的文本Inno Setup 的对话框文本。 这是一张图片: 在互联网上查看我得到了这个代码: [Files] Source: CallbackCtrl.dl
我最近发现一些旧的 PC 游戏可以在我的 Windows 10 64 位计算机上玩。我查看了各种在线资源以使游戏正常运行。现在我有兴趣为使游戏正常运行所采取的所有各种步骤创建一个自定义安装程序。我成功
是否可以获得用于 Inno Setup 安装程序的 Inno Setup 版本号? 我找不到记录的开关来返回其版本号(例如 5.5.6),而且似乎没有暴露给 Inno Setup 脚本的预定义版本常量
如何更改 setup-*.bin(Inno Setup 内部压缩存档文件)的名称、扩展名和位置 默认存档位置:{src} 我要的位置:{src}\Data(Data是一个文件夹。) 最佳答案 有很多方
这是用于 Inno Setup 的 [Setup] 部分中的 LicenseFile 属性的标准 RTF 文档: 是否可以向此页面添加打印按钮以触发打印许可协议(protocol)? 我看到了一个类似
我有一个 Inno Setup 脚本可以将我的应用程序变成一个 exe。 当我使用 Inno Setup 版本 6 编译代码时,输出文件大小为 110MB(如 Windows Explorer 大
编译了 Inno Setup 脚本 (IS v5.4.2),但是当运行生成的 Setup.exe 时,出现了一个错误对话框,内容如下: 内部错误:ExtractTemporaryFile:找不到文件“
Inno Setup - 我想创建一个类似于屏幕截图的安装程序。 安装程序应在左侧突出显示当前步骤。 如何实现? 最佳答案 @Bill_Stewart 是正确的,普通的 Inno Setup 不提供如
图像作为安装程序背景。如何使用 inno 5.5.9 做到这一点? 最佳答案 我认为这在 Inno Setup 中是不可能的。也许是一些 Inno Setup 克隆。 问题是Inno Setup中的所
这个问题在这里已经有了答案: Inno Setup - Signing fails with "Sign Tool failed with exit code 0x1" (2 个答案) 关闭 3 年
如何获取有关安装程序中包含的文件的信息(最后修改时间戳、文件大小)?通过使用文件的路径,很容易引用磁盘上的文件。但是当文件没有路径时,如何在安装程序中引用它呢? 当安装程序初始化时,我想检查磁盘上是否
Inno Setup 中的单词补全是如何工作的? 如果我在代码中的任何标识符或单词的中间或末尾按 Alt+Right,则没有任何反应。 我找不到任何要安装的扩展,也找不到该主题的 Internet 答
从这里开始:Inno Setup Placing image/control on custom page . 这是做我需要的: CustomPage := CreateCustomPage(wpLi
我的安装程序在组件页面中有一个可视错误。在您开始向下滚动页面之前看起来还不错,但开始看起来一团糟。 我认为问题出在代码中的某个地方,但仅在绝对干净的脚本上重新创建了组件部分,问题仍然存在。尝试更改缩放
如何在 Inno Setup 编译器中为我们的设置提供背景全屏图像。 喜欢下面这张图。 最佳答案 不要那样做。这违反了 Windows 设计指南。 无论如何,如果必须,请使用 WindowVisibl
如何在代码中使用 [Setup] 部分的值? 我怀疑我没有正确使用该工具;也许我应该以完全不同的方式来做这件事。 [Setup] MyValue=some value [code] function
如何自定义 Inno Setup 安装程序的欢迎页面? 我想创建一个类似于 Skype 安装程序的安装程序,只有 3 个页面: 带有一些选项的自定义欢迎页面 进度页 使用“运行程序”选项完成页面 但是
我已经为我想更新的程序创建了文件。 我希望在安装之前,检查程序是否也在标准目录中,如果不是,则正确的目录可以选择程序所在的位置。 我试过这个: [Files] Source: "C:\Data"; D
我想在您选择安装位置的页面之后创建一个自定义向导页面。 我已经在 InitializeWizard 中看到了如何创建自定义页面并将它们添加到向导中。程序。 我的问题是,当我创建自定义页面时,安装位置选
我已经安装了我的程序。但是如果我尝试再次安装它,它会安装并且程序被替换。 我看到这个问题 Inno Setup - How to display notifying message while ins
我是一名优秀的程序员,十分优秀!