Suppress message box during silent install of installshield basic msi, but allow it during visual install - installshield

I created a basic stand-alone msi file using InstallShield 2012. There is a prerequisite that needs to be fulfilled before installation begins. To check this prerequisite, I created an InstallScript-based custom action and added to the very first position in Sequences. If the check fails, the msi should display an error message and then quit. Because the msi will be run both directly via double-clicking and silently via msiexec, the error message should be smart enough to launch a message box during direct install (UI is available) and suppress any message box during silent install (I use "SpretfMsiLog" to write the error message into msi log file).
I tried to run silent install using "msiexec /qn" but the message box still showed up. Is there a way to detect the install mode from with InstallScript code and therefore hide/show the message box accordingly?

The proper approach for this involves using MsiProcessMessage to show the message, as it can parent the window correctly and already knows when not to show it at all. However if you're looking for the minimal changes to what you already have, it's possible that checking the UILevel property will be easier to implement.

An alternative to checking UILevel, would be to check the mode.
if (MODE == SILENTMODE) then
...
endif;
Description: http://helpnet.installshield.com/installshield18helplib/mergedProjects/installshield18langref/LangrefMODE.htm

Related

How to handle failed tabs.create with message 'No current window'?

I need to show a new tab to users when they first install the Chrome extension. If I run tabs.create in the runtime.onInstalled listener, it will sometimes fail with the runtime.lastError.message set to 'No current window'.
I experimentally found out that one of the causes for this is an enterprise policy to force install a Chrome extension.
So, is it possible to detect that the extension was installed with the force enterprise policy? In that case, I would not make the tabs.create call on extension install, or I would first create a window and then create a tab inside it.
Or is there any other way to handle this issue? I am not sure if enterprise force install is the only reason for the 'No current window' failure message.

Changing restart message on Inno Setup Prepare To Install page

I am building an installer in Inno Setup v6.2.1 with prerequisites, which include .NET, runtimes, and KB fixes (Windows 7 SP1). The goal is to do potentially several reboots depending on if the machine is missing KBs or .NET etc.
I am able to achieve what I want so far using PrepareToInstall and can change the text by returning the appropriate string. No problems... however I can't find a way of changing the.
Setup must restart your computer. After restarting your computer, run Setup again to complete the installation of xxxxx
Because I am creating a runonce entry, the installer will automatically run after reboot (which it does). The text "run Setup again" is not relevant in my situation and I want to change the text to say that the installer will continue once you restart.
I have tried to find where to change this text but with no success. I assume that PreparingMemo might be the candidate but no luck or not sure how to use it. Any help would be appreciated.
See Handling and customizing errors and messages in Inno Setup.
This particular message is defined by the PrepareToInstallNeedsRestart message.
You can change it in the [Messages] section:
[Messages]
PrepareToInstallNeedsRestart=Setup must restart your computer. After restarting your computer, the Setup will continue to complete the installation of [name].%n%nWould you like to restart now?
If you need to change the message text dynamically, assign WizardForm.PreparingLabel.Caption. E.g. from CurPageChanged(wpPreparing) event.

Windows sometimes puts msi path record in \HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\. How to disable that option?

I have a problem with msi installer.
Some users have problem with updating my application via msi because they got error that msi cannot find remote path.
I know how to fix it. All i need to do is remove record from \HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\ and it fixes the problem.
But i don't know how it happens that some users have record there and how to block windows from putting it there.
Including screen of error for visualization , but it's in polish :)

Node.js installation (windows installer) terminates prematurely on windows 10 64-bit

After going through a windows 10 re-installation due to a windows update crashing my laptop, I was left with re-installing many applications. One of them being node.js. When I tried to install it through the windows installer, I kept getting 'setup wizard ended prematurely because of an error message'. I am not sure what the problem is. I used x64 version which is what my OS is and there is no nodejs folder in program files. When I logged the installation this message popped in a lot of the lines has no eligible binary patches. Before the no eligible lines there were error logs such as:
'WixSchedInternetShortcuts: Error 0x8007000d: failed to add temporary row, dberr: 1, err: Directory_'
'WixSchedInternetShortcuts: Folder 'ApplicationProgramsFolder' already exists in the CreateFolder table; the above error is harmless'
If that is not enough information please advice me on how to send the full logs without spamming huge text in the thread. Thank you.
The MSI log file:
https://gist.github.com/luki2000/ab00476127d54aaf610d8bda84d40a64
Maybe try to search the log for "value 3" as explained by Rob Mensching in his blog. Doing so will find the locations in the log file that describe errors of significance.
Many people use dropbox, gdisk or similar to post logs. Some put it on github (just a sample log for OP, leaving in for reference). Check that last link, is that the same problem you see perhaps? (search for "value 3" as explained above - without the quotes of course). Looks like there is an error creating an Internet shortcut. Perhaps that is a Windows 10 problem? I will take a quick look.
I am betting Bob Arnson knows what this problem is outright. He will probably give us the real answer, see below for my workaround.
The correct thing to do overall, would probably be to communicate the problem back to the Node.js guys so they can fix the problem once and for all.
UPDATE: Maybe see if this answer helps you: node.js installer failing with 'CAQuietExec Failed' and 1603 error code on Windows 7. Essentially un-check Event tracing(ETW) in the setup's feature dialog - or you can try to launch the MSI from an elevated command prompt.
UPDATE: There seem to be two Internet shortcuts configured for this MSI in the WixInternetShortcut table. I would just create a transform to remove these two shortcuts and try a reinstall. If you feel bold and fearless and like to break the law, you can delete the two rows from the table and just save directly to the MSI itself. This is never the right thing to do if you are a deployment specialists. The original MSI is sacred, but if this is for your own system and you need to get something done, that would work. Then you just install the MSI direct afterwards. Otherwise you can install the transform after creating it with a simple command line:
msiexec.exe /i node-v8.11.2-x64.msi TRANSFORMS="C:\MyTransform"
You can create the transform using Orca, InstEd or SuperOrca or any commercial tool that supports creating transforms.
In case you don't know, transforms are little database fragments that are applied to the original MSI (which is also a database under the hood). After the transform is applied the in-memory version of the MSI is the MSI + the changes from the transform.

launching application after silent install

Installshield 2014 professional: Basic MSI (NOT setup.exe)
Using Project assistant, I set launch application checkbox (default TRUE) on SetupCompleteSuccess dialog.
Usually it works fine.
But on silent mode, it does not work.
How and When can I call IS_LAUNCH_MY_PROGRAM_PLEASE custom action or execute application on installed dirctory.
As an aside, my reaction to this is that you shouldn't do it. If you do, it should be conditional and require the person installing your software to include a property on the command line that requests the program launch.
That said, the problem is that the dialogs are not shown during a silent installation (Windows Installer skips the entire InstallUISequence), so the actions on them will never run. Instead you'd have to schedule a custom action in the InstallExecuteSequence, and use UILevel (and a custom property) to condition when this action runs.
Note that there's a strong likelihood that this will run your application in the wrong context, or even as the wrong user, as typically one has to pre-elevate in order for a silent installation to succeed. So again, keep the request to install an application and the request to run it separate. People using systems like SCCM will curse your installation otherwise.

Resources