cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Christoph
Level 8

file kept in use by service

The installer I've created installs a Windows NT Service.
This WindowsNT Service creates a logfile within a folderstructure that I also create during installation. This logfile is kept in use as long as the service is running.

I've created a custom action to remove this folderstructure during REMOVE="ALL" mode because extra files and folders are added there during program execution.

My question: the WindowsNT Service is removed automatically during uninstall but when? With other words, where do I need to schedule my cleanup Custom Action within the execute sequence and which type of execution do I need to use(immediate, commit, deferred?).

I've tried to schedule the cleanup Custom Action after removefolders within the execute sequence and use immediate execution but at that moment, the service still seems to exist, so keeping some logfiles in use....
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

Right, custom actions that change the system should be scheduled for deferred execution; in your case, somewhere after DeleteServices should do it.
0 Kudos
Christoph
Level 8

Robert,

thx... this works... what the sequence of the code execution is concerned.

Within this installscript I want to do this:

The installscript CA needs only to be executed during full uninstall(REMOVE~="ALL"). I read out a property("K_SUM_DATA"). This property contains a folderpath that is stored within the registry. So I have defined a systemsearch to fill this property with the folderpath value. However, when I want to read out the value to use in my CA, the property can not be read out, it seems to be empty.

I suppose that the systemsearch is executed during a full uninstall so that the property K_SUM_DATA is filled correctly but I can probably not access the value of the property anymore within a deferred CA in the execute sequence. Correct?

Do you know another way to get this working?
0 Kudos
RobertDickau
Flexera Alumni

Reading an MSI property during a deferred script custom action requires going through CustomActionData; searching the documentation and these forums for CustomActionData will give you some examples.
0 Kudos
Christoph
Level 8

Yep... got it working.
CustomActionData need to be used.

Thx!
0 Kudos