Sweeper
Sweeper

Reputation: 477

Installation block a determined username

once again I appeal to your help. More to the experts in the Inno Setup code.

I've tried several ways. But without success.

I need to block the installation of my application to users (entering in session of the operating system) with the username: EX?????

Ie. if the username is: Ennnnnn -> OK EXnnnnn -> No permission

(n is a number)

Can you help me. Thank you.

Upvotes: 1

Views: 134

Answers (1)

Jens A. Koch
Jens A. Koch

Reputation: 41776

I've tried several ways. But without success.

Show us some code. What have you tried so far? Anyway..

How to block installation, in case a certain username is used?

In order to get the username:

For the comparison:

  • You might work with the string functions to make sure, that a username does not start with "EX".
  • The function Pos() might help you http://www.jrsoftware.org/ishelp/topic_isxfunc_pos.htm .
  • And you could also use Copy(), to copy the first two chars and compare them
    • Prefix := Copy(GetUserNameString(), 0, 2);

Upvotes: 1

Related Questions