MSI vs MSP and UAC elevation - Advanced Installer Community
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

MSI vs MSP and UAC elevation

OK I'm new to MSI and MSP concepts. What is bringing me here now is Win7 (really Vista) and UAC elevation.

Our users are accustomed to installing our patches without the need for elevated privileges. In WinXP we would install into the Program Files folder (our EXE and supporting files), plus into Common App Data (our changeable data files) and Common Documents (the user's data files). We got around the permissions/elevation by giving them an option within our old installer to run CACLS to open up the permissions on the those folders to allow for the easiest monthly update user experience. That's pretty much not going to be allowed by Win7 and future releases as I understand it. And the only way to prevent the consent.exe (or UAC elevation) is to a) install per-machine, b) code-sign our setups and c) have an Administrator do the initial full setup.

Now, how to go about this? I would prefer to do what we are already accustomed to doing with our old installer which is to provide our users with a Full Setup (for their initial install) and then monthly Updates; the Update releases contain the same files as the Full Setup (except that bug fixes and enhancements are added, and the required run-times, windows OCXs and DLLs are excluded). So our Update release is typically about 30-40% of the size of the full setup; and includes only the files that we own/create (no system files).

I feel confident I can get my AI projects to produce a Full Setup MSI and an Update MSI to mirror what we have done in the past --that is, two projects (full setup project) with all of our files + runtimes + windows system files and (update project) with just our files, but:

1) will doing it this way allow us to do patching without elevation?
2) what will be the ProductCode ramifications for this sort of scenario?

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MSI vs MSP and UAC elevation

Hello,

In order to create a patch you can take a look on our "Patches" and "Patch Authoring" articles. Mainly, a patch is a diffs between the two versions of the product. When creating a patch, both target and upgraded MSI should have the same ProductCode. Also, there is a list of patches rules you should carefully follow.

In order to install a patch without elevation you can digitally sign, using the same certificate, both of your MSIs (target and upgraded) and check the "Enable installing of patches for this product without elevation" option from our "Digital Signature" page.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: MSI vs MSP and UAC elevation

Hi Daniel,
Thanks for the links to the those tutorials/etc. I have read the patch rules as well, and I don't think in my tests I'm violating any of those rules, but we still have a few problems:

1) during our full setup we create or update an Program Files folder INI file with to a pointer to the user's common appl data folder. Each time we install a patch we create an additional folder under that tree (C:\ProgramData\<ManufacturerName>\<ProductName>\<ProductVersion>), so we retain a set of 2 files for each release in that folder tree. How do I make it so that when a user installs he MSP file we can update the INI file in the Program Files tree to reflect the current version?

2) do the Target and Upgraded image files have to be MSI files in order to be usable in patch authoring? or can they be bootstrapped EXE files?

3) similarly, I understand the name of the MSI cannot change between the Target and Upgraded images, so our tradition of naming our files with a version# (such as: Setup_<version#>.EXE) will have to be dropped?

4) do we have to use your Auto Updater feature to do the actual delivery of our monthly patch updates, or is it possible to use an auto-update feature that we have written and that our user's are already accustomed to?

I appreciate all of your help with my many questions!!!
Best regards,
Kevin
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MSI vs MSP and UAC elevation

Hello Kevin,
1) during our full setup we create or update an Program Files folder INI file with to a pointer to the user's common appl data folder. Each time we install a patch we create an additional folder under that tree (C:\ProgramData\<ManufacturerName>\<ProductName>\<ProductVersion>), so we retain a set of 2 files for each release in that folder tree. How do I make it so that when a user installs he MSP file we can update the INI file in the Program Files tree to reflect the current version?
For this you can create the INI file into desired folder from "Files and Folders" page and, then set the related INI entry which contains the user path to be updated (Action: Create or update).
2) do the Target and Upgraded image files have to be MSI files in order to be usable in patch authoring? or can they be bootstrapped EXE files?
You can also build your target and upgraded installation files as EXE packages (e.g. with resources inside). In this case, in order to create a patch between them you can use the /extract command to extract the MSI from EXE setups. Then you can use the extracted MSI as target and upgraded images for creating the patch.

