cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Amarjeet
Level 7

Detect installation of .net framework 4.5.2 from System Search

Hi,

For detecting installation of .Net framework 4.5 from system search one can search for below:



But if I want to search specifically for .Net framework 4.5.2 I need to check value of the release key. Its 379893 for .net framework 4.5.2. ( Above key exists for .net 4.5 with value 378389)

Is there any way I can search for this value from system search ? ( This is possible with pre requisite condition in pre requisite editor)

Regards,

Amarjeet
Labels (1)
0 Kudos
(19) Replies
DLee65
Level 13

Amarjeet,

You are right on target for this, but the way this works is that your system search will return the value of 'Release' and you should assign this to a property. Then you can set your property as a condition for installation.

When the condition builder displays it will display the property name. Just modify this for if the value is less than the target value. Then set the text you want to display if the condition fails.
0 Kudos
Amarjeet
Level 7

Hi Dan,

Thanks for your suggestion. It works !

I am on verge of finishing my work except two issue below :

1) I am not able to track progress of the .NET framework installation from setup progress dialog. Documentation is available on internet. For pre requisites implementation is

in prqlaunch.dll. If you have any documentation which a non programmer can understand please send the same.


2) When invoking setup from custom action the setup does not get elevated privileges, as setup is required to copy the files on c: drive. IF UAC is ON the setup fails as due to

lack of privileges, it fails to copy files on temporary directory on c: drive.


I will be happy of you can provide some thoughts on above issues.

Regards,

Amarjeet
0 Kudos
DLee65
Level 13

Amarjeet,

Are you distributing this version of .NET Framework with your install? If so, you can set these conditions using the prerequisite editor.

You can even use the existing copy of the .NET Framework prerequisite as the basis for the new one, just be sure that you save it as a copy.

If you are not familiar with the prerequisite editor, then here are a few tips:

  • Click 'Redistributables' in the left view list
  • In the 'Search Grid' type '.NET Framework 4.', you should see several results
  • Right click on one of the options, most likely 'Microsoft .NET Framework 4.5 Full'
  • Select option to Edit Prerequisite
  • Select File, SaveAs (F6)
  • Save your file to a location that can be added to source control
  • In the 'Files to Include' tab, select the dot net framework executable listed.
  • Modify the path for the file to the appropriate path for the redistributable you have downloaded
  • If you can determine the download link for this file, modify the linkID as well.
  • Select the 'Conditions' tab
  • Find the line for 'Registry Entry has a certain value and modify this value
  • Modify this Release value to the appropriate value for 4.5.2
  • Select the Properties tab and modify the GUID to a new valid GUID or just a unique name like MicrosoftNETFramework452.
  • Remove the 'Alternate location to download .prq ...' value especially if you select option for web download. If you select web download option be sure your link on previous tab is correct.
  • Review settings in the other tabs to be sure they are what you expect.
  • Save the PRQ file


Since you are adding a .PRQ file to a custom location, you have to modify your UI settings to handle the custom location. Click 'Tools, Options'. Select Prerequisite tab and add the custom path to the appropriate line. I usually just add it to All Users since I am the only user on my workstation.

Another thing to note is that you either have to add the prerequisite path to you command line for the standalone build or modify the registry to include the path for prerequisites. [HKEY_LOCAL_MACHINE\SOFTWARE\InstallShield\20.0\Professional]
MMSearchPath=
PrerequisiteSearchPath=,, ...

Another thing to note is that Prerequisites can utilize InstallShield path variables, such as the current project directory, allowing you to use relative paths. This is helpful when referencing your redistributable file. Notice that the example utilizes this ability, specifying the path variable.

Hopefully this helps.

Also, even if you are providing this as a prerequisite, it is still good practice to include a system search for this for the MSI file in case anyone extracts the MSI and runs it separately, for example when doing administrative installs and pushing using Active Directory. You want to be sure if the MSI is distributed separately that the installer fails gracefully if the prerequisites are not met.
0 Kudos
DLee65
Level 13

Opps, I just read your post again. My email had different text and I neglected to read carefully before responding.

It sounds as if you have a custom process that handles installing prerequisites and that you bypass the prerequisite installer for InstallShield.

Unfortunately, if you are using a custom process then I am not certain how I can help you other than to remind you that you cannot run this in the EXECUTE sequence but only in the UI Sequence. That is because the MSI engine is locked in the EXECUTE sequence and the .NET installer has an embedded .MSI File if memory serves me correctly. I am not certain how you can get this to show a progress bar, perhaps, if you do not mind pop-ups the .NET framework installer has the concept of a /qb switch so that only its progress bar is shown.
0 Kudos
Amarjeet
Level 7

