Customizing Repair option in MSI - installation

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.

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).

Wix uninstall confirmation dialog on program and features (yes/no) before MSI progress bar

I have a ASP.NET Core web application that uses Wix to install and uninstall.
When I uninstall the MSI from program and features I wanted to create a confirmation dialog (yes/no) the moment I click remove this application on program and features.
Is it possible to add a dialog before the msi starts to uninstall.
If I click yes on the dialog the msi just continues to uninstall
If I click no the msi exists and doesnt uninstall
Background Information: About the Add / Remove Programs Buttons (towards bottom).
Default: I do get an "are you sure you want to uninstall" dialog before I get the UAC elevation prompt when trying to uninstall WiX MSI files at least? There is a "do not show this dialog again" check box though. Windows 10.
Silent Mode: The problem with what you ask is that you run the uninstall in silent mode when you invoke it from the Uninstall button in the ARP applet. This means that the entire InstallUISequence is skipped and only the InstallExecuteSequence runs - and there should be no dialogs shown from this sequence.
Options: I can think of a couple of options off the top of my head.
Breaking Radio Silence: You can insert a custom action showing a prompt in the InstallExecuteSequence anyway, but it is not recommended. You would have to condition it very well to make sure it does not show up unexpectedly. That would entail detecting that it is not a major upgrade and a number of other things I would not recommend trying. Too many things to work out and too much that can go wrong.
Modify Button Only: You can hide the Uninstall button and just leave "Modify" in place in the ARP applet dialog?
That
way your setup will be triggered in GUI mode, and you can insert a
dialog there if you want to, but you also have plenty of opportunity
to cancel the Uninstall before it is invoked. You don't even need an extra dialog?
To achieve this, set in Property Table: ARPNOREPAIR = 1 and ARPNOREMOVE = 1.
Links:
InstrallShield Basic MSI uninstall does not display a dialog with Finish button

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 to do the uninstall process by using UI dialog box?

i.e. If i click the uninstall button in UI dialog box It should process uninstall for my msi file. what things i need to add to the wix coding and is that custom action need for this?
There is no need for a custom action.
You will have to include one of the Wix provided dialog sets as part of your installer source code.
http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_minimal.html
Your requirement can very well be met by making use of the WixUI_Minimal dialog set.
For an example of how to include a built in dialog set to your installer, please see the following URL:
http://wixtoolset.org/documentation/manual/v3/wixui/wixui_dialog_library.html
Hope this helps.

uninstall dialogs

I am composing a setup project in VS2010 . I want to add a dialog with checkbox for the user to specify if he wants to delete the database or not. But I can't figure out how to do it: the user interface doesn't represent the uninstall dialogs on the "view dialogs" form. So I can show a messagebox instead, but then there is another problem: how can a person specify whether the database should be deleted or not if the uninstaller is launched in a quited mode? In that case some parameters should be passed to the setup project somehow. Got any thoughts?
Right now I am trying to use Orca, it is a part of Windows Installer SDK.
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en
It might solve my problem.

Resources