Also, when building EXE setup packages you should enable the "Do not delete extracted MSI and CAB files" option, from "Media -> Configuration" tab, in order to avoid the original MSI request error when the patch is installed.
3) similarly, I understand the name of the MSI cannot change between the Target and Upgraded images, so our tradition of naming our files with a version# (such as: Setup_<version#>.EXE) will have to be dropped?
You can use different names for your EXE setups. You should only make sure that the target and upgraded MSIs have the same name. In order to achieve this you can go to "Media -> Configuration" tab and specify the same name in the "MSI Name" field.
4) do we have to use your Auto Updater feature to do the actual delivery of our monthly patch updates, or is it possible to use an auto-update feature that we have written and that our user's are already accustomed to?
It is your choice what auto-update tool to use in order to deliver your installation updates. It is not mandatory to use our Updater tool.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: MSI vs MSP and UAC elevation

Hi Daniel,
Thanks for the responses... however, I'm still a little unclear about this scenario:

1) during our full setup we create or update an Program Files folder INI file with to a pointer to the user's common appl data folder. Each time we install a patch we create an additional folder under that tree (C:\ProgramData\<ManufacturerName>\<ProductName>\<ProductVersion>), so we retain a set of 2 files for each release in that folder tree. How do I make it so that when a user installs he MSP file we can update the INI file in the Program Files tree to reflect the current version?
You explained:
For this you can create the INI file into desired folder from "Files and Folders" page and, then set the related INI entry which contains the user path to be updated (Action: Create or update)
I do already have the INI file with the variable value being added/created when the user does a full install. My Edit INI Entry action looks like this:
Key = Application Data
Value = [CommonAppDataFolder][ManufacturerName]\[ProductName]\[ProductVersion]\
Action = Create or update

So, this all seems to work perfectly. But, what I don't know how to do yet is edit that existing INI entry each time during the execution of a patch. The AI Patch interface doesn't seem to have a "Files and Folders" section, so I have no idea how to tell the MSP how it should modify that INI file.

Thanks!
Kevin
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MSI vs MSP and UAC elevation

Hello Kevin,

Please keep in mind that if your both (target and upgraded) MSIs contain the above INI file added in "Files and Folders" page, then the patch file created between your target and upgraded MSI will automatically include the "Create or update" action for the related INI entry. So, all you have to do before creating the patch is to make sure that the above INI file (containing the related INI entry) is added in both of your MSIs (target and upgraded). Then, the above INI entry value should be updated each time you install a patch.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: MSI vs MSP and UAC elevation

Hi Daniel,
My target and upgraded MSI do contain the same INI file in the "Files and Folders" page. As I mentioned before it has these variables that are populating the INI file:

Code: Select all

Key = Application Data
Value = [CommonAppDataFolder][ManufacturerName]\[ProductName]\[ProductVersion]\
Action = Create or update
And so, to confirm that the target and upgrade installations are also doing what I want them to do I just installed the MSIs on separate VM instances and again I got the expected results inside the INI file. Here is what I did:

First, on a clean VM, I ran the full setup of our 13.02.00 version and it get's this result in the INI file, as expected:

Code: Select all

Application Data=C:\ProgramData\<ManufacturerName>\<ProductName>\130200\
Then, I relaunched the clean VM and ran the full setup of our 13.03.00 version (sourced from the same AIP project framework) and it get's this result in the INI file:

Code: Select all

Application Data=C:\ProgramData\<ManufacturerName>\<ProductName>\130300\
Is there something else I could be doing wrong?
Is there a way for me to analyze the MSP file for clues?

Thanks,
Kevin
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MSI vs MSP and UAC elevation

Hello Kevin,

Can you please send us the .AIPs (project files) of your target (13.02.00) and upgraded (13.03.00) packages to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: MSI vs MSP and UAC elevation

Hi Daniel,
I will send you what I have.

The interesting thing though (and this could just be my lack of education or misunderstanding of the terminology), I only have the one AIP file. I created my first testing installer using our v13.02.00 system. Then, to test the LUA patching (or no UAC elevation) I then opened the v13.02.00 AIP file and changed the Product Version to 13.03.00 and when prompted with a dialog to choose between "Major", "Patch" or "Cancel", I chose "Patch". Obviously when I did a build of the v13.03.00 installer package it auto-saves the AIP file so I don't have the v13.02.00 AIP file any longer.

(ah, wait! I see the path AIP file). So maybe that's what you were asking for.
I will send the original AIP (13.02.00 originally, but now it calls itself 13.03.00 internally), plus the "130200 to 130300 Patch" AIP file.

Please let me know if you need any other files.

