cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mwduda
Level 3

Disable PCRESTORE not working

I have a long pause at the beginning of an MSI installation on Vista. The logging shows the pause due to setting a system restore point.
I have tried using the Disable ( PCRESTORE ) command to do this, and it does not work. I found a bug listed in one of the release notes for 2009 SP1, I am using InstallShield Premier 2009 SP2.

Any advice on getting the Disable ( PCRESTORE ) command working? I have tried executing the script function in numerous custom actions during the install and it does not fix it. I also call the Is function with the SYSTEM_RESTORE_ENABLED constant and after calling Disable always returns 0.

Is there a setting that I am doing wrong? I put in a message box during the script so I know that the function is getting called.
The Custom Action is set to Synchronous ( Ignores exit code), Immediate Execution & Always Execute.

Anyone have any success using this function? It is extremely frustrating, I installed the demo trial version of 2009 just to see if upgrading to it would resolve this problem but no luck yet.
Labels (1)
0 Kudos
(3) Replies
mwduda
Level 3

To add to the mystery, I call the script function below multiple times one right after the other, the SystemRestoreIsEnableIS() returns 1 the first time, after Disable( PCRESTORE ) it returns 0, then the next time MyFunction is called it does the 1 and then 0 over again. It is as though the call to Disable(PCRESTORE) is only temporary during the function call and then the variables get reset within InstallShield.

This is incredibly frustrating.

function MyFunction(hMSI)
BOOL b;
string szMsg;
begin
b = SystemRestoreIsEnabledIS();
NumToStr( szMsg, b );
AskYesNo( szMsg, YES );
Disable( PCRESTORE );
b = SystemRestoreIsEnabledIS();
NumToStr( szMsg, b );
AskYesNo( szMsg, YES );
return ISERR_SUCCESS;
end;
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

What project type are you working with? The prototype you posted suggests you are putting this in a custom action. Unfortunately (even if it worked) that's not a good semantic match for this kind of thing. If you're using an InstallScript MSI project, you should put it in an event handler rather than a custom action. If you're using a Basic MSI, you are advised to look into the LimitSystemRestoreCheckpointing policy instead.
0 Kudos
mwduda
Level 3

It is a Basic MSI project type.
If I use an InstallScript MSI project type, which event is it best to put this in?

Thanks for the help!
0 Kudos