PDA

View Full Version : Custom Action doesn't work



rossellag
12-06-2012, 06:16 AM
Hello,

I'm trying to create a setup for a Visual Studio Project.

In this setup I must:
1) create a folder if it isn't exist
2) execute sql script that create a database saved in the folder created at point1.

My problem is at point1. I use Custom Action and I create "New Managed Code" (Stored In Binary Table) to call a c# dll (CreateFolder.dll).

This dll utilize the following method:
public void CheckFolder()
{
string path = "C:\\Db";
if (!Directory.Exists(path))

Directory.CreateDirectory(path);
}

I set my Custom Action as follows:
- Assembly file: <PATH_TO_DEBUG_FILES>\CreateFolder.dll
- Method Signature: CreateFolder.Class1.CheckFolder()
- Install UI Sequence and Install Exec Sequence: <First Action>

I build the setup but when I run it an error occurred. This is error 2731: Selection Manager not inizialized.

What's going on? What's wrong?

SMadden
12-06-2012, 06:44 PM
Hi,

If you only need to create a folder, I'd use a standard action for that instead of a custom action. There is the CreateFolder table that you can use.

If you need to do other stuff as well in your custom action and don't want to use the CreateFolder table, sequence the CA after the file costing actions. E.g CostFinalize. That should get rid of the error message.

Sandra

rossellag
12-12-2012, 08:07 AM
Thank you very much Sandra!