Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Howto call SRSetRestorePoint from an InstallScript


2 replies to this topic

Sebbo11

Sebbo11
  • Full Members
  • 7 posts

Posted 27 March 2014 - 15:42

Hello,

I want to call "SRSetRestorePoint" from an InstallScript but always get the exception 0x80040703 "Description: Failed to find DLL function: SrClientSRSetRestorePoint"

This is my code:

 

prototype BOOL SrClient.SRSetRestorePoint(POINTER, POINTER);
 

function NUMBER u_CreateWindowsRestorePoint()
    NUMBER nStatus;
    BOOL   bResult;
    LONG   lSequenceNumber;
begin
    RESTOREPOINTINFO.szDescription = "TestRestorePoint";
    RESTOREPOINTINFO.dwRestorePtType = APPLICATION_INSTALL;
    RESTOREPOINTINFO.dwEventType = BEGIN_SYSTEM_CHANGE;

    bResult = SRSetRestorePoint(&RESTOREPOINTINFO, &STATEMGRSTATUS);
    
    if (bResult = TRUE) then
        lSequenceNumber = STATEMGRSTATUS.llSequenceNumber;
        nStatus = STATEMGRSTATUS.nStatus;
    endif;
endif;

 

I suppose that the prototype definition is not correct but waht would be the right syntax that accepts the respective structures?

The WINAPI function definition is

BOOL SRSetRestorePoint(
  _In_   PRESTOREPOINTINFO pRestorePtSpec,
  _Out_  PSTATEMGRSTATUS pSMgrStatus
);

Regards

Sebastian


Edited by Sebbo11, 28 March 2014 - 07:15.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 March 2014 - 11:36

InstallShield should automatically create a restore point. If you really need to call the function yourself, open the DLL in Dependecy Walker and double check the exports. Maybe the function name is mangled.



Sebbo11

Sebbo11
  • Full Members
  • 7 posts

Posted 28 March 2014 - 13:02

Hello Stefan,

 

got it!!!!

The function is exported by SrClient.dll with the name 'SRSetRestorePointA'.

 

Thanks for the tip with the dependency walker.

 

Regards

Sebastian