Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 11-12-2019, 13:10
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by Proxson View Post
Hi ppl,

is there a constant for Users\Username\Saved Games ? I want to delete a folder in Saved Games but to no avail. I can't find that constant on the net.

I tried:

{Userprofile}\Saved Games
{%Userprofile%}\Saved Games
%Userprofile%\Saved Games
{Username}\Saved Games

Edit: The only way is writing down the full path in Setup.ini which is SaveGameFolder3=C:\Users\*****\Saved Games\

Not a very happy solution. I can't believe that the Inno Setup developer didn't include such constant.
There is no native constant in Inno Setup for the "Saved Games" folder.
You can use something like this:
Code:
function UpdateConstant(const S: String): String;
var
  strDocs: String;
  strSaves: String;
begin
  Result := ExpandConstantEx(S, 'savedgames', ExpandConstant('{userdocs}\My Games'));
  if (GetWindowsVersion shr 24 >= 6) and (Result = ExpandConstant('{userdocs}\My Games')) then
  begin
    RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{F42EE2D3-909F-4907-8871-4C22FC0BF756}', 'RelativePath', strDocs);
    RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}', 'RelativePath', strSaves);
    StringChangeEx(Result, '\' + strDocs + '\My Games', '\' + strSaves, True);
  end;
end;
This function also expands the other constants normally:
>> MsgBox(UpdateConstant('{userdocs}'), mbInformation, MB_OK); {expands normally}
>> MsgBox(UpdateConstant('{savedgames}'), mbInformation, MB_OK);

Remembering that CIU already has an UpdateConstant function.
If it is to be used in the CIU script, change the function name such as UpdateConstant2.

Last edited by Cesar82; 11-12-2019 at 15:16.
Reply With Quote
The Following 2 Users Say Thank You to Cesar82 For This Useful Post:
Proxson (11-12-2019), Simorq (11-12-2019)
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 5 11-06-2020 02:05
[GSERIES] Custom Installer Ultimate V2g Gupta Conversion Tutorials 226 01-06-2018 13:12
Crysis 3 DVD9 to 3xDVD5 Custom Installer spawniectes PC Games - CD/DVD Conversions 79 31-08-2017 07:19



All times are GMT -7. The time now is 04:22.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com