VssExpressWriter fails to add a folder non monitored files into restore point

  • Thread starter Thread starter 0lAlAl0
  • Start date Start date
0

0lAlAl0

Guest
I'm trying to use VSS Express Writer to include all the files in specific folder in the restore point when it is conducted which are crucial for my app to run.

Some of the files have extensions (mostly .txt) that is not automatically monitored (see Monitored File Name Extensions - Windows applications for all auto monitored extensions).

So I've wrote a special vssWriter for those files (see Writers - Windows applications) and expected that the OS would call its requester which would add the files at the writer to the restore set..

After running my code, the writer created successfully and is visible from `vssadmin list writers`. However, the folder isn't kept once i go back to restore point (the files aren't there..)


Currently my flow goes as follow:

  1. Register using the following code (see below).
  2. Create system restore point.
  3. Delete my folder.
  4. Restart
  5. Restore my system.

Unfortunately, I dont get my folder back..

I've tried to summarize the code in the following block :

int main()
{
::CoInitialize(NULL);

createAndRegister();

}

int createAndRegister()
{
CComPtr<IVssExpressWriter> spExpressWriter;
CComPtr<IVssCreateExpressWriterMetadata> spMetadata;

CreateVssExpressWriter(&spExpressWriter);

spExpressWriter->CreateMetadata(EXPRESS_WRITER_SAMPLE_GUID, L"Sample Express Writer", VSS_UT_USERDATA, 1, 0, 0, &spMetadata);

PCWSTR wszComponent = L"myExpressWriter";


spMetadata->SetRestoreMethod(
VSS_RME_RESTORE_AT_REBOOT, ////I've also tried it with different option of this enum
NULL,
NULL,
VSS_WRE_NEVER,
false),
L"SetRestoreMethod failed");

spMetadata->AddComponent(
VSS_CT_FILEGROUP,
NULL,
wszComponent,
wszComponent,
NULL,
0,
false,
false,
false);

spMetadata->AddFilesToFileGroup(
NULL,
wszComponent,
L"c:\\ProgramData\\myFolder",
L"*.*",
true,
NULL,
NULL),


spExpressWriter->Register();
}



I am wondering if there is a need to implement a requester to add the files to restore properly (Requesters - Windows applications).


Perhaps anyone can tell me where did i go wrong in my flow ?

Thanks

Continue reading...
 
Back
Top