1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

InstallUtil is not working?

Discussion in 'C#' started by shah123, Apr 30, 2007.

  1. shah123

    shah123 New Member

    Joined:
    Mar 27, 2007
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    0
    Hi, I have .Net FrameWork 3.0 and there was no Installutil in the folder so i added following files from v1.0

    • installutil.exe
      mscormmc.cfg
      mscormmc.dll
      regsvcs.exe
      regsvcs.exe.rtm

    When i run the installutil
    Code:
    
    C:\Program Files\Microsoft Visual Studio 8\VC#>installutil "C:\Program Files\Mic
    rosoft Visual Studio 8\VC#\CSharpProjects\MyService\MyService\bin\Release\MyServ
    ice.exe"
    Microsoft (R) .NET Framework Installation utility Version 2.0.50727.42
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    
    Running a transacted installation.
    
    Beginning the Install phase of the installation.
    See the contents of the log file for the C:\Program Files\Microsoft Visual Studi
    o 8\VC#\CSharpProjects\MyService\MyService\bin\Release\MyService.exe assembly's
    progress.
    The file is located at C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProj
    ects\MyService\MyService\bin\Release\MyService.InstallLog.
    Installing assembly 'C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjec
    ts\MyService\MyService\bin\Release\MyService.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\
    MyService\MyService\bin\Release\MyService.exe
       logfile = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MySer
    vice\MyService\bin\Release\MyService.InstallLog
    No public installers with the RunInstallerAttribute.Yes attribute could be found
     in the C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MyService\
    MyService\bin\Release\MyService.exe assembly.
    
    The Install phase completed successfully, and the Commit phase is beginning.
    See the contents of the log file for the C:\Program Files\Microsoft Visual Studi
    o 8\VC#\CSharpProjects\MyService\MyService\bin\Release\MyService.exe assembly's
    progress.
    The file is located at C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProj
    ects\MyService\MyService\bin\Release\MyService.InstallLog.
    Committing assembly 'C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjec
    ts\MyService\MyService\bin\Release\MyService.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\
    MyService\MyService\bin\Release\MyService.exe
       logfile = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MySer
    vice\MyService\bin\Release\MyService.InstallLog
    No public installers with the RunInstallerAttribute.Yes attribute could be found
     in the C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MyService\
    MyService\bin\Release\MyService.exe assembly.
    Remove InstallState file because there are no installers.
    
    The Commit phase completed successfully.
    
    The transacted install has completed.
    
    C:\Program Files\Microsoft Visual Studio 8\VC#>
    
    
    And then when i execute the application again it shows a popup to run installutil again or start the app from Windows Services.

    Please help
     
  2. shah123

    shah123 New Member

    Joined:
    Mar 27, 2007
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    [B]Installer Class[/B]
    public partial class Installer1 : Installer
        {
            private ServiceInstaller serviceInstaller;
            private ServiceProcessInstaller processInstaller;
    
            public Installer1()
            {
                InitializeComponent();
                processInstaller = new ServiceProcessInstaller();
                serviceInstaller = new ServiceInstaller();
    
                // Service will run under system account
                processInstaller.Account = ServiceAccount.LocalSystem;
    
                // Service will have Start Type of Manual
                serviceInstaller.StartType = ServiceStartMode.Manual;
    
                serviceInstaller.ServiceName = "Hello-World Service";
    
                Installers.Add(serviceInstaller);
                Installers.Add(processInstaller);
    
                
            }
            
    Service Class
    Code:
     public partial class Service1 : ServiceBase
        {
            protected Timer timer;
    
            public static void Main()
            {
                ServiceBase.Run(new Service1());
            }
    
            public Service1()
            {
            CanPauseAndContinue = true;
            ServiceName = "Hello-World Service";
    
            timer = new Timer();
            timer.Interval = 1000;
            timer.Elapsed += new ElapsedEventHandler(OnTimer);
            }
    
    I have now only Installer Class and Service Class what next action to be done? I have the latest .NetFramework 3.0 what can be done?

    Please Advise?
     
  3. shah123

    shah123 New Member

    Joined:
    Mar 27, 2007
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    0
    yes It worked. Thanks Service has been added and its in the running state.

    Solution was to add [RunInstallerAttribute(true)] declaration on top of Installer Class
     
  4. suri123

    suri123 New Member

    Joined:
    Dec 17, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Even after having RunInstaller(true) before the service installer class we were getting "Remove InstallState file because there are no installers."

    after spending almost like half a day i realized that the serviceinstaller class is not set as public ............hmmm ..... after setting the class to public, it was all happy time ..........

    - Suresh Kumar Palleti
     

Share This Page