Results 1 to 3 of 3

Thread: Inno Setup - Install file in user's profile

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    136

    Question Inno Setup - Install file in user's profile

    I'd imagine this has been answered before, but a few searches didn't yield anything. I need to install a file in the user's profile. Unfortunately Vista and XP have different paths for them. Is there an easy way to specify the destination directory should be the "profile", or do I have to determine if the OS is Vista or XP and then install to either c:\users\%profile% or c:\Documents and Settings\%profile%?

    Let me know if I can explain anything better.

    Thanks,
    Brian


    EDIT:
    I guess I should explain this better. For example, if I'm using ISTool and use {%UserProfile} will it work with both XP and Vista?
    Last edited by bat711; Oct 4th, 2007 at 01:59 PM.
    CodeBank: Launch IE

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Inno Setup - Install file in user's profile

    Yes, with Inno Setup you need to create code in the [Code] Section to determine if you are running on Vista then chose one folder or default to the other. ********** does this with the Users folder and you could do this with any other folder that you want. Here is and example from ********** that you can use:
    Code:
    From Inno Script
    [ Code]
    function GetAppFolder(Param: String): String;
    begin
      if InstallOnThisVersion('0,6', '0,0') = irInstall then
        Result := 'C:\Users\Public\' + ExpandConstant('{username}') 
      else
        Result := ExpandConstant('{pf}');
    end;

  3. #3
    Member
    Join Date
    Jul 2013
    Posts
    48

    Re: Inno Setup - Install file in user's profile

    Yes, there are LOTS of examples of Pascal Script, but there is nothing I can find that shows how to call the function.

    I've tried

    #define OutputFolder {Code:FunctionName}
    #define OutputFolder {Code:FunctionName()}
    #define OutputFolder {FunctionName}
    #define OutputFolder {FunctionName()}

    The compiler doesn't accept any of them...

    It just complains about the Opening Brace or "Code:" or "Undeclared identifier"

Posting Permissions

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



Click Here to Expand Forum to Full Width