问题
If I want to abort an installation in a C# custom action, it will have to display an unwanted "1001 Error" message box.
To avoid this I once used a C++ project which can abort the installation without the message box.
I'm trying to create this C++ project again but the only tutorial I found on the internet
http://www.codeproject.com/Articles/1747/MSI-Custom-Action-DLL
isn't updated since 2002. How can I do the same on VS 2010?
回答1:
That example is outdated. The easiest way today is to download and install Windows Installer XML (http://wix.codeplex.com). Then say File | New Project | Windows Installer | C++ Custom Action
Also of note is the C# custom action project. Your 1001 error message tells me that you are using InstallUtil / Installer Class custom actions. The C# project type in WiX is called Deployment Tools Foundation (DTF) and is far superior. Checkout the following for an explanation of how it works and appears to MSI as a C++ custom action.
Deployment Tools Foundation (DTF) Managed Custom Actions
来源:https://stackoverflow.com/questions/17238298/how-to-create-a-c-msi-custom-action-dll-using-visual-studio-2010