Most installers are painful when trying to do more than the usual things.
Personally I use NSIS installer with my own .net application installer which I can control completely, the NSIS script just checks for .net availability and installs the .net runtime needed then unpacks the files and calls my installer EXE.
Below is the install script which checks for .net, add your code to "do stuff here".
!define PRODUCT_NAME "DotNetVer Tests"
!define PRODUCT_VERSION "1.1"
!define PRODUCT_PUBLISHER "NSIS"
!define PRODUCT_WEB_SITE "http://nsis.sourceforge.net/"
SetCompressor /SOLID LZMA
Brandingtext "Installer (www.companyname.com)"
; Modern interface settings
!include "MUI.nsh"
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "DotNetVerTests.exe"
InstallDir "$PROGRAMFILES\Test DotNetVer"
ShowInstDetails show
;-------------------------------------------------------------------------------------
Section "MainSection" SEC01
ClearErrors
ReadRegDWORD $0 HKLM "Software\Microsoft\Net Framework Setup\NDP\v4\Full" "Install"
IfErrors dotNet40NotFound
IntCmp $0 1 dotNet40Found
dotNet40NotFound:
DetailPrint "Installing .NET Framework 4.0"
SetOutPath "$TEMP\"
File "dotNetFx40_Full_setup.exe"
ExecWait "$TEMP\dotNetFx40_Full_setup.exe" ;/passive
Delete /REBOOTOK "$TEMP\dotNetFx40_Full_setup.exe"
dotNet40Found:
ClearErrors
ReadRegDWORD $0 HKLM "Software\Microsoft\Net Framework Setup\NDP\v4\Full" "Install"
IfErrors endd
; do stuff here
;MessageBox MB_OK ".net installed."
return
endd:
MessageBox MB_OK "You must install .net first."
SectionEnd