cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reureu
Level 10

NGEN still not called correctly

Hi,

After all this time, and after all these threads about the .NET Precompile assembly not working properly, IS 2010 still does not solve the problem!

Let's assume I have 3 .NET 2.0 assemblies: Assembly1.dll, Assembly2.dll and Assembly3.dll , each in its own component.
Let's assume that I set the ".NET Precompile Assembly" setting to "Yes" for each assembly.

What the generated custom action calls is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe /nologo /silent "C:\Program Files\InstallDir\Assembly1.dll" "C:\Program Files\InstallDir\Assembly2.dll" "C:\Program Files\InstallDir\Assembly3.dll"


Forget it! That doesn't work!

What should be called on installation is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe /nologo /silent install "C:\Program Files\InstallDir\Assembly1.dll"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe /nologo /silent install "C:\Program Files\InstallDir\Assembly2.dll"
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe /nologo /silent install "C:\Program Files\InstallDir\Assembly3.dll"


It is not complicated, is it?
Since .NET 2.0,

  • NGEN needs to be called separately for each assembly
  • NGEN requires an action: either "install" or "uninstall"


Calling NGEN once with several assemblies, without any action does not work! It might have worked with .NET 1.1 (I'm even not sure), but it won't with .NET 2.0

On uninstallation, the /delete option is also no longer applicable!

Why has this issue not been solved in IS 2010?
The problem was already identified in InstallShield Windows 12, if I believe http://community.installshield.com/showthread.php?t=177347.

Has Acresso any bugfix in the pipeline?

Regards
Labels (1)
0 Kudos
(9) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

This is being tracked in our system as IOC-000061592. It's been languishing a little, as the perceived benefit to cost ratio has been undervalued. I'll add your report to the mix, and that should help to tilt this in your favor.
0 Kudos
Reureu
Level 10

Hi Michael,

Thank you for your answer.
Is there any more accurate plan as to when a hotfix could be made available?

It would be so much easier if that feature was working, as it would save me much work in defining 2 custom actions for each .NET assembly I need to precompile.

Regards
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

I don't have any information on when this would be made available. However if you are making 2 actions for each of n assemblies, and n is a noticeable number, you should probably consider a different approach. Add a custom table, say NgenAssembly which has a foreign key into the Component or File table. Then have your custom action walk this table and component states to figure out which files need to be processed. This way you can have just one set of custom actions (probably one prepare/costing action, one deferred execution, one commit and one rollback; possibly you'll want an earlier set for uninstall as well...)
0 Kudos
Reureu
Level 10

Hi Michael,

Thanks for your answer.
I am considering a different approach indeed and your idea makes sense.
But instead of creating my own table, I might just define the components in a string, like
#define NGENCOMPONENTLIST "MyComponent1,MyComponent2,MyComponent3"
and parse it.
It would obviously be easier to use the .NET Precompile Assembly setting.
That's why I would have liked to know whether this fix would be available soon, or whether I should really implement this workaround.

Regards
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Oh certainly, you can just shove them in a property. If you're careful, you can probably even use the property we currently create when you select the Precompile Assembly option, but you'll want to replace the custom actions we create each time you modify that option.
0 Kudos
alegerlotz
Level 7

MichaelU wrote:
Oh certainly, you can just shove them in a property. If you're careful, you can probably even use the property we currently create when you select the Precompile Assembly option, but you'll want to replace the custom actions we create each time you modify that option.


I typically leave the custom actions in place, I just nullify their conditions by putting a 0 in the condition field.

I've done as you suggested in the past with regard to creating a custom table and processing the entries. It worked pretty well.
0 Kudos
ACBeddoe
Level 3

MichaelU wrote:
... Add a custom table, say NgenAssembly which has a foreign key into the Component or File table. Then have your custom action walk this table and component states to figure out which files need to be processed. This way you can have just one set of custom actions (probably one prepare/costing action, one deferred execution, one commit and one rollback; possibly you'll want an earlier set for uninstall as well...)


Or, Acresso could fix this necessary feature.
0 Kudos
Reureu
Level 10

Hi,

As I have finally been working on the workaround, I have noticed 2 more problems related to this issue:

  • When you activate the precompilation in the component .NET settings, 2 custom actions appear in the InstallExecuteSequence: ISJITCompileActionAtInstall and ISJITCompileActionAtUnInstall.
    But there is no corresponding rollback action, so the native assemblies are not removed from the native assembly cache if an action fails after ISJITCompileActionAtInstall.
  • The condition of ISJITCompileActionAtInstall is wrong: IS 2010 sets it to Remove<>"ALL". It should be REMOVE<>"ALL". Indeed, the Remove property is empty, so Remove<>"ALL" is always TRUE.

Michael, could you please add these 2 points to IOC-000061592, if it hasn't been done already?

All this gives me the impression that this functionality has not been tested at all before releasing IS 2010! That's a shame. WiX seems to do a better job.
0 Kudos
SIMSSoft
Level 2

It's been 5 years now and this still hasn't been fixed in InstallShield 2014 Version 21. It seems like something that would take a developer only a few hours to fix. Why not fix it?
0 Kudos