在Windows XP上,inno setup.exe失败,浮点除以零 [英] inno setup.exe fails with Floating point division by zero on Windows XP

查看:92
本文介绍了在Windows XP上,inno setup.exe失败,浮点除以零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了一个inno设置脚本来安装我的应用程序.生成的setup.exe将在Windows Vista/7上正确安装,但在Windows XP上因除零错误而失败. Inno示例脚本可在Windows XP上运行,因此它一定是我在做的事情. 有人可以看到我在做什么错吗?

I have setup an inno setup script that installs my application. The resulting setup.exe will install properly on windows vista/7 but fails with the division by zero error on windows xp. The inno example scripts work on windows xp so it must be something I am doing. Can anyone see what I am doing wrong?

; Script generated by the Inno Setup Script Wizard.
#define app_src_path "..\MyApp"
#define app_exe_path "..\bin"

#define file_ver GetFileVersion(app_exe_path + "\win32\MyApp.exe")
#define app_ver Delete(file_ver, 6, 2)

[Setup]
AppId={{BBB40316-958C-446B-A08D-311273214AA6}
AppName=MyApp
AppVersion={#app_ver}
UninstallDisplayName=MyApp
AppPublisher=My Company US
DefaultDirName={pf}\My Company\MyApp
DisableDirPage=yes
DefaultGroupName=My Company
DisableProgramGroupPage=yes
#emit 'OutputBaseFilename="MyApp-Setup-' + app_ver + '"'
#emit 'SetupIconFile="' + app_src_path + '\rc\MyAppIcon.ico"'
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64
WizardImageFile=ZDS.bmp
WizardSmallImageFile=ZDSsmall.bmp

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[InstallDelete]
Type: filesandordirs; Name: "{app}\MyApp";

[Files]
; x64 files
Source: "{#app_exe_path}\x64\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode

; win32 files
Source: "{#app_exe_path}\win32\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode

; platform independent
Source: "{#app_src_path}\rc\pic1-24.png"; DestDir: "{app}\rc"; Flags: ignoreversion nocompression
Source: "{#app_src_path}\rc\pic2-24.png"; DestDir: "{app}\rc"; Flags: ignoreversion nocompression
Source: "{#app_src_path}\rc\pic3-24.png"; DestDir: "{app}\rc"; Flags: ignoreversion nocompression

[Icons]
Name: "{group}\MyApp"; Filename: "{app}\MyApp.exe"
Name: "{commondesktop}\MyApp"; Filename: "{app}\MyApp.exe"; Tasks: desktopicon
Name: "{group}\{cm:UninstallProgram,MyApp}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\MyApp.exe"; Description: "{cm:LaunchProgram,MyApp}"; Flags: nowait postinstall skipifsilent

这是/LOG

2012-07-14 10:07:50.855   Log opened. (Time zone: UTC-04:00)
2012-07-14 10:07:50.855   Setup version: Inno Setup version 5.5.1 (u)
2012-07-14 10:07:50.855   Original Setup EXE: E:\MyApp-Setup-0.0.0.exe
2012-07-14 10:07:50.855   Setup command line: /SL5="$801DE,623918,137216,E:\MyApp-Setup-0.0.0.exe" /LOG
2012-07-14 10:07:50.855   Windows version: 5.1.2600 SP3  (NT platform: Yes)
2012-07-14 10:07:50.855   64-bit Windows: No
2012-07-14 10:07:50.870   Processor architecture: x86
2012-07-14 10:07:50.870   User privileges: Administrative
2012-07-14 10:07:50.885   Exception message:
2012-07-14 10:07:50.885   Message box (OK):
                          Floating point division by zero.
2012-07-14 10:07:51.654   User chose OK.
2012-07-14 10:07:51.654   Deinitializing Setup.
2012-07-14 10:07:51.654   Log closed.

我没有[code]部分,所以我很困惑MessageBox(OK)消息的来源.

I don't have a [code] section so I am confused where the MessageBox (OK) message is originating from.

推荐答案

Dan的答案的补充,不适用于注释...

Supplement to Dan's answer that wouldn't fit in a comment...

对于向导图像文件,我几乎尝试了使用GIMP 2.8作为图像编辑器对色深和操作系统(Windows 7和Windows XP)进行的所有可能排列.我得出以下结果:

For the wizard image files, I tried pretty much every possible permutation of color depth and operating system (Windows 7 and Windows XP) using GIMP 2.8 as the image editor. I came up with the following results:

使用什么颜色深度都无关紧要; 8位,16位,24位或32位.考虑到这一点很有意义,因为Windows XP确实在桌面上支持32位图标. 请参见下面的编辑

Dan在谈到位图中的"corrupt"标题时将其钉在了头上.事实证明它没有损坏.默认情况下,GIMP 2.8将色彩空间信息"保存在位图文件的标题中. Innosetup或Windows XP(我不确定是哪个)不知道如何正确解释此信息.

Dan nailed it on the head when he talked about the 'corrupt' header in the bitmap. It turns out that it is not corrupt. By default, GIMP 2.8 saves 'color space information' in the header of the bitmap file. Innosetup or Windows XP (I'm not sure which) doesn't know how to properly interpret this information.

关键是要确保该颜色空间信息没有保存在位图文件中.从GIMP 2.8导出位图时,您可以选择选中不写色彩空间信息"选项,如下图所示.

The key is to make sure that this color space information is not saved in the bitmap file. When exporting a bitmap from GIMP 2.8, you have the option to check the 'Do not write color space information' option as shown in the image below.

编辑 2014年3月20日

EDIT 2014-Mar-20

一些更新的信息:在InnoSetup版本5.5.4(在Windows 7 64位OS上运行和安装)中,将上述方法与32位图像一起使用时,在运行已编译的安装文件时会出现bitmap image is not valid错误.

Some updated information: In InnoSetup version 5.5.4 (running and installing on Windows 7 64-bit OS), using the above method with 32-bit images gives a bitmap image is not valid error when the compiled install file is run.

更改为仍然没有色彩空间信息的24位图像,可以解决此问题.

Changing to a 24-bit image, still without the color space information, resolved the issue.

这篇关于在Windows XP上,inno setup.exe失败,浮点除以零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