Skip to content
⌘ NSIS Forum Archive

How to execute Microsoft (msi) installer from NSIS installer

14 posts

kichik#
This thread should help you figure it out. To get more information about msiexec you should probably search MSDN.
kichik#
Please stop creating a new thread for every following question you have. It makes things much harder to track.

As the thread linked says you need to use msiexec like this:
ExecWait '"$SYSDIR\msiExec" /i "file.msi"'

ExecShell should probably work too (with no msiExec) but it won't wait for it.
ijerkovi#
thanks and sorry

I am new to this NSIS thing & I did not know of any guidelines regarding posts to this board...will not bother you anymnore
ijerkovi#
Related Question

If I want to do ExecWait on a .cpl file would I do the following?

ExecWait "$SYSDIR\odbccp32.cpl"
kichik#
Nope. A .cpl is not an executable, but rundll32.exe which executes it is. Try this:

ExecWait 'rundll32.exe shell32.dll,Control_RunDLL "$SYSDIR\odbccp32.cpl",'
ijerkovi#
Almost There

The command you gave me did pop up the ODBC DSN Control Dialog but my other installer stuff continued?

ExecWait 'rundll32.exe shell32.dll,Control_RunDLL "$SYSDIR\odbccp32.cpl",'
kichik#
Try:

System::Call "shell32::Control_RunDLLA(i $HWNDPARENT, i 0, t '$SYSDIR\odbccp32.cpl', i 5)"

If that doesn't work, try:

System::Call "kernel32::GetModuleHandleA(i 0) i .r0"
System::Call "shell32::Control_RunDLLA(i $HWNDPARENT, i r0, t '$SYSDIR\odbccp32.cpl', i 5)"
ijerkovi#
Almost There

Both commands I tried produced some funky behaviour:
- both opened 5 windows of "Create Data Source Name" and they were hard to close/cancel (had to resort to task manager).

Any ideas? Thanks!!
ijerkovi#
Me Bad!! The very first command you sent me worked !!

Thanks a million!!!

This one does work!
ExecWait 'rundll32.exe shell32.dll,Control_RunDLL "$SYSDIR\odbccp32.cpl",'
tastle#
Installing MSI closes other applications

Hi all,

I'm installing a MSI using the following command:

nsExec::Exec 'MsiExec.exe /q /i $TEMP\MSRuntime71.msi' $0

and it works fine except that it is terminating all running applications without alerting the user.

I've searched the Microsoft site:


and also looked at the command instructions, but I'm not sure what is the correct approach to handling this. (Plus the descriptions aren't clear.)

Ideally it would be nice to instruct the user to shut down application X.

Thanks in advance!