-
Oct 4th, 2007, 12:40 PM
#1
Thread Starter
Addicted Member
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.
-
Oct 4th, 2007, 03:51 PM
#2
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;
-
Aug 5th, 2013, 08:38 AM
#3
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|