[wix-users] Custom Action to Create and Install a File?

Russell Haley russ.haley at gmail.com
Sun Feb 2 11:42:46 PST 2020


Hi,

I'm pretty chuffed. I have a new installer for my WinLua distribution that
now includes the Lua package manager called LuaRocks and a custom compiler
toolchain using llvm-mingw. My current installer has a CustomAction that
creates a config file for the package manager named for the appropriate
version of Lua. The current version of Lua is 5.3.5, so the config file
needs to be named Config-5.3.lua. I currently save this file under the
install directory of <program files>\WinLua\LuaRocks.  This custom action
runs POST installation so I have the paths I need for creating the contents
of the file. I do not want this file in a user accessible directory.

My questions:

1) Can I use a custom action to create the file before the installation
completes and ADD the config file to the list of files to be removed (I
think that's termed the installer database)?

2) What about things like environment variables? Can I create them based on
installer information prior to the completion of the install process and
have the installer remove them? Specifically I want to create an
environment variable called LUAROCKS_SYSCONFDIR and store the path of the
config-5.3.lua mentioned above. However, the name and path won't be known
until AFTER the file is created? I can already add to the PATH variable
based on the installer paths, but this feels different.

All my source code can be found here:
https://github.com/WinLua/WinLua-Source-Code/tree/master/WinLua-Release3/WinLua-Installer

Regards,
Russell


More information about the wix-users mailing list