Hi Dan,

/qb does not work as I again get this irritating message " Waiting for another install to complete" for 15 minutes. Then this message disappears and installation goes smooth. With /q I am able to hide this message and everything runs in background.

Contacted Microsoft for this message but no help.

I think the only outstanding issue for me is elevate the permissions when .msp is launched. Right click and run as administrator option is not available for .msp files.

Do you have any idea any setting in install shield which can enable elevation of the permissions.

Regards,

Amarjeet
0 Kudos
DLee65
Level 13

Can you share details on how you have the custom action scheduled?

The message, " Waiting for another install to complete" sounds as if you are scheduling the .NET install custom action during the execute sequence and not the UI sequence. Microsoft limits you to only running one MSI at a time. If you try to launch another then the OS will show this type of message. Once your progress dialog appears, you are in the execute sequence and not the UI sequence. There isn't any way to by-pass this limitation that I know of.

So in the view menu select 'Custom Actions and Sequences'
Under Custom actions select your custom action.
Under the Sequence section check to see if you have this scheduled during the UI Sequence or Exec Sequence.

If you want this to appear to install as part of the execute sequence you need to remove this as a custom action of the MSI and create a Suite/Advanced UI package where you can chain several MSI installations together and have it report on the progress bar. That is what I did to handle installing our applications's prerequisites and particular SQL Server 2012 Express.

I suspect you have some significant reason for crafting your own prerequisite installer rather than utilizing the integrated prerequisite installer for Basic MSI?
0 Kudos
Amarjeet
Level 7

Hi Dan,

I would like to install .net framework 4.5.2 as part of the patch (.msp ) file. The patch should install the .net framework as well as patch assemblies of already installed product. The base product was compiled against .net framework 4.0 and now new patch assemblies are compiled against .net framework 4.5.2. I know its weird and not recommended.

My custom action looks like below :



Please have a look.

Regards,

Amarjeet
0 Kudos
DLee65
Level 13

Just as a test, try scheduling this just before the progress dialog.

I wonder if the MSP rules are different and that because this is a patch it initializes the MSI engine earlier? This is only a hypothesis.

Can't you convince the powers that be that Microsoft does not allow this without a major upgrade? If developers have changed the requirements then they should expect there is a cost. If they MUST have a patch, then they need to recompile their code so it ONLY requires the same version of .NET Framework that the application shipped with.

Another test is to try this with a 'new' install to see if you can get it to work there when scheduled in the same location. You will, of course, need to modify the conditions.
0 Kudos
Amarjeet
Level 7

Hi Dan,

I don't get message in Windows. I get message on .net framework installation UI which is very annoying.




Regards,

Amarjeet
0 Kudos
DLee65
Level 13

This is what I would expect if another MSI is running.

For testing this I would start with a clean VM that has my original application installed.
I would open Task Manager and view all processes.
Look to see how many msiexec processes are running.
Launch your msp and when you are on the welcome screen see if the number of processes for msiexec jumps. It may because the .msp is a difference file between your original MSI and the bits that changed in the .msp. Even if you are including whole files in your release configuration for the patch, it still has to look at the original MSI cached in Windows\Installer.

When you get to the place where .NET framework should be installing, then look at the number of MSIEXEC processes running. My guess is that you have one already active and this one is waiting for the other to stop.

One thing to watch for is to ensure that all windows updates have been installed. I have seen scenarios where Windows Update launches and starts automatically updating the operating system and I encounter this problem. We always advise the customer to ensure Windows is up-to-date.

But I can almost guarantee that the message you are seeing is because it is waiting for another MSIEXEC process to finish before launching a new one. And for this problem the only solution is to schedule this BEFORE the other MSIEXEC process starts.
0 Kudos
Amarjeet
Level 7

Hi Dan,

You are right. I am testing exactly same way as described by you. Issue of windows update is out of scope because I disabled windows updates before starting installation. Ensured that there no msiexec process.

When I start installation two msiexec process are started. One normal and other in system context. These processes are started by installshield. If I kill one of them .net framework installation proceeds smoothly.

I tried invoking the .net framework as first action, still same issue persisted. Its because as soon as double click msp file these two processes are started.

Regards,

Amarjeet
0 Kudos
DLee65
Level 13

I doubt that 'InstallShield' is starting the MSI. If you crafted this with another tool, such as WIX, you would see the same behavior. It is a fundamental design of the way that Windows Installer works.

I know I saw the same type of behavior when we were using Wise Installer before converting it to InstallShield.

The only solutions available to you that I know of are:

1. Deliver the updated application as a major upgrade. This will ensure that .NET Framework 4.5.2 gets installed properly.
2. Recompile the application so that the version of .NET Framework matches what was used for the original application.


Take what you have learned here back to your project manager and demonstrate why this approach will not work, they are trying to change the architecture of Windows Installer itself. Give them the options that will work and let them make the decision on how to proceed. It is our job as Release Engineers to help others better understand the limits of the architecture.

Good luck.
0 Kudos
Amarjeet
Level 7

Hi Dan,

Thanks for your kind support till date. I will try to convince my authorities.

Regards,

Amarjeet
0 Kudos
Amarjeet
Level 7

Hi Dan,

Last and final question. How install shield behaves when installing pre requisites ?

When install shield invokes setup.exe does it check for running instances of msiexec. If they are found does install shield kills them.

I tried the same by creating stand alone installation which only install .net framework 4.5.2 and does nothing. I faced same problem.

If you are able to find time can you please try installing .net framework 4.5.2 from Install shied Prerequisites.

Regards,

Amarjeet
0 Kudos
DLee65
Level 13

Good questions.

The good part of prerequisites is that the EXE manages the prerequisites for you before the msi even runs.
If the prerequisite does not show up check for the following

1. Are the conditions all true? Edit your prerequisite and just double check the settings.
2. Confirm manually that the testing operating system meets your conditions set in the prerequisite editor.
3. When you compile the setup make sure there are no warnings /errors.

Make sure you are running the setup.exe and not just a compiled MSI. The msi will be bundled inside of the EXE and will launch once all prerequisites are installed.

I can see what I can whip up here if I have time.
0 Kudos
DLee65
Level 13

I was able to successfully create a sample installer with this.

I will attach the project file and prerequisite. Note that my install assumes a layout where I have C:\work\installers\.
I had to delete the downloaded .NET Framework file from the Redistributable folder and the compiled setup so that the file could be uploaded.

My folder structure looks like the following

  • Installers

    • PrerequisiteFiles
    • Redistributables
    • TestProject



I tested the install on a clean windows 7 x86 operating system.
IMPORTANT: The .prq file needs to be modified so that it supports a silent install unless you are OK with the .NET dialogs. You will have to research what the command line should be to make it completely quiet. I just used the settings from the .NET Framework 4.5 Full prq.
ALSO, the PRQ itself assumes a relative location to your project file, just modify the path to the file to fit your needs.
0 Kudos
Amarjeet
Level 7

Hi Dan,

Finally I was able to install .NET framework 4.5.2 from my patch package (.msp). The package works well in GUI and Silent installation with UAC ON / OFF.

My approach is as below.

- Check installation of .net framework from system search and store the result in property. Pretty simple and standard.

- Create two custom actions. One for UI based installation and one for silent installation.

- For UI custom action Return processing is Async.( No wait for completion ) and execution scheduling is always execute. This custom action is absent in UI and exec. sequence.

- On setupcompletesuccess dialog box a button called finish exists. When .net framework is installed this dialog behaves as usual and exits after installation of my product is over.

- I have created another button and few text boxed on this dialog box. This button is called install and the text is visible when .NET framework 4.5.2 is not installed. I have added event for this button. The event invokes custom action written for GUI based installation.

- The second event ends this dialog. By ending this dialog the .NET installation goes smooth. ( if I don't end the dialog I get message....."waiting for another install to complete.........")

- For silent installation the custom action is scheduled in Exec Sequence after ScheduleReboot. Return processing is Async. and In script execution is Deferred execution in System Context.


Benefits of this approach :

- .Net framework installation is invoked after my main installation is over. So even if .Net installation fails due to any reason my main installation is safe.

Let me know if you have any questions ( I am open to accept private messages !)

Amarjeet
0 Kudos
SGSlavendea
Level 4

For reference, this is what worked for me:



Guidance here: http://msdn.microsoft.com/en-us/library/aa371168%28VS.85%29.aspx
0 Kudos
Amarjeet
Level 7

Hi SG,

Thanks. Help from you appreciated. I am not sure why its not working for me.

But anyway by creating a new property I am able to achieve what's desired.

Regards,

Amarjeet
0 Kudos