getting posnull error, bad drivesletters

32 views
Skip to first unread message

Alex Polmans

unread,
Dec 19, 2025, 2:31:03 AM12/19/25
to innosetup
Good Day, 
Background
I have been using Inno Setup for years now, and love it.
I just got a new computer with Windows 11 Enterprise, and downloaded the latest Inno Setup 6.4.3.
It failed building what was working before; I think it was because the previous versions were ANSI based, and this version is UTF-8. I changed the pChar to pAnsiChar and added a couple of semi-colons and the build now completes.
My Problem
When I try to run the installer, I get into an endless loop of posnull statements.
Here is the output 
[17:07:27.722]   -- DLL function import --
[17:07:27.722]   Function and DLL name: GetVolumeI...@kernel32.dll
[17:07:27.728]   Importing the DLL function. Dest DLL name: kernel32.dll
[17:07:27.731]   Successfully imported the DLL function. Delay loaded? No
[17:07:27.737]   -- DLL function import --
[17:07:27.738]   Function and DLL name: ExitP...@kernel32.dll
[17:07:27.738]   Importing the DLL function. Dest DLL name: kernel32.dll
[17:07:27.738]   Successfully imported the DLL function. Delay loaded? No
[17:07:27.799]   sd =C:
[17:07:27.799]   drivesletters =  㩃\
[17:07:27.812]   posnull
[17:07:27.820]   Drive = ?\
[17:07:27.823]   Called GetDriveType
[17:07:27.826]   Calling Copy with drivesletters = 㩃\
[17:07:27.833]   posnull
[17:07:27.833]   posnull
[17:07:27.836]   posnull
[17:07:27.836]   posnull
[17:07:27.836]   posnull
[17:07:27.842]   posnull
[17:07:27.846]   posnull
[17:07:27.848]   posnull
...

I see that driveletters is a non-english symbol.
I also see that driveletters is type String with functions StringOfChar.

Could this be related to the pAnsiChar issue; and is this a known issue with a fix.

Thanks for any help

Alex

Bill Stewart

unread,
Dec 19, 2025, 8:57:38 AM12/19/25
to innosetup
Well, you didn't post your code. It's a little difficult to assist with code nobody can see. <grin>

I would recommend to start with a basic "shell" installer script to test your DLL function calls. One like the answer here:


You can then easily test your code. Once you get the function calls working, you can then migrate the working code over to your larger installer.

Alex Polmans

unread,
Dec 19, 2025, 1:41:35 PM12/19/25
to innosetup
My mistake, the code is attached.
I also noted that there was an update available, so I installed that and tried it again with the same result.
I'm starting down the path of basic shell installer script as suggested. 
I must note that this script worked on previous versions of InnoSetup (but, not having that computer anymore, I cannot say which version, sorry), My original question was to find out if this was a known error with the change from ANSI to UTF-8. From your answer, Bill. I am going assume that it is unknown.  

Thank you so much for a quick reply.

Alex

mconnect update.iss

Martijn Laan

unread,
Dec 19, 2025, 2:09:47 PM12/19/25
to innosetup
Hi,

You should revert your PAnsiChar type back to PChar. Use PChar/String/Char only. The problem is that you're calling GetVolumeInformationA instead of GetVolumeInformationW.

Also see https://jrsoftware.org/ishelp/index.php?topic=unicode

ANSI versus UTF8 encoding is unrelated.

6.4.3 is not the latest version by the way, you should use 6.6.1instead.

The version on your old PC must have been one that wasn't updated for many years? Updating more often is recommended.

Why are you importing GetVolumeInformation by the way? And why ExitProcess? Especially the latter doesn't sound good.

Greetings,
Martijn



-------- Original Message --------
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/6e739adb-ed29-41be-a04b-3fa856db8d06n%40googlegroups.com.

Alex Polmans

unread,
Dec 19, 2025, 2:46:44 PM12/19/25
to innosetup
Thank you, Martin,
I had updated to 6.6.1 earlier today.   My Pascal is decades out of date, but I decided to follow my ANSI / UTF-8 feeling and took a look at the current Pascal types for Strings. There I discovered that String is now platform dependent, either AnsiString or Unicode String. I changed my code from String to AnsiString, and the program worked. 
I then saw your message about 6.6.1 being agnostic, changed everything back and now it won't compile; 

Screenshot 2025-12-19 144029.png

It just gets stranger. I checked for hidden characters.

Why GetVolumeInformation?  As part of the build process, i write the installer to a USB Drive.
Why ExitProcess?  I didn't write the code, but we do need to abort if we detect a problem.  IS there a better way?

Again, thank you for the assist.

Alex

Martijn Laan

unread,
Dec 19, 2025, 3:30:04 PM12/19/25
to innosetup
Hi Alex,

Thanks for the extra details.

In your screenshot you’re still calling GetVolumeInformationA. That’s the ANSI variant. With the current Inno Setup you should stick to the Unicode API versions instead, so GetVolumeInformationW and String parameters. Mixing String with the A functions is what causes garbled text.

Also, you’re right: there’s no PChar anymore (I misremembered). PChar/PAnsiChar were just aliases for AnsiString and not actually pointers. In other words, they had no real use and were just confusing.

Using only String (and the Unicode/W APIs) is the right direction for current scripts.

The GetVolumeInformation call is made when the installer runs, not at build time. So the “writing the installer to a USB drive as part of the build process” wouldn’t explain why you're using it. (Was asking just out of curiosity.)

Calling ExitProcess to abort is pretty blunt and can cause side effects. There are cleaner ways to abort or refuse to continue depending on what you need.

None of this is related to ANSI vs UTF-8, at all.

Greetings,
Martijn 

Op 19-12-2025 om 20:46 schreef Alex Polmans:
Thank you, Martin,
I had updated to 6.6.1 earlier today.   My Pascal is decades out of date, but I decided to follow my ANSI / UTF-8 feeling and took a look at the current Pascal types for Strings. There I discovered that String is now platform dependent, either AnsiString or Unicode String. I changed my code from String to AnsiString, and the program worked. 
I then saw your message about 6.6.1 being agnostic, changed everything back and now it won't compile; 



Alex Polmans

unread,
Dec 19, 2025, 4:39:01 PM12/19/25
to innosetup
Thank you for all the help, Martjin,
Changing the PChar to String fixed that problem, so no more AnsiString needed, :)
Changing the A calls to W calls allowed the installer to run.

And I misspoke about the GetVolumeInformation.  The purpose of the installer is to create a USB Drive that is inserted into another device to update that device. We could use a zip file, but we get more security and ease of use by distributing a .exe file. It's essentially a self-extracting zip file with a great UI. So, we need to find the USB drive at runtime.

Alex
Reply all
Reply to author
Forward
0 new messages