Background: Customer has changed the name of the application. The application has stored files under AppData folder and now that folder needs to be copied to new name (and delete the old).
I have MSI installation build with Wix 3.6. I didn't find a standard way of copying folder (only file). So I have been trying to make a custom action which uses xcopy command but this seems to be very hard.
If I make an immediate CA and schedule it after InstallFinalize, this works on WinXP but on Win7 only by runnig the MSI as admin.
If I make a deferred CA I get access denied error. This error comes even when I tested to copy from and to folder under user folder. But deferred CA succeeds if I test it with echo command.
<CustomAction Id="CopyFolder_PropertyAssign" Property="CopyFolder"
Value=""[SystemFolder]cmd.exe" /c xcopy
"[$(var.PlatformCommonAppDataFolder)]OldName"
"[$(var.PlatformCommonAppDataFolder)]NewName"
/s /i /h /k /o /y" />
<CustomAction Id="CopyFolder" BinaryKey="WixCA" DllEntry="CAQuietExec"
Execute="deferred" Return="check" Impersonate="no" />
<Custom Action="CopyFolder_PropertyAssign" Before="InstallFinalize"></Custom>
<Custom Action="CopyFolder" After="CopyFolder_PropertyAssign"></Custom>
CAQuietExec: Access denied
CAQuietExec: Error 0x80070004: Command line returned an error.
CAQuietExec: Error 0x80070004: CAQuietExec Failed
There must be really something else than access denied because same happens under user folder as well but what an earth it is?
Or is there some other solutions for this (besides creating exe package)?
EDIT:
The folder is under all user AppData.
EDIT:
This seems to be impossible. The chosen workaround was to make an immediate CA and guide the users to start the installer as admin (or that should be the situation in most cases). Thanks for help anyway!