Thanks,
Kevin
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: MSI vs MSP and UAC elevation

Hi Daniel,
Thank you for your emailed Sample AIP file. Indeed that sample project indicates that what I'm trying to do should be possible, however, I think the problem I'm having (now conclusively nailed down) is that the CommonAppData folder is not getting created --as it should be-- by my Patch MSP file.

Recall that each version of our system creates it's own folder here:
[CommonAppData]\[Mfr Name]\[ProductName]\[ProductVersion]
and in that folder we put a small set of files (typically 2-10 files).

So, in Win7 we need the installer to add a set of files in these folders
C:\ProgramData\Sample\Your Application\100\
C:\ProgramData\Sample\Your Application\110\, etc.

Can you extend your Sample.AIP to include this requirement and also provide the associated patch that shows me what I have to do to make this work?

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MSI vs MSP and UAC elevation

Hello Kevin,

I'm afraid you cannot achieve what you want using a patch. Please keep in mind that one of the patches rules is "Do not move files from one folder to another". Therefore, if you will have a file added under a folder location (e.g. [CommonAppData]\[Mfr Name]\[ProductName]\[ProductVersion]) which will be resolved to different location between the target and upgraded version of your installation projects, then the resolved location of your upgraded project file setup will not be included in the patch file. Unfortunately, the only workaround in order to achieve this is to use a major upgrade installation or to preserve the folder path of the related file (you can use a path like this [CommonAppData]\[Mfr Name]\[ProductName]).

Also, I apologize because I initially didn't observed this specific configuration in your sent project file.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: MSI vs MSP and UAC elevation

Hi Daniel,
Are those patching rules you linked me to a set of AI rules or are they Microsoft's MSI technology stack rules?
So it sounds like the MSP is not the way to go for us, unless we re-structure our application to start using a "steady" folder (such as [CommonAppData]\[Mfr Name]\[ProductName]).

So, the next question for you is regarding Major Upgrades. Since I don't have any experience with MSI way of doing Major Upgrades the first question is what is the inter-relationship between Major Upgrades and UAC patching option that AI offers, specfically the "Enable installing of patches for this product without elevation" setting.

Back to basics:
We are being forced to moved to MSI-based installer because Win7 is no longer allowing our product to be installed without UAC elevation.
Our user-base is too diverse to allow elevation to be acceptable; e.g. some users are on the road and don't have an Administrator with them, so must be able to do our software updates without UAC elevation.
We cannot use "patch" upgrades (MSP) because our system --as it is now-- violates one of the patching rules, namely "Do not move files from one folder to another": e.g. [CommonAppData]\[Mfr Name]\[ProductName]\[ProductVersion]
So, what are the pros and cons of major upgrades as an alternative? Will our user base be able to do non-UAC patching if we do major upgrades?

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MSI vs MSP and UAC elevation

Hello Kevin,
Are those patching rules you linked me to a set of AI rules or are they Microsoft's MSI technology stack rules?
These are Windows Installer technology rules.
So, the next question for you is regarding Major Upgrades. Since I don't have any experience with MSI way of doing Major Upgrades the first question is what is the inter-relationship between Major Upgrades and UAC patching option that AI offers, specfically the "Enable installing of patches for this product without elevation" setting.

In order to achieve what you want you can create your updates packages as major upgrades. Also, if you want to install the updates without elevation you can use our "Updater" tool and configure it to handle updates without elevation.

Let us know if you have any questions.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: MSI vs MSP and UAC elevation

Hi Daniel,
Thanks again for the responses.

Sorry to stay on this but I need to 100% clear. If we go the "major upgrades" direction, which it seems we will have to, you are saying that it is possible to do UAC-less patching of our application? I would hope that if I start with 13.03.00 and make a major upgrade to 13.04.00 and the signed 130400 Setup file contains the same digital certificate as the original 130300 Setup file then it would be allowed by Win7 to be installed without elevation (i.e. the user will not see the Credential UI or the Consent UI)? But I don't know this to be the case.

Or, are you saying that with our scenario in order to do "updates without elevation" that we will have to use your Updater tool?

Thanks.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MSI vs MSP and UAC elevation

Hello Kevin,

I mean that if you will have to create your updates packages as major upgrades, then you should use our Updater tool and you should configure it to handle updates without elevation. In this way the updates will be installed (using our Updater tool) silently and without elevation.

Let us know if you have any question.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”