Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 13 of 13
  1. #1
    Join Date
    Nov 2004
    Posts
    7

    Huh? I need help with %UserName%

    Hi!

    I need help with %UserName% variable.

    Example:

    If Username of computer (%UserName%) is stoja then continue installation
    of
    If is another user, (%UserName%) abort installation

    (Is user of the computer)


    Is that possible????


    Thank you!!!!!!!!!!!!!
    Oscar.

  2. #2
    Join Date
    Nov 2004
    Posts
    7

    Oops The same in %RegOwner%

    Hi again,

    Sorry, the variable is %RegOwner%.

    The examples:

    - If in %RegOwner% the user is demo then continue installation.
    - Or if in %RegOwner% the user is another then abort installation.


    Can anyone help me?

    Thanks.
    Oscar

  3. #3
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. No need to check both, just check for a negative, continuance is by default if no error occurs, i.e.

    if %RegOwner% ~= "stoja" then
    Application.Exit();
    end

    Hope that helps.

  4. #4
    Join Date
    Nov 2004
    Posts
    7

    Huh? SF 6 or 7 ?

    Hi!

    This code is compatible on SF 6 or 7?

    How to put the code?


    Thanks
    Oscar

  5. #5
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Oops, sorry, that was for 7.0...

  6. #6
    Join Date
    Nov 2004
    Posts
    7

    Arrow No probleM

    Hi!

    No problem, but in Actions if i put:

    if %RegOwner% ~= "stoja" then
    Application.Exit();
    end

    Shows a error in %

    Help me in the variable!!!!

    Thanks
    Oscar

  7. #7
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. I don't have a copy of Setup Factory 6.0 in front of me, but I'll be sure to check into it on Monday and let you know.

  8. #8
    Join Date
    Nov 2004
    Posts
    7
    Hi:


    Oh, in the Setup Factory 7?
    can you probe it?


    Thanks

    Oscar.

  9. #9
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    The SUF60 syntax is:

    Code:
    IF (!(%RegOwner% = "stoja"))
    	Abort Setup
    END IF
    You don't prefer to use %LANUser%?

  10. #10
    Join Date
    Nov 2004
    Posts
    7

    Huh? Another question..

    Hi!

    VERY THANKS for the code.

    I have another question...

    For example if the user is not stoja then close installation, but doesn't show an error.

    How to show a error before closes the setup?


    Thanks.
    Oscar

  11. #11
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    Yes, you are right Oscar. Never shut down the app without telling the user WHY.

    Use the Show Message Box action with a message like this:

    Sorry, only stoja is allowed to run this app.

    The program will now exit.


    The Message Box is really useful when you need to debug your app (to check the content of a variable at different stages).

    Another tip: You want to display a message in a screen. You can build your message through several IF statements by using a variable like %MyMessage%. To obtain the layout you want, it's useful to have a 'new line' code available.

    Example:
    Prjoject>Settings>Deisgn Time Constants: Add two values, #ASC_LF# = 10 and #ASC_CR# = 13.


    Code:
    Assign Value(%NL% = #ASC_CR##ASC_LF#)
    Assign Value(%MyMessage% = The machine is owned by %RegOwner%)  [Evaluate value as expression is UNCHECKED]
    Assign Value(%MyMessage% = %MyMessage% + %NL% + "Are you a pretender, " + %LANUser%  + "?" + %NL%  [Evaluate value as expression is CHECKED]
    Assign Value(%MyMessage% = %MyMessage% + %NL% + "You KNOW you are not allowed to run this app!" + %NL%  [Evaluate value as expression is CHECKED]
    Assign Value(%MyMessage% = %MyMessage% + "We are going to EXIT"  [Evaluate value as expression is CHECKED]
    Show Message Box(%MyMessage%)
    I loved SUF60; but SUF70 is a NEW WORLD though...

  12. #12
    Join Date
    Nov 2004
    Posts
    7

    Oops Code

    Hi csd214!

    For SUF6 the code is

    IF (!(%RegOwner% = "stoja"))
    Abort Setup
    END IF

    but..
    What is the code for the SUF7 ?



    Thanks.
    Oscar

  13. #13
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    Hi Oscar,

    the SUF70 code:
    Code:
    if SessionVar.Expand("%RegOwner%") ~= "stoja" then
    	Dialog.Message("Warning", "Only stoja has permission to run this app"
    		.."\r\nWe are going to close the program", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
    	Application.Exit();
    end

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts