cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nicholas_jiang
Level 2

error2731:Selection manager not initialized

Hi,all.
I want to install a winservice(WService.exe)with command arguments
winservice.exe -Install,the winservice.exe is installed along the package
i create the custom action with custom action wizard ,
the put the custom action to the sequence of after Costinitialize,
when i build and run it,i will have the occur message:error2731:Selection manager not initialized,so what's the problem?
can anyone do me a help?


thanks
Nicholas.
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

That error generally means that a custom action has referred to a Directory-table identifier before CostFinalize has run. Performing validation on the built MSI database can often catch this.

In any case, could you use the built-in MSI functionality for installing a service instead of a custom action?
0 Kudos
packagechief
Level 5

Nicholas_jiang wrote:
Hi,all.
I want to install a winservice(WService.exe)with command arguments
winservice.exe -Install,the winservice.exe is installed along the package
i create the custom action with custom action wizard ,
the put the custom action to the sequence of after Costinitialize,
when i build and run it,i will have the occur message:error2731:Selection manager not initialized,so what's the problem?
can anyone do me a help?


thanks
Nicholas.


Have a look at the help of Installshield 2008:


The selection manager is responsible for determining component and feature states. It is initialized during the costing actions ( CostInitialize action, FileCost action, and CostFinalize action.) A standard action or custom action made a call to a function requiring the selection manager before the initialization of the selection manager. This action should be sequenced after the costing actions.


well this seems to be a sequence problem.. your "WService.exe" has of course to know which paths on the target (Windows System Folder or others) are available (and how much space on the diskdrive is available) before it can sucessfully install the service

This functionality is only given, if the session manager has properly finalized all neccessary function for this case..

In general I woud suggest you (if you install the product in silent mode) to put the custom action after "InstallFinalize" the you will have the guarantee that the whole package is installed on the target and all is cleaned up sucessfully otherwise the Windows Installer can't return a correct state and the install fails

but as RobertDickau remarked the Install Service Feature (which is available uder the "Components View --> Advanced") woud be the better solution cause there you can fine tune the behavior of your new service... and this handy feature gives you better control over the service
0 Kudos