CopyFiles too late

后端 未结 2 1555
独厮守ぢ
独厮守ぢ 2021-01-14 16:31

I need to copy files as soon as my MSI is clicked. I\'m using CopyFiles function at the minute but it is not doing it quickly enough. Do I need my own custom action or is th

相关标签:
2条回答
  • 2021-01-14 16:36

    Anything done with reg files and ini files can generally be embedded and done inside the MSI instead. This is hugely superior since the MSI file will then feature built-in rollback support if the installation of the MSI is aborted.

    Installshield provides its own setup.exe launcher file which is not actually an MSI file at all, and it is this file that puts such temporary files in place on the system. It's a legacy feature from before the MSI days, and it essentially allows poor MSI design above anything else.

    As Chris points out an MSI file should not perform file operations and system changes until its install sequence is launched (the actions between InstallInitialize and InstallFinalize in the InstallExecuteSequence inside the MSI).

    I would recommend putting the ini file information in the IniFile table, and the registry information in the Registry table. Are you running EXE files as part of your installation sequence?

    0 讨论(0)
  • 2021-01-14 16:49

    I think the requirement has been poorly defined and designed. Here's an example of what you should be doing:

    I have a customer who sells a product directly (retail) and indirectly (through value added resellers). His application is extensible in that he, or his VAR's or their end user customers have requirements to be able to extend / modify / override the MSI with such attributes as:

    1) UpgradeCode

    2) ProductName

    3) License Agreement

    4) Icon

    5) Configuration Files

    6) Digital Certificates

    My customer wrote a wizard UI in C# the guides the user through all this and I wrote a library that interacts with MSI using the WiX DTF library (Microsoft.Deployment.WindowsInstaller). The result is an a utility that completly encapsulates the process in which the MSI is transformed into a variation.

    This is how Symantec Antivirus works as well.

    With some dev time, you could guide your user into building an MSI with updated ProductName and Registry table entries. The resulting MSI wouldn't need any custom actions and would still follow all applicable Windows Installer best practices.

    0 讨论(0)
提交回复
热议问题