Click here to Skip to main content
15,914,406 members
Home / Discussions / C#
   

C#

 
General[Message Deleted] Pin
Bekjong4-Jan-08 0:03
Bekjong4-Jan-08 0:03 
GeneralRe: Ngen on setup, VB to C# translation Pin
Giorgi Dalakishvili4-Jan-08 0:16
mentorGiorgi Dalakishvili4-Jan-08 0:16 
GeneralRe: Ngen on setup, VB to C# translation Pin
Bekjong4-Jan-08 0:18
Bekjong4-Jan-08 0:18 
GeneralRe: Ngen on setup, VB to C# translation Pin
Bekjong4-Jan-08 0:14
Bekjong4-Jan-08 0:14 
GeneralRe: Ngen on setup, VB to C# translation Pin
Giorgi Dalakishvili4-Jan-08 0:28
mentorGiorgi Dalakishvili4-Jan-08 0:28 
GeneralRe: Ngen on setup, VB to C# translation Pin
Bekjong4-Jan-08 1:36
Bekjong4-Jan-08 1:36 
GeneralRe: Ngen on setup, VB to C# translation Pin
Giorgi Dalakishvili4-Jan-08 1:49
mentorGiorgi Dalakishvili4-Jan-08 1:49 
GeneralRe: Ngen on setup, VB to C# translation Pin
Bekjong4-Jan-08 2:03
Bekjong4-Jan-08 2:03 
I'm on Vista and getting code 2869, no further explanation. I've googled it for a bit and now suspect it's a security problem. This would mean the p/invoke call is actually good now. This is the code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Runtime.InteropServices;
using System.Text;
using System.Diagnostics;

namespace InstallationHelper
{
    [RunInstaller(true)]
    public partial class InstallationHelper : Installer
    {
        [DllImport("mscoree.dll")]
        static extern int GetCORSystemDirectory(
           [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPWStr)] StringBuilder buffer,
           Int32 buffer_length,
           ref Int32 length
            );

        public InstallationHelper()
        {
            InitializeComponent();
        }

        [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
        public override void Install(System.Collections.IDictionary savedState)
        {
            base.Install(savedState);
            string Args = this.Context.Parameters["Args"];

            if (Args == "")
            {
                throw new InstallException("No arguments specified");
            }

            // Gets the path to the Framework directory.
            System.Text.StringBuilder Path = new System.Text.StringBuilder(1024);
            int Size = 0;
            GetCORSystemDirectory(Path, Path.Capacity, ref Size);

            Process P;
            // Quotes the arguments, in case they have a space in them.
            ProcessStartInfo Si = new ProcessStartInfo(Path.ToString() + "ngen.exe", "\"" + Args + "\"");
            Si.WindowStyle = ProcessWindowStyle.Maximized;
            try
            {
                P = Process.Start(Si);
                P.WaitForExit();
            }
            catch (Exception e)
            {
                throw new InstallException(e.Message);
            }
        }


    }
}



Standards are great! Everybody should have one!

GeneralRe: Ngen on setup, VB to C# translation Pin
Giorgi Dalakishvili4-Jan-08 2:14
mentorGiorgi Dalakishvili4-Jan-08 2:14 
AnswerRe: Ngen on setup, VB to C# translation Pin
Bekjong4-Jan-08 2:20
Bekjong4-Jan-08 2:20 
GeneralRe: Ngen on setup, VB to C# translation Pin
Giorgi Dalakishvili4-Jan-08 2:21
mentorGiorgi Dalakishvili4-Jan-08 2:21 
Generalwriting dataset to xml Pin
cellardoor07163-Jan-08 22:54
cellardoor07163-Jan-08 22:54 
QuestionLoading Text into a RichTextBox (With a catch) Pin
Programm3r3-Jan-08 22:52
Programm3r3-Jan-08 22:52 
GeneralRe: Loading Text into a RichTextBox (With a catch) Pin
Giorgi Dalakishvili3-Jan-08 23:05
mentorGiorgi Dalakishvili3-Jan-08 23:05 
GeneralRe: Loading Text into a RichTextBox (With a catch) Pin
Programm3r3-Jan-08 23:35
Programm3r3-Jan-08 23:35 
GeneralRe: Loading Text into a RichTextBox (With a catch) Pin
Giorgi Dalakishvili3-Jan-08 23:47
mentorGiorgi Dalakishvili3-Jan-08 23:47 
GeneralRe: Loading Text into a RichTextBox (With a catch) Pin
Programm3r4-Jan-08 0:02
Programm3r4-Jan-08 0:02 
GeneralRe: Loading Text into a RichTextBox (With a catch) Pin
Giorgi Dalakishvili4-Jan-08 0:20
mentorGiorgi Dalakishvili4-Jan-08 0:20 
GeneralThanks for the help Pin
Programm3r4-Jan-08 0:58
Programm3r4-Jan-08 0:58 
GeneralRe: Thanks for the help Pin
Giorgi Dalakishvili4-Jan-08 1:05
mentorGiorgi Dalakishvili4-Jan-08 1:05 
QuestionHow to show the datatable values in combobox? Pin
kssknov3-Jan-08 22:50
kssknov3-Jan-08 22:50 
GeneralRe: How to show the datatable values in combobox? Pin
Justin Perez4-Jan-08 3:39
Justin Perez4-Jan-08 3:39 
QuestionIn C# is there any way to know the number of non null elements in an array? Pin
nicolus3-Jan-08 22:45
nicolus3-Jan-08 22:45 
AnswerRe: In C# is there any way to know the number of non null elements in an array? Pin
martin_hughes3-Jan-08 23:06
martin_hughes3-Jan-08 23:06 
QuestionWord To PDF Conversion using C#.NET Pin
Vruddhi Vasoo3-Jan-08 22:20
Vruddhi Vasoo3-Jan-08 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.