c# - WiX Installer - how to read sql file content from a folder which reside at same location as .msi -
i want invoke custom action execute set of .sql files against given database. able using custom action code(in c#) if hardcode path of folder sql files available.
i want put sql scripts folder in same location .msi present. how can access/find folder-path custom action during time of installation?
i using wix 3.6. using dot net bootstrapper create setup.exe.
the sqlscript element in wix toolset may lot of asking for. stores scripts binary streams in msi instead of relying on files relative msi. important design decision because there many cases msi execute not have access original source media not find scripts. example, repair operations can launched cached msi package. if custom action repair, need original media scripts. not desirable.
if want go down path, you'll want @ using sourcedir directory "source location" of msi. noted above, source media may not available , sourcedir blank in cases. force sourcedir set, you'll need add resolvefiles action. careful when scheduling resolvefiles because require original media. if can't found, user prompted insert again.
the worst case of poor sequencing of resolvefiles prompt source when user attempting uninstall product. user's trying application of machine , prevented unless can find how installed it. way upset users. :)
i highly recommend looking @ sqlscript element instead or source code if interested. it's in wix toolset @ src\ca\serverca (look files "sql" in name below there).
Comments
Post a Comment