[wix-users] Custom Action to Create and Install a File?
Edwin Castro
egcastr at gmail.com
Thu Feb 20 23:57:20 PST 2020
On Thu, Feb 20, 2020 at 10:17 PM Russell Haley <russ.haley at gmail.com> wrote:
> The Action executes, but I am not getting any values in the deferred
> CustomAction? This is confirmed in my log files:
> ...
> Action 21:47:33: Configure.LuaRocks.
> MSI (s) (A4:1C) [21:47:33:332]: Executing op:
> CustomActionSchedule(Action=Configure.LuaRocks,ActionType=1025,Source=BinaryData,Target=ConfigureLuaRocks,CustomActionData=LuaRocksConfigPath=;LuaRocksRootPath=;LuaRootPath=;ToolsPath=)
> MSI (s) (A4:A8) [21:47:33:335]: Invoking remote custom action. DLL:
> C:\WINDOWS\Installer\MSI2C78.tmp, Entrypoint: ConfigureLuaRocks
> MSI (s) (A4:6C) [21:47:33:335]: Generating random cookie.
> MSI (s) (A4:6C) [21:47:33:347]: Created Custom Action Server with PID
> 18240 (0x4740).
> MSI (s) (A4:8C) [21:47:33:380]: Running as a service.
> MSI (s) (A4:8C) [21:47:33:384]: Hello, I'm your 32bit Impersonated custom
> action server.
> SFXCA: Extracting custom action to temporary directory:
> C:\Users\russh\AppData\Local\Temp\MSI2C78.tmp-\
> SFXCA: Binding to CLR version v4.0.30319
> Calling custom action
> Winlua.Installer.CustomAction!Winlua.Installer.CustomAction.CustomActions.ConfigureLuaRocks
> ...
> (Full log here: https://pastebin.com/ycJfigrr - It takes a while to load!)
>
Here is the relative order of when those properties got set
MSI (s) (A4:1C) [21:47:25:910]: PROPERTY CHANGE: Adding Configure.LuaRocks
property. Its value is
'LuaRocksConfigPath=;LuaRocksRootPath=;LuaRootPath=;ToolsPath='.
MSI (s) (A4:1C) [21:47:25:911]: PROPERTY CHANGE: Adding LuaRocksConfigPath
property. Its value is 'C:\Program Files
(x86)\WinLua\LuaRocks\\config-[LuaVersion2].lua'.
MSI (s) (A4:1C) [21:47:25:913]: PROPERTY CHANGE: Adding LuaRocksRootPath
property. Its value is 'C:\Program Files (x86)\WinLua\LuaRocks\'.
MSI (s) (A4:1C) [21:47:25:914]: PROPERTY CHANGE: Adding LuaRootPath
property. Its value is 'C:\Program Files (x86)\WinLua\Lua\'.
MSI (s) (A4:1C) [21:47:25:915]: PROPERTY CHANGE: Adding ToolsPath property.
Its value is 'C:\Program Files (x86)\WinLua\LLVM-MinGW\'.
Notably, Configure.LuaRocks was set *before* the properties it depended on.
The Before attributes were set to Configure.LuaRocks which is the deferred
custom action. The custom action that sets the property is called
SetConfigure.LuaRocks.
Also, LuaRocksConfigFileName must be set with SetProperty (not Property
like I did initially) and it must be set before LuaRocksConfigPath.
Something like this
<SetProperty Id="LuaRocksConfigFileName" Value="config-[LuaVersion2].lua"
Before="SetLuaRocksConfigPath" Sequence="execute" />
<SetProperty Id="LuaRocksRootPath" Value="[LUAROCKS_INSTALLLOCATION]"
Before="SetLuaRocksConfigPath" Sequence="execute" />
<SetProperty Id="LuaRocksConfigPath"
Value="[LuaRocksRootPath]\[LuaRocksConfigFileName]"
Before="SetConfigure.LuaRocks" Sequence="execute" />
<SetProperty Id="LuaRootPath" Value="[LUA_INSTALLLOCATION]"
Before="SetConfigure.LuaRocks" Sequence="execute" />
<SetProperty Id="ToolsPath" Value="[LLVMMINGW_INSTALLLOCATION]"
Before="SetConfigure.LuaRocks" Sequence="execute" />
<SetProperty Id="Configure.LuaRocks" Value="LuaRocksConfigPath=[
LuaRocksConfigPath];LuaRocksRootPath=[LuaRocksRootPath];LuaRootPath=
[LuaRootPath];ToolsPath=[ToolsPath]" Before="Configure.LuaRocks"
Sequence="execute" />
--
Edwin G. Castro
More information about the wix-users
mailing list