custom-action

Connection String in a WIX Custom Action Parameter

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 02:39:30
问题 Using WIX 3.7, I want to pass a connection string into a custom action. However, since the connection string contains ';' the custom action data is not being parsed correctly. <CustomAction Id="PopulateActionPrep" Property="PopulateAction" Execute="immediate" Value="CONNECTIONSTRING="[CONNECTIONSTRING]";PRODUCTVERSION=[ProductVersion]" /> I tried using quotes to escape the connection string but that did not work. When I read the CONNECTIONSTRING property from CustomActionData it comes back

Pass data between deferred custom action

天大地大妈咪最大 提交于 2019-12-11 02:37:50
问题 I need to pass data from one deferred .NET custom action to another, but I can't figure out how to do this. Deferred custom actions can't access the Windows Installer session, so session properties are not an option. The target deferred custom action is already taking custom action data that is set from an earlier immediate custom action, but I don't seem to be able to modify this from the source deferred action. I've also tried using static properties on the custom action class, but as

Detecting if the user selected “All Users” or “Just Me” in a Custom Action

こ雲淡風輕ζ 提交于 2019-12-10 21:43:54
问题 I'm trying to detect if the user has selected the "All Users" or the "Just Me" radio during the install of my program. I have a custom action setup that overrides several methods (OnCommit, OnBeforeInstall, etc.). Right now I'm trying to find out this information during OnCommit. I've read that the property I want to get at is the ALLUSERS property, but I haven't had any luck finding where it would be stored in instance/local data. Does anyone know of a way to get at it? -Ben 回答1: Going to

Wix - Accessing the property values from deferred custom action created dynamically in other CA

耗尽温柔 提交于 2019-12-10 19:09:37
问题 I'm making an installer which must configure a web service it installs. It dynamically generates properties which hold the data collected from the user in the UI sequence, installs the service and sets the parameters. SetParams CA uses dynamic properties generated in the UI sequence. To access data in deferred CA, I've created an immediate CA which dynamically extracts session data and puts it in the CustomActionData. <CustomAction Id='SaveParams' BinaryKey='Setup.CustomAction' DllEntry=

WiX Custom Action Project - BadImageFormatException

本小妞迷上赌 提交于 2019-12-10 18:35:13
问题 I'm developing my first custom action but I can't get the resulting .CA.dll file to load. Heres the process at its simplest, and the result: I create a custom action project and keep all the defaults. The class looks like this: using Microsoft.Deployment.WindowsInstaller; namespace CustomAction { public class CustomActions { [CustomAction] public static ActionResult CustomAction1(Session session) { session.Log("Begin CustomAction1"); return ActionResult.Success; } } } I then build the

MsiSetProperty from C# custom action

浪子不回头ぞ 提交于 2019-12-10 17:56:35
问题 action1How do I set a MSI property from within a C# custom action, so far I have this but how do I get the handle? [DllImport("msi.dll", CharSet = CharSet.Unicode)] static extern int MsiSetProperty(IntPtr hInstall, string szName, string szValue); public void SetProperty(string propertyName, string propertyValue) { MsiSetProperty(handle, propertyName, propertyValue); } I am calling the CA from WiX with the following line <CustomAction Id="CA1" BinaryKey="ca1.dll" DllEntry="action1" /> and the

WiX. Rollback custom action when is canceled installation

﹥>﹥吖頭↗ 提交于 2019-12-10 16:36:50
问题 I have a custom action <CustomAction Id="myActionId" BinaryKey="myAction" DllEntry="MySimpleAction" Execute="immediate" Return="check" /> <InstallExecuteSequence> <Custom Action="myActionId" After="InstallInitialize">CHECKBOXCOPYPROP=1</Custom> </InstallExecuteSequence> My custom action does backup and resolved database. I need to do rollback (drop database) when is canceled installation. I did: <CustomAction Id="myActionId" BinaryKey="myAction" DllEntry="MySimpleAction" Execute="immediate"

Wix custom-action dll relies on files installed at execution

ε祈祈猫儿з 提交于 2019-12-10 16:19:51
问题 I'm using a dll to install a driver that's packaged inside the msi. When I schedule the custom-action for after InstallFinalize it succeeds, but if I schedule it either 1) after InstallFiles 2) after InstallFiles, execute=deferred, 3) after InstallFiles, execute=deferred, impersonate=no, or 4) before InstallFinalize it fails with "file not found" for the .inf file. I've read This SO post and this page, but still don't understand how I get my driver to be installed. If I use after

WiX - Prevent downgrade with check for revision

六月ゝ 毕业季﹏ 提交于 2019-12-10 13:42:37
问题 I am searching a way to prevent a downgrade of my application. But the "problem" is, that I have to check the revision-number for example: it should be possible to install 1.0.0.2 when 1.0.0.1 is installed - but it should not be possible to install 1.0.0.1 when 1.0.0.2 is installed. I know, that the Element MajorUpgrade only check the first three tokens. Perhaps someone can give me an idea, how to do this? Can I wrote a CustomAction to do this? - When yes, how can I check in the CustomAction

Using a WiX custom action to set a property's value

回眸只為那壹抹淺笑 提交于 2019-12-10 12:44:07
问题 I am modifying an existing WiX installer to handle updating an existing installation of one of our products. There are several values whose defaults are specified in properties. These properties are displayed to the user for editing and are then written to a custom configuration file by the existing installer. My code needs to be smart enough to detect if it is doing a brand new install versus installing an older version. If it is doing a brand new install, it needs to set the properties to