Stream.Seek ends with Access violation on version 6.3.

64 views
Skip to first unread message

Jaroslav Cap

unread,
Jun 27, 2024, 4:09:49 AM (9 days ago) Jun 27
to innosetup

Hello,

Until recently, we have been using the "SetElevationBit" procedure in our scripts as it is commonly known, for example, in this conversation (https://groups.google.com/g/innosetup/c/9ULmxjroRTk/m/2whr0UxvBAAJ).

In version 6.3, however, calling this method results in an AccessViolation error, specifically at the line where the Stream.Seek method is invoked.

We have found that setting the Position property of the stream resolves the issue for us, so this can be hotfix for some other users, but we want to report this problem in the latest version of Inno Setup. We believe that it still worked correctly in version 6.2. 

Regards, Jaroslav

Martijn Laan

unread,
Jun 28, 2024, 4:36:54 AM (8 days ago) Jun 28
to innosetup
Please try the version at https://files.jrsoftware.org/is/6/innosetup-6.3.2.exe, thanks in advance and thanks for reporting.

You should also change your Buffer variable to type AnsiString. Using type String for binary operations is not a good idea.

And you shouldn't set the elevation bit to begin with...

Greetings,
Martijn Laan

Op donderdag 27 juni 2024 om 10:09:49 UTC+2 schreef stork...@gmail.com:

Jaroslav Cap

unread,
Jun 28, 2024, 5:27:13 AM (8 days ago) Jun 28
to innosetup
Thank you Martijn,
I will try the 6.3.2 as soon as I can and let you know.

As I mentioned, we used a very popular solution from StackOverflow - of course, that's no excuse, but is there any recommended solution to this problem? We need to create a shortcut during the installation that ensures a third-party application runs with administrator privileges. Unfortunately, the application doesn’t function as required without these elevated permissions."

Regards, Jaroslav

Dne pátek 28. června 2024 v 10:36:54 UTC+2 uživatel Martijn Laan napsal:

Martijn Laan

unread,
Jun 28, 2024, 5:37:08 AM (8 days ago) Jun 28
to innosetup
Have you identified why the application requires elevated permissons exactly? I would start with that.

For example if it is because it writes configuration data to the Programs Files folder I would try to change the access rights on that data only so it can access that unelevated, instead of giving it access to the entire system by elevating.

Greetings,
Martijn Laan

Op vrijdag 28 juni 2024 om 11:27:13 UTC+2 schreef stork...@gmail.com:
Reply all
Reply to author
Forward
0 new messages