create native image during installation

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

Can anyone point me to a place where I can use a custom
action within a C# setup project to generate a native
image on the target machine during installation?

Thanks!
 
I'm going from memory here so bear with me - I don't think
there is an option per se to go native. I think you have
to either manually do it on the command line or get the
proper compiler switch settings from the command line
assembler and feed them into project settings somewhere...

Just curious - why would you want to go native? From what
I've read the downside of going native is more painful
than one time JIT costs...

--Richard
 
This particular app's startup time is slow. The native
image will speed that up. The performance hit, if there
is one, on the rest of the apps execution will too small
for the end user to notice. However, due to the decreased
startup time, the app will "appear" to be more responsive;-
)
 
[DllImport("mcscoree.dll")]
private extern int GetCORSSystemDirectory([MarshalAs
(UnmanagedType.LPWStr)] StringBuilder Buffer, int
BufferLength, ref int Length)

But I'm not sure. . .is my translation correct?

Looks correct to me.

Another option is to use
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top