cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rootme
Level 4

Migrating a Basic MSI project from IS11.5 - CA problem

Hi,

I have a simple custom action that it was inserted in the Destination Folder dialog as do action when pressing Next button.

function SetLogDir(hMSI)
STRING szValue;
NUMBER nValue;
begin
MsiGetProperty(hMSI,"LOGDIR",szValue, nValue);
if (szValue == "")
then
szValue=INSTALLDIR ^ "\\Log";
MsiSetProperty(hMSI,"LOGDIR",szValue);
MessageBox(szValue,INFORMATION);
endif;
end;

Now in IS2008 in CA View I set for my SetLogDir CA:
In-Script Execution = Deffered Execution

I get error "Error 2762. Cannot write script record. Transaction not started." during installation when this CA should run.

I read that I have to insert my CA in the Installation - Execute Sequence. I inserted it right after InstallInitialize for test but I still get that error.

Where should I insert the CA to run as expected ? (when user press Next in the DestinationFolder dialog).

I have many CA in my projects so if I get this right I might solve all.

Thanks a lot,
Bianca
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

If you're setting a property or running in the UI sequence (or both), you'll want to use immediate execution. To run the action when the user clicks a button, you can use a DoAction control event that launches your action, instead of putting the action in the sequences.

(As an aside, you'll probably want to set the buffer-size variable nValue to a size large enough to accommodate the value of LOGDIR before calling MsiGetProperty.)
0 Kudos
rootme
Level 4

RobertDickau wrote:
If you're setting a property or running in the UI sequence (or both), you'll want to use immediate execution. To run the action when the user clicks a button, you can use a DoAction control event that launches your action, instead of putting the action in the sequences.

(As an aside, you'll probably want to set the buffer-size variable nValue to a size large enough to accommodate the value of LOGDIR before calling MsiGetProperty.)


Fixed.

Thanks a lot.
Bianca
0 Kudos