inno setup.exe fails with Floating point division by zero on Windows XP

后端 未结 3 1496
难免孤独
难免孤独 2021-02-20 02:37

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 wi

相关标签:
3条回答
  • 2021-02-20 02:47

    You can use netpbm tools to convert to a bmp. ie from png:

    pngtopnm icon.png | ppmtobmp - > icon.bmp

    The answers above seem correct, unfortunately I ended up wasting a lot of time before I found them - and I could swear I had tried to tick gimp's "no colourspace" box. And so this is what I ended up doing instead, which can be scripted to convert many icons, and may also help someone facing the same issue.

    0 讨论(0)
  • 2021-02-20 03:01

    It turns out that the problem was the WizardImageFile and WizardImageFileSmall. Was originally using 24bit bmp files. I reduced the bit depth to 16 and now the setup will work under windows xp. This also made my install package smaller so win win.

    0 讨论(0)
  • 2021-02-20 03:04

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

    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:

    It doesn't matter what color depth you use; 8-bit, 16-bit, 24-bit or 32-bit. Which makes sense when you think about it, because Windows XP does have support for 32-bit icons on the desktop. see edit below

    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.

    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.

    enter image description here

    EDIT 2014-Mar-20

    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.

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

    0 讨论(0)
提交回复
热议问题