SetObjectPermissions Example

InstallShield 2016 » InstallScript Language Reference

Note • To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

//---------------------------------------------------------------------------

//

//  InstallScript Example Script

//

//  Demonstrates the SetObjectPermissions function.

//

//  This sample shows how to prevent the local administrator

//  from changing a file or any of its attributes.

//

//---------------------------------------------------------------------------

 

function OnFirstUIAfter()

    STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;

    NUMBER bvOpt1, bvOpt2;

begin

 

    SetObjectPermissions (TARGETDIR+"MyFile.exe",IS_PERMISSIONS_TYPE_FILE, "", "administrator",

                          FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_EA|FILE_WRITE_ATTRIBUTES,

                          IS_PERMISSIONS_OPTION_DENY_ACCESS);

 

end;

See Also