inno setup.exe fails with Floating point division by zero on Windows XP - 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
EDIT:
Here is the output from the /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.
I don't have a [code] section so I am confused where the MessageBox (OK) message is originating from.

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.
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.

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.

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.

Related

OpenCobol & PostgreSQL on Windows with Visual Studio

I'm currently facing a problem with this team of 4.
Using binaries I downloaded on kiska's site. I'm able to compile cobol to C and run it with cobcrun or compile it to an executable. However I can 't get opencobol to find the postgres commands.
Here is the strat of my cobol script :
identification division.
program-id. pgcob.
data division.
working-storage section.
01 pgconn usage pointer.
01 pgres usage pointer.
01 resptr usage pointer.
01 resstr pic x(80) based.
01 result usage binary-long.
01 answer pic x(80).
procedure division.
display "Before connect:" pgconn end-display
call "PQconnectdb" using
by reference "dbname = postgres" & x"00"
by reference "host = 10.37.180.146" & "00"
returning pgconn
end-call
...
the call PQconnectdb fail with module ont found : PQconnectdb
I noticed that if i rename the libpq.dll the error message change to can't find entry point. So at least I'm sure it can get my dll.
After digging into the code of the call method of the libcob library. I found it it was possible to pre load some dll using an environment variable COB_PRE_LOAD but sitll no results.
Here is what look the script to compile the cobol :
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat"
set COB_CONFIG_DIR=C:\OpenCobol\config
set COB_COPY_DIR=C:\OpenCobol\Copy
set COB_LIBS=%COB_LIBS% c:\OpenCobol\libpq.lib
set COB_LIBRARY_PATH=C:\OpenCobol\bin
set COB_PRE_LOAD=C:\OpenCobol\libpq.dll
#echo on
cobc -info
cobc -free -o pgcob -L:"C:\OpenCobol" -llibpq.lib test_cobol\postgres.cob
call cobcrun pgcob
I don't see anything missing, I'm using the 64-bit binaries from kiska's site and use the 64-bit cl.exe from Visual Studio, Postgres is a 64 bit version too (checked with dependencyChecker).
I even tryed to compile the generated C from Visual Studio, same result, but I may miss something, I'm pretty rotten in C and never really had to manage DLL or use Visual Studio.
What am I missing ?
COB_PRE_LOAD doesn't take any path or extension, see the short documentation for the available runtime configurations. I guess
set COB_LIBRARY_PATH=C:\OpenCobol\bin;C:\OpenCobol
set COB_PRE_LOAD=libpq
Will work. You can omit the C:\OpenCobol\bin if you did not placed any additional executables there.
If it doesn't work (even if it does) I'd try to get the C functions resolved at compile time. Either use
CALL STATIC "PQconnectdb" using ...
or an appropriate CALL-CONVENTION or leave the program as-is and use
cobc -free -o pgcob -L"C:\OpenCobol" -llibpq -K PQconnectdb test_cobol\postgres.cob
From cobc --help:
-K generate CALL to <entry> as static
In general: the binaries from kiska.net are quite outdated. I highly suggest getting newer ones from the official download site or ideally build them on your own from source, see the documentation for building GnuCOBOL with VisualStudio.

Which Windows SDK is required for socket programming in VC++?

My system is having Windows7 x64 operating system. I searched for SDK in Microsft's website, which is diplaying three iso files as follows:
i. GRMSDK_EN_DVD.iso
ii. GRMSDKIAI_EN_DVD.iso
iii. GRMSDKX_EN_DVD.iso
And further, there is a description which goes like this:
***select the ISO file to download based upon your CPU architecture. Additionally, you can use the CRC and SHA1 to validate that the ISO file download was successful.
x86 ISO File Name: GRMSDK_EN_DVD.iso
CRC#: 0xBD8F1237
SHA1: 0xCDE254E83677C34C8FD509D6B733C32002FE3572
x64 ISO File Name: GRMSDKX_EN_DVD.iso
CRC#: 0x04F59E55
SHA1: 0x9203529F5F70D556A60C37F118A95214E6D10B5A
Itanium ISO File Name: GRMSDKIAI_EN_DVD.iso
CRC#: 0x50EFE61D
SHA1: 0x2093EE439193EF79A1629FD9A826CE8D4DE9A93D***

Learning when was the last time a file is accessed

I was wondering if learning when was the last time a file is accessed is possible. I mean like when a .dll file in windows is used by any other program. I wonder if are there any features in any operating system that keeps a file's last access date, or extensions.
Thanks!
Unix provides the stat command or the fstat() function to fetch the last access time of a file.
eos$ stat file
File: `file'
Size: 280486 Blocks: 548 IO Block: 4096 regular file
Device: 12h/18d Inode: 1963857568 Links: 1
Access: (0600/-rw-------) Uid: (83991/ vshesha) Gid: ( 108/ abcd)
Access: 2014-09-16 15:39:09.000000000 -0400
Modify: 2014-09-16 15:39:09.000000002 -0400
Change: 2014-09-16 15:39:09.000000000 -0400
For Windows see this post
This is a feature of a filesystem/OS. In case of Windows and it's default file system NTFS, you need to enable the feature first: http://www.groovypost.com/howto/microsoft/enable-last-access-time-stamp-to-files-folder-windows-7/
In the cmd prompt, Type in "fsutil behavior set disablelastaccess 0" and press enter.
Restart your PC for changes to take affect
Usually all file systems save the file access time.
For example, take a look at NTFS for Windows. Or ext2, and older version of the file system commonly used in linux.

Gitblit services not started

After the execution of batch file in Gitblit, gitblit service won't start.
Install Java 7
Install Gitblit GO in Win 7 - 64 bit machine
Goto service and view the service status.
Win 7 - gitblit GO-1.3.2 - jdk-7u51-windows-x64
gitblit service is required to open the gitblit in browser?
Based on this following site, i exected the gitblit batch files.
http://gitblit.com/setup_go.html
Kindly let me know, what else i need to do.
Regards,
Sathishkumar Pannerselvam
Service isn't required to start Gitblit.
On Windows Envrionnement : you can use the batch script gitblit.cmd to start it. But don't forget the configuration's step in the file gitblit.properties (server.httpPort...). After you can access Gitblit with this url http:\localhost:8080
I encountered a similar problem.
But I solved as follows:
Open installService.cmd with text editor like notepad.
In line 12, I changed SET ARCH=amd64 into SET ARCH=x86. (The architecture of my computer is x86.)
Run installService.cmd by double-clicking it or run installService in Command Prompt.
CD may not be found .Try to add CD definition:
#REM arch = x86, amd64, or ia32
SET ARCH=amd64
SET CD=E:/gitblit-1.8.0
It may work.

Not getting UUID from diskutil on OSX

Running Mac OSX 10.7.5
I want to enable NTFS on a USB3 external hard disk and need the UUID to do it (http://ntfsonmac.com) but diskutil is refusing to give me the UUID. I start with:
diskutil info /Volumes/HD-PCTU3/
then from this:
diskutil info disk2s1
Device Identifier: disk2s1
Device Node: /dev/disk2s1
Part of Whole: disk2
Device / Media Name: Untitled 1
Volume Name: HD-PCTU3
Escaped with Unicode: HD-PCTU3
Mounted: Yes
Mount Point: /Volumes/HD-PCTU3
Escaped with Unicode: /Volumes/HD-PCTU3
File System Personality: NTFS
Type (Bundle): ntfs
Name (User Visible): Windows NT File System (NTFS)
Partition Type: Windows_NTFS
OS Can Be Installed: No
Media Type: Generic
Protocol: USB
SMART Status: Not Supported
Total Size: 500.1 GB (500107804672 Bytes) (exactly 976773056 512-Byte-Blocks)
Volume Free Space: 499.9 GB (499896778752 Bytes) (exactly 976360896 512-Byte-Blocks)
Device Block Size: 512 Bytes
Read-Only Media: No
Read-Only Volume: Yes
Ejectable: Yes
Whole: No
Internal: No
but as can be seen there is no UUID displayed. Any ideas why and/or how to get the UUID?
The only way I've been able to find involves a somewhat poorly documented feature of the hfs.util.
Run the diskutil command and then copy/remember/save the Device Identifier:
diskutil info /Volumes/my_drive_label | grep "Device Identifier"
You can use the hfs.util with the Device Identifier (replacing disk2s1 below) from diskutil to (re)generate a UUID for your volume:
/System/Library/Filesystems/hfs.fs/hfs.util -s disk2s1
Keep in mind this won't work for every volume, if the volume is not an HFS drive than it may not work, and other Filesystem/*.fs/*.util commands may not have a -s verb to generate UUIDs.
UPDATE
In Yosemite and after the -s flag has been disabled at the source level. I haven't been able to find a pre-modified version of hfs.util, but you can do it yourself using the information found in this Superuser question, summarized here:
Download the hfs.util source from Apple and extract it to a temporary folder
Download hfs_fsctl.h from Apple and put it in the hfs.util folder
Change line 47 of hfsutil_jnl.c into #include <hfs_fsctl.h>
Change line 80 of hfsutil_main.c into #include <System/uuid/uuid.h>
Change line 81 of hfsutil_main.c into static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC}; (replacing the include line)
Also add #define HFS_UUID_SUPPORT 1 to hfsutil_main.c
There might still be something missing in the argument parsing section if the above doesn't work, please reference the Superuser question and comment if I've missed something.
Some people have also reported that it may be possible to use Gparted to change the UUID of a drive.
I'm on Mac OS X 10.6.8 and bought NTFS 4TB Seagate USB3.0 drive.
Plugged in, Mac allowed me to read files from it, but not write to it. When I select 'Get Info' for the volume/disk, I see 'You can read only' under 'Sharing & Permissions'.
I copied a large file from Windows 10 to the USB Drive, worked fine. I then downloaded the file to Mac, worked fine, but won't allow me to write anything from Mac to the USB drive, or make any changes to it eg. delete or rename files on the USB drive.
My reason for getting this USB drive formatted in NTFS was to copy files from Mac larger than 4GB to Windows for redundant backup, because of 4GB limit in FAT.
One solution I found online was to sudo echo UUID to /etc/fstab
When I diskutil info, I don't get UUID.
I also see the following extracts:
File System Personality: NTFS
Type (Bundle): ntfs
Name (User Visible): Windows NT File System (NTFS)
&
Read-Only Media: No
Read-Only Volume: Yes
Ejectable: Yes
My solution was to download Samsung NTFS for Mac Driver from:
https://www.seagate.com/au/en/support/downloads/item/samsung-ntfs-driver-master-dl/
After installation & reboot, I noticed the following changes:
When I select 'Get Info' for the volume/disk, I see 'You can read and write' under 'Sharing & Permissions'.
2.
File System Personality: UFSD_NTFS
Type (Bundle): ufsd_NTFS
Name (User Visible): Windows NT Filesystem
3.
Read-Only Media: No
Read-Only Volume: No
Ejectable: Yes
The readme file (pdf) that comes with the download says NTFS features also work in Mac for the USB drive.
Now I can read/write to the disk, and is also visible in Finder. I've tested read & write speeds with a 2GB file, and don't see any difference in performance/speed between the NTFS & HFS+ Journaled volumes.
Finally after 2 days of reading about sudo, hfs.util & diskutil, I can now get back to backing up data from Mac 10.6 to USB NTFS drive.