Create Installer with CustomDataAction

Add-in Express™ Support Service
That's what is more important than anything else

Create Installer with CustomDataAction
 
Bobby M.




Posts: 21
Joined: 2015-11-09
Hey Add-in Express Team,

I want to create an installer for my Add-in where the admin or user can select multiple checkboxes and depending on this the installer should create registry entries in the system.
I've created a new setup project("Visual Studio Installer") for my Add-in and added a new user interface(CheckBoxesA) to this. After this I've added the CustomActionData to the installer and set all necessary properties.(CustomActionData: /PathValue=[CHECKBOXA] etc.).

But when I try to install the project,I get this error and the installation is canceled.
Error 1001 InstallUtilLib.dll:Unknown error.

Can you help me please :)
Posted 17 Jan, 2019 10:22:16 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Bobby,

This may be caused by the properties you set on the custom action entry: select such an entry and see the Properties window. I suppose you've set the InstallerClass property incorrectly.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Jan, 2019 01:54:57 Top
Bobby M.




Posts: 21
Joined: 2015-11-09
Hey Andrei,

at first thanks for your quick reply. I can't find or see any mistakes in my properties or installer class.

CheckBoxA View:
CheckBox1Label=Service1
CheckBoxProperty=CHECKBOXA1
CheckBoxValue=Unchecked

InstallerProject:
Selected InstallerProject -> View -> Add Custom Actions.
Selected Install Folder -> Added Primary Output of Project with InstallerClass
Now Install Folder has two files: 1)Adxregistrator.exe 2)Primary Output Project(Active)

Arguments=CHECKBOXA1
CustomActionData=/KeyValue="[CHECKBOXA1]"

InstallerClass:

  public partial class InstallerHelp : System.Configuration.Install.Installer
    {
        public InstallerHelp()
        {
            InitializeComponent();
        }

        public override void Install(IDictionary stateSaver)
        {
            base.Install(stateSaver);
            string strKey = Context.Parameters["KeyValue"];

            //For testing write value into file
            string sPath = @"c:InstallerHelp21.txt";

            if (File.Exists(sPath))

                File.Delete(sPath);

            File.WriteAllText(sPath, strKey);
        }
    }
Posted 18 Jan, 2019 02:34:27 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Bobby,

You are welcome.

Bobby M. writes:
Now Install Folder has two files: 1)Adxregistrator.exe 2)Primary Output Project(Active)


Select the Primary Output Project(Active) file. In the Properties window, the InstallerClass property should be set to true. Is this the case?


Andrei Smolin
Add-in Express Team Leader
Posted 18 Jan, 2019 02:56:36 Top
Bobby M.




Posts: 21
Joined: 2015-11-09
Select the Primary Output Project(Active) file. In the Properties window, the InstallerClass property should be set to true. Is this the case?


Yes, it set true :-)

I've created a new Project without Add-in Express(WindowsConsoleApp).
Then I did the same steps like I did in the Add-in Express project.
In the WindowsConsoleApp it worked like I expected. I could select the checkbox in the installer and after the installation it created the file with the checkbox value.
Posted 18 Jan, 2019 03:09:16 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Bobby M. writes:
Arguments=CHECKBOXA1
CustomActionData=/KeyValue="[CHECKBOXA1]"


Then I suppose one of these is used wrongly. I suppose you need to clear the Arguments property: at https://msdn.microsoft.com/en-us/library/windows/desktop/9cdb5eda(v=vs.71).aspx, they use CustomActionData only.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Jan, 2019 03:21:56 Top
Bobby M.




Posts: 21
Joined: 2015-11-09
Hey Andrei,

I've cleared the arguments and also cleared the others properties. I still get the error.
As I said, when I create a non add-in express project for example "Windows Console Application" and add this a setup project with all the configuration and properties, it works. I think it has to do something with the Add-in Express installer, which I created by right click on my add-in express project and select Add-In Express -> Create Setup Project."

Do you have a sample for me, where my scenario works with an add-in express Project?
(Start Installer -> Select a checkBox -> After the installation a file is created with the checkbox value and add-in is installed)
Posted 18 Jan, 2019 03:36:54 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Bobby,

I believe the issue is caused by the properties you set on the custom action. I would compare the properties in the two projects.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Jan, 2019 08:03:53 Top
Bobby M.




Posts: 21
Joined: 2015-11-09
Hey Andrei,

I've tested it and compared the both properties in the projects and it seems to be the same properties.
Can I send you both projects and can you have look on the projects ?

Best regards
Bobby
Posted 21 Jan, 2019 03:43:37 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Bobby,

Yes. You can send them to the support email address; find it in {Add-in Express installation folder}\readme.txt; please make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2019 03:54:23 Top