PDA

View Full Version : Help Delete Saved Games


buttignol
31-10-2016, 06:58
I am unable to add the User name

I'm using so but does not delete

procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usPostUninstall then
if DirExists(ExpandConstant('{%SYSTEMDRIVE%}')+'\User s\{username}\Saved Games\id Software') then
if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
DelTree(ExpandConstant('{%SYSTEMDRIVE%}')+'\Users\ {username}\Saved Games\id Software', True, True, True);
end;

Solved

With {%SystemDrive%} and {username} all tiny worked

#define SAVES "{%SystemDrive%}\Users\{UserName}\Saved Games\id Software" not
#define SAVES "{%SystemDrive%}\Users\{Username}\Saved Games\id Software" not
#define SAVES "{%SystemDrive%}\Users\{username}\Saved Games\id Software" working

Thanks

edward99
01-11-2016, 00:41
#define SAVES1 "{userappdata}\Ubisoft"
;#define SAVES2 "{userdocs}\BioWare\Mass Effect"
;#define SAVES3 "{userdocs}\BioWare\Mass Effect"

[CustomMessages]
#ifdef SAVES1
del=Do you want to delete saved games?
#endif



#ifdef SAVES1
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
if DirExists(ExpandConstant('{#SAVES1}'))
#ifdef SAVES2
or DirExists(ExpandConstant('{#SAVES2}'))
#endif
#ifdef SAVES3
or DirExists(ExpandConstant('{#SAVES3}'))
#endif
then
begin
if MsgBox(ExpandConstant('{cm:del}'),mbconfirmation, mb_yesno) = IDYES then
begin
DelTree(ExpandConstant('{#SAVES1}'), True, True, True);
#ifdef SAVES2
DelTree(ExpandConstant('{#SAVES2}'), True, True, True);
#endif
#ifdef SAVES3
DelTree(ExpandConstant('{#SAVES3}'), True, True, True);
#endif
end;
end;
end;
end;
#endif

buttignol
01-11-2016, 04:11
I appreciate your help

but does not work in the User folder name still not delete

I used so

#define SAVES1 "{%SYSTEMDRIVE%}\Users\UserName\Saved Games\id Software"

pakrat2k2
01-11-2016, 06:43
try & change UserName to {UserName} From Inno Help:

{username}
The name of the user who is running Setup or Uninstall program (as returned by the GetUserName function).

The way you have its specific, will always look for UserName ( no one uses that for a name )

buttignol
01-11-2016, 07:02
Thank Pakrat2k2

Yes already tried using {UserName} but of an error uninstall

16041