cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
loralynne
Level 6

Require users to run setup.exe when trying to launch msi

Hi,

I have a basic msi created with InstallShield 2008. When a user tries to launch the msi directly, is there a way to display a message saying that they have to run setup.exe? I noticed in the string table that there's a string called IDS_STANDARD_USE_SETUPEXE that reads:

This installation cannot be run by directly launching the MSI package. You must run setup.exe.

Any help is greatly appreciated.

Thanks,
loralynne
Labels (1)
0 Kudos
(16) Replies
RobertDickau
Flexera Alumni

I believe that message is used by InstallScript MSI packages (which do require setup.exe), but perhaps see this newsletter tip for one possible approach (PDF warning): http://www.acresso.com/webdocuments/PDF/msisetup.pdf.
0 Kudos
loralynne
Level 6

Great! Thanks for the quick response, Robert!

-loralynne
0 Kudos
loralynne
Level 6

Hi Robert,

I know it's been several months since I first posted this thread. I implemented your solution, and it works fine when setup.exe is launched by double-clicking on it or when it's launched via command line without any passing any arguments to the msi (i.e., without using /v). However, if the user launches setup.exe via command line and passes in arguments to the msi, the command line arguments in Setup.ini are ignored/overwritten.

For example, even though I specify USER_LAUNCHED_SETUPEXE=1 in the MSI Command Line Arguments property of my ism, running the following via command line will display my "setup.exe required" dialog:

setup.exe /v/qn

Is there a way to not have the command line arguments specified in setup.ini overwritten? I don't want to require the user to set the USER_LAUNCHED_SETUPEXE property on the command line.

Thanks,
Lora
0 Kudos
loralynne
Level 6

Robert? Anyone? Please? Any help would be greatly appreciated.

Thanks,
Lora
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

You may try using the SETUPEXEDIR property instead of a custom property to account for MSI arguments passed via the setup.exe command line. SETUPEXEDIR will always be passed when launching from setup.exe.
0 Kudos
loralynne
Level 6

Thanks for your quick response, Josh! That solution works.
0 Kudos
HookEm
Level 5

:confused:
Personally, I think the fact that the MSI command line arguments you specify in Setup.ini are overwritten when the setup.exe /v option is used should be considered a bug for IS 2009. One of the new features in IS 2009 is the fact that you can pass multiple MSI command line arguments by using the "/v" option multiple times. IMHO, since that is the case in 2009 then the arguments I specify in Setup.ini should be the "first" "/v" and the user should still have the option to append MSI command line arguments using further "/v" options.
0 Kudos
HookEm
Level 5

joshstechnij wrote:
You may try using the SETUPEXEDIR property instead of a custom property to account for MSI arguments passed via the setup.exe command line. SETUPEXEDIR will always be passed when launching from setup.exe.


Josh,
Are you positive this is the case (SETUPEXEDIR will ALWAYS be passed to the msiexec command line when launched via setup.exe)? There are no exceptions? :confused:
0 Kudos
loralynne
Level 6

I'm resurrecting this thread for localization reasons. The default language in my ism file is English. When I launch my msi on a non-English machine, the "setup.exe must be launched" alert is still displayed in English even though the string is localized in my ism for each language my installer supports.

How do I get the correct language displayed in the alert?

I need to resolve this ASAP. Any help is greatly appreciated.

Thanks,
Lora
0 Kudos
HookEm
Level 5

You have a "chicken and egg" problem. To display the local language the MSI must be launched using the appropriate transform property on the command line: "msiexec.exe /i MyPackage.msi TRANSFORMS=1041.mst" (example for Japanese language ID=1041). But the setup.exe is what InstallShield uses to determine the language and launch the appropriate MSI command line.
0 Kudos
loralynne
Level 6

Thanks, HookEm. So, you don't see any workaround for this?
0 Kudos
HookEm
Level 5

Well, you'd need to write a custom action that could detect the system language (SystemLanguageID) and display a message in that language and then call the CA when you detect the MSI was not launched from the bootstrapper application.

If the languages your installation supports all use a common character set you might be able to just add a property to the property table for each language and write the required CA in JScript/VBScript and display the value of the property in a message box. I don't think that will work if you're default code page uses a single byte character set and the system language is double byte.

something like the VBScript example below for myLocalizedMsgCA and then call the CA when you detect the MSI was launched without running setup:

SysLang = property("SystemLanguageID")
Select Case SysLang
Case 1031 MsgBox property("MY_GERMAN_MSG")
Case 1036 MsgBox property("MY_FRENCH_MSG")
Case Else MsgBox property("MY_ENGLISH_MSG")
End Select
0 Kudos
loralynne
Level 6

Thanks, HookEm! I'll give that a try.
0 Kudos
loralynne
Level 6

Hi HookEm,

Using a VBscript custom action works, but I'll need to use a dll since I need to support double-byte as well as single-byte languages.

One thing though is that since a return code has be returned from the custom action to Windows installer, the "Setup Interrupted" dialog (I'm using the ERROR_INSTALL_USEREXIT return code) gets displayed, and it gets displayed in the installer's default language which I have set to English. Now, is there a way to avoid displaying THIS dialog?

Thanks again for your help.

Lora
0 Kudos
HookEm
Level 5

That would be because the SetupInterrupted dialog is set to be displayed whenever USER_LAUNCHED_SETUPEXE is returned by a custom action.

You could try setting a property in your custom action code (something like SKIP_INTERRUPTED_DLG=1) and then changing the record in the InstallUISequence table that corresponds to the SetupInterrupted action so that it has a condition like:

NOT SKIP_INTERRUPTED_DLG


The condition should cause the dialog to not get displayed.
0 Kudos
loralynne
Level 6

Thanks for the quick reply! I'll try that out.
0 Kudos