cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dracan
Level 5

Deferred execution in system context

Hi. I've got a custom action that runs one of my IS script functions. This works fine if it's set to immediate or deferred. However, if I set it to "deferred execution in system context", then it never gets run.

Any ideas what's causing this?
Cheers,
Dan.
Labels (1)
0 Kudos
(6) Replies
dracan
Level 5

Odd, this seems to working today! Can't think of anything related that I've changed.
0 Kudos
dracan
Level 5

Now we're having our QA department saying that the tasks I've changed to "deferred in system context" aren't happening 😞

Are there some scenarios where deferred in system context wouldn't run, when immediate execution would run?

Cheers,
Dan.
0 Kudos
cbragg
Level 7

What do your scripts do. Remember in system context you don't have access to a profile. Maybe your scripts need that? Ask QA for a verbose log too and that should tell you if it attempted to run your scripts or not. Unfortunately without a log you don't have much to go on right now
0 Kudos
dracan
Level 5

Below is one of my functions. Note that the SprintfMsiLog logs aren't even appearing. Also below that are the relevant bits of my logs - the CA seems to be being called, but not the Installscript.


function AddToGamesExplorer(hMSI)
STRING szErrorString;
STRING szCustomDataDirecory;
NUMBER nLength;
begin
SprintfMsiLog("Start:AddToGamesExplorer");

nLength = MAX_PATH + 1;
MsiGetProperty(hMSI, "CustomActionData", szCustomDataDirecory, nLength);
StrRemoveLastSlash(szCustomDataDirecory);

if(LaunchApplication(szCustomDataDirecory ^ "Misc\\GDFInstall.exe", "/allusers /installpath \"" + szCustomDataDirecory + "\" main.exe", "", LAAW_STARTUPINFO.wShowWindow, LAAW_PARAMETERS.nTimeOut, LAAW_OPTION_CHANGEDIRECTORY | LAAW_OPTION_FIXUP_PROGRAM | LAAW_OPTION_USE_SHELLEXECUTE | LAAW_OPTION_WAIT) < 0) then
NumToStr(szErrorString, LAAW_PARAMETERS.nLaunchResult);
MessageBox("Failed to run " + szCustomDataDirecory ^ "Misc\\GDFInstall.exe (all users)(" + szErrorString + ")", WARNING);
endif;

SprintfMsiLog("End:AddToGamesExplorer");
end;


[code]
MSI (s) (6C:F4) [12:12:41:205]: Doing action: CA_AddToGamesExplorer
Action 12:12:41: CA_AddToGamesExplorer.
Action start 12:12:41: CA_AddToGamesExplorer.
CA_AddToGamesExplorer:
Action ended 12:12:41: CA_AddToGamesExplorer. Return value 1.
[/code]

[code]
MSI (s) (6C:F4) [12:12:55:978]: Executing op: ActionStart(Name=WriteRegistryValues,Description=Writing system registry values,Template=Key: [1], Name: [2], Value: [3])
[/code]
0 Kudos
cbragg
Level 7

Well according to the log the CA was definitely fired so the problem must be within the script itself. Do QA see the messagebox? Also you are only checking for negative return error codes. I suggest you check for <> 0 then the messagebox might provide some more info. I would also suggest you remove that messagebox once you have this issue sorted otherwise your installation can't be remotely deployed silently. Instead it should be logging.
0 Kudos
dracan
Level 5

Turns out it was a bug in Installshield. I used the hotfixed mentioned in this thread and it fixed the problem 🙂
0 Kudos