Innosetup doesn't copy or delete files

29 views
Skip to first unread message

Christiaan Heerze

unread,
Sep 12, 2022, 2:00:13 PM9/12/22
to innosetup
I'm using Innosetup as an alternative way to backup files and clean up folders. I know that this program isn't intended for this, but I haven't found any other alternative.

I'm trying to backup files that reside in C:\USERS\{USERNAME}\AppData\Local\VirtualStore but somehow it's not copying the files to my desired location. Same goes for C:\Windows\. Other files and folders are being backuped.

I'm also trying to empty C:\Windows\Temp but this is unsuccesfull and the same goes for C:\Windows\SoftwareDistribution.

I've also got a folder that I can copy with explorer, but somehow innosetup gives errors because some files are in use.

I'm running setup with admin privileges.

If anyone has any sollution or another program that I can use, that would be great.

Gavin Lambert

unread,
Sep 12, 2022, 7:22:05 PM9/12/22
to inno...@googlegroups.com
On 13/09/2022 06:00, Christiaan Heerze wrote:
> I'm trying to backup files that reside in
> C:\USERS\{USERNAME}\AppData\Local\VirtualStore but somehow it's not
> copying the files to my desired location. Same goes for C:\Windows\.
> Other files and folders are being backuped.

The VirtualStore folder is subject to automatic filesystem redirection.
You can disable some of this by enabling 64-bit installation mode, and
ensuring that the installer doesn't have a generic name like "setup.exe".

> I'm also trying to empty C:\Windows\Temp but this is unsuccesfull and
> the same goes for C:\Windows\SoftwareDistribution.

The temp folder likely has files in use, and the SoftwareDistribution
folder is restricted so that even admins can't fiddle with it, since
it's used for Windows Update.

> I'm running setup with admin privileges.

It's not recommended to use software running as admin to access per-user
folders. There are some circumstances under which this will work as
expected, but others where it will not.

> If anyone has any sollution or another program that I can use, that
> would be great.

It sounds like you should be using actual backup software designed for
that purpose. There are specific flags passed to the OS to indicate
that the access is intended for backup purposes, which changes behaviour.

Remember, just making the backup itself is not sufficient; you need to
be able to selectively restore individual files (and possibly to
alternative locations), otherwise recovery may cause more damage than it
solves.

If you're determined to avoid using the correct tools, you could at
least look into using RoboCopy, which has some backup features available.

Reply all
Reply to author
Forward
0 new messages