Setting UI Level in a MSI package - windows

I have WiX project to create a MSI package.
I want to set UI level to 3 or 4 or 5 so that it can show success/failure after the setup.
Currently it just run and vanishes.
Is there a way to set UI level on the package?

Samples: WiX Quick Start Samples.
Setup GUI: It sounds like your MSI does not have a built-in GUI at all? If so, try setting a reference to WixUIExtension.dll and define a standard WiX dialog set to use for your package - for example WixUI_Mondo. This will give your setup a sequence of "default dialogs" that are pre-made for you to apply with ease.
Procedure for Visual Studio (go here for click-by-click version):
In your WiX Visual Studio solution, open up the project list, right click "References" and click "Add Reference...". Now set a reference to: C:\Program Files (x86)\WiX Toolset v3.11\bin\WixUIExtension.dll (or whatever location this file is at on your box)
The file you referenced contains default GUI-sets. Now you can just inject this line into your WiX source file to have default MSI dialogs show up:
<UIRef Id="WixUI_Mondo" />
Here is a quick sample project that you can try to see this in action: https://github.com/glytzhkof/WiXDefaultDialogsSample (direct link to line in source)
UILEVEL: UILEVEL is a property setting you can use during actual installation of the MSI on end user's box (not during compilation of the source into an MSI file). The property allows you to control how much of the setup's internal GUI is visible for the end user (if there is an embedded GUI at all). You can show all dialogs, a reduced set, basic / minimal dialogs or no dialogs at all (proper silent mode).
The actual built-in MSI GUI is added during compilation as described above. UILevel does not add any GUI to an MSI without one defined internally. However, even a setup with no internal GUI defined can show a modal dialog at the end if you use this command line:
msiexec.exe /i MySetup.msi /qb+
You can also use /qn+ for "no UI, but modal completion dialog". The above is "basic UI with modal completion dialog". Msiexec.exe reference from Advanced Installer and here is the same from Microsoft Docs and from InstallShield.
Here is a dialog from an old tool to generate msiexec.exe command lines. Here you can see the different settings for UILevels:
Links:
Flexera: Tip: User Interface Levels for MSI Installations
Uninstall from Control Panel is different from Remove from .msi (on UILevel and differences between silent and interactive installation)
Knowing the Mode of Installation

Related

WIx Installer: is there any way to auto close installer shield after successful installation

I want to auto close installer window on successful installation without pressing final close button.
Using wix installer can we able to achieve it.
Installation Result: This dialog is generally there to show whether the installation completed successfully or not - hence it is not a good idea to remove it. In fact there are usually several such exit dialogs: FatalError, UserExit and ExitDialog - depending on how the setup ended. Use Orca and go to: Tools => Dialog Preview to see what the dialogs look like.
Customize GUI: You can, however, remove the dialog from the sequence by customizing the standard WiX dialog set to be as you want it yourself. You can also remove all dialogs from an MSI, but not adding a default dialog set, but that is not recommended.
Some pointers on WiX GUI
Here is a sample on customizing WiX dialogs: https://github.com/glytzhkof/WiXCustomDialog
Here is a standard WiX GUI dialog set in use: https://github.com/glytzhkof/WiXDefaultDialogsSample (you can remove the dialogs by commenting out this line - then your setup has no dialogs except system dialogs).

Create MSI and Enforce All Users with Visual Studio

I have created an installer using Visual Studio 2015 (with the Visual Studio installer addon). The goal is to always run the APP with the same local resources, regardless of who is logged on, therefore we target [CommonAppDataFolder] (C:\ProgramData... on Win10). The installer works just fine placing all shared resources where we want them. But the generated MSI provides the option to install as "everyone" or just the "just me"
We want to grey out the option to install as "just me".
Is there a way to do this from within Visual Studio as part of the build process for the MSI.
I see some solutions that involve running MSIEXEC with different parms eg, ALLUSERS, but I am wondering if there is a way to set this up to occur automatically in Visual Studio.
Thank you.
The project Properties window (NOT properties) can be shown by selecting the project in Solution Explorer, and then F4. You can set InstallAllUsers to True there.
The Properties window of the InstallFolder dialog has a settting InstallAllUsersVisible, so just set that to False.
I don't use that particular tool. There might be a better way to
achieve what you want than the below "hack". Adding since you got no other answers (yet).
UPDATE: Go with Phil's answer. I don't have the tool to check but it looks good. Leaving in this answer just for the record. Not recommended unless you have other things you want to change.
Post-Process MSI
Hiding Control: Not ideal, but if you don't mind post-processing the MSI (can be automated with MSI API coding) you could insert a row into the ControlCondition table to hide the whole dialog control in question.
Ad-hoc sample: Hiding the "Back" button from a setup's LicenseAgreementDlg - just add this row (I guess events defined elsewhere could show it again):
.
Dialog at runtime: Below is the actual dialog at runtime.
MSI API
To automate the above. Get hold of WiRunSQL.vbs - part of the Windows SDK - just search your SDK folder if you have Visual Studio installed. Also plenty of copies on github.
In a batch file:
cscript.exe "%~dp0"\WiRunSQL.vbs "MySetup.msi" "INSERT INTO `ControlCondition` (`Dialog_`, `Control_`, `Action`, `Condition`) VALUES ('LicenseAgreementDlg', 'Back', 'Hide', '1')"
pause
I honestly might hard code ALLUSERS=1 in the Property table as well.
Links:
SQL modification of MSI file
List tables in MSI file using VBScript
Windows Installer Scripting Examples

How can I add an optional UI to WiX toolset

I have already made a quiet installer (without the need to click any buttons but some progress bar is shown while installation is in progress) for a project deployment. This time I wish to add an optional graphical user interface.
By default, the installer should just run without clicking anything, when a parameter is given, let's say, the msiexec parameter: /qf, the installer would pop up an interface that can be interacted with.
I've already added the required UI dll to the project reference, but given msiexec /i C:\Setup.msi /qf, it doesn't work. How can I get it to work?
Did you try the procedure described in this well known Wix tutorial?
At its simplest level, this means that you essentially just add this to the Wix source file and you get a default GUI:
<UIRef Id="WixUI_Minimal" />
You can also try the other "defaults":
WixUI_Mondo (normal)
WixUI_FeatureTree
WixUI_InstallDir
WixUI_Advanced
A search turned up a similar answer, and one talking about extending the default gui.
Just modify the WixUI_Minimal.wxs file:
How to build a minimal WiX installer UI without a license page?
WiX toolset WixUI_Minimal Dialog Set
Customised UI's for WiX
Then use properties to condition the dialogs to show or hide as you launch the MSI via msiexec.exe.

How do I set AppUserModelID on shortcut?

I'm in Windows 7 working on combining two apps with the same task bar icon, as described in this question:
Pinning advertised shortcuts on the taskbar in windows 7
I see there, and it lots of online documentation that I need to set the AppUserModelID as a property of the shortcut. My installer program uses the basic Visual Studio 2008 setup project, and I don't see any way to set shortcut properties on installation. Is there any head-start anyone can give me on how to do this?
Sheng commented that "You can also switch to other MSI authoring tools that supports setting the appid for shortcuts, such as WIX or NSIS."
To achieve this using a Shortcut element in Wix you must add a child ShortcutProperty element to your Shortcut element and use the Shell property name "System.AppUserModel.ID" as the key.
<Shortcut Id="StartMenuShortcut"
Name="Shortcut Name"
Description="Shortcut Description"
Target="[INSTALLLOCATION]Application.exe"
WorkingDirectory="INSTALLLOCATION">
<ShortcutProperty Key="System.AppUserModel.ID" Value="AppUserModelID" />
</Shortcut>
I don't know anything about VS2k8 setup projects so I don't know if you can run custom actions etc but I do know that to set the AppId on a shortcut you load/create your shortcut and query its IShellLink for IPropertyStore, then InitPropVariantFromString a variant with your id and call SetValue(PKEY_AppUserModel_ID,propvariant) + Commit on the propertystore
Adding to Ander's reply.
Visual Studio Setup project does not support setting appid and will probably never be unless Microsoft reverse the deprecation of Setup project feature.
There is a Windows API Code Pack that helps in invoking shell APIs. Here is a tutorial on creating shortcut in custom action. You can add the code to update the shortcut to the custom action.
You can also switch to other MSI authoring tools that supports setting the appid for shortcuts, such as WIX or NSIS.

Customizing Repair option in MSI

I have a Visual Studio Setup Project that is very basic except for one modification. I have two different libraries that I would like installed based on the user's selection. I added a checkbox screen and conditions to the files. They can install either component or both components. This all works fine.
Now for my requirement. Let's say that the user installed the MSI and selected only one component. Now, they need to install the second component from the same MSI. If they run the MSI again, I get the option to repair or remove. Repair will only fix the component that was installed originally. How can I give them the option to install the other components by showing the checkbox screen again?
If this functionality isn't available in a VS Setup Project, is there something else where it is? WiX perhaps?
I don't think VS Setup projects support this. Wix or MSI's created from other tools like Installshield can support this. The usual way to handle this would be to create separate features and assign the different components to each feature. Then if the MSI is built using WiX or some other tool, from add/remove there will be the Change button/option through which you can get the option to repair, modify, or uninstall. Modify then lets you change your feature selections without doing a reinstall.
You need to use the free MSI editors like ORCA or SuperORCA. Microsoft use to provide ORCA tool in their service pack. Not sure if they are continuing so. SuperORCA tool you can find at http://www.pantaray.com/msi_super_orca.html. Now when I had similar task to achieve following was my approach. I used SuperOrca to open my MSI file.
1] On repair/remove MSI dialog screen, add one more radiobutton for "Modify" - In SuperOrca-->Under RadioButton table --> Add entry for Modify radiobutton
2] Rename BackButton's text to "Reinstall" from its original "Back" --> In SuperOrca-->under Control table --> change Text property to rename Back to Reinstall
3] On selection of Repair/Remove radio button enable Finish button and disable Reinstall button. On select of modify radio button enable Reinstall button and disable Finish button - In SuperOrca--> Under ControlCondition table --> add entries for enable/disable "Reinstall" and "Finish" buttons for each comibinations for repair/remove screen (In my case dialog form name is "MaintananceForm")
4] Now from SuperOrca tools ControlEvent table find out conrol name for BackButton, In my case it is "PreviousButton". Now modify its Event, Argument & Condition entries from the table. And the values for these properties must be the same for the "Next" button properties from the Welcome screen of MSI file which redirects user to show installation options to choose.
Note: This is working fine for me. But when you re-select installation options again and click Next, somehow it does not forced for installing the selected option. Instead it repairs the MSI. I tried deleting entries from Windows\Installer folder so that MSI will not pick cashed installed version but no luck. If anybody is having answer on how to forced MSI to re-install through MSI setup wizard please let me know.

Resources