MBonevil
Posts: 45
Joined: Fri Jan 22, 2010 4:48 pm

Launch Condition - Need Help

Hi,

I want to enter two new lanuch condition:

1) The computer needs to be in 96dpi

2) The computer needs to use "," for decimal separator

How I can do that ?

Best regards,

Martin
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Launch Condition - Need Help

Hi Martin,

These are highly particular requirements for your application. You can only achieve this by programming your own custom action which detects these settings and displays the proper message before erroring out. MSDN should list some API to call to find out these settings you require.

I hope this helps.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
MBonevil
Posts: 45
Joined: Fri Jan 22, 2010 4:48 pm

Re: Launch Condition - Need Help

Hi,

I want to prevent the installation (perequisites, etc) with these conditions.

1) How I can prevent the perequisites installatino with a custom IntallerClass ?
2) How I can display a message to the user ?
3) How I can stop the installation process ?

Best regards,

Martin
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Launch Condition - Need Help

Hi Martin,

You can try the following:
- create a custom action that does your search for the appropriate settings and sets a property depending on whether it succeeded or not. Place the custom action under Begin standard action both in the InstallUISequence and InstallExecuteSequence. Hold Shift and drag the custom action between the two sequences to make it a shared custom action.
- create a launch condition that is conditioned using the property created in the previous step
- make sure your prerequisites are feature-based.

I hope this helps.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
MBonevil
Posts: 45
Joined: Fri Jan 22, 2010 4:48 pm

Re: Launch Condition - Need Help

Hi,

I try to use my InstallerClass... but I got an error message.
Error.png
Error.png (6.54 KiB) Viewed 5752 times
Here my class code:

Code: Select all

namespace InstallerUtilities
{
  using System;
  using System.Collections;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Configuration.Install;
  using System.Linq;
  using System.IO;

  [RunInstaller( true )]
  public partial class Utilities : System.Configuration.Install.Installer
  {
    public Utilities( )
    {
      InitializeComponent( );
    }

    protected override void OnBeforeInstall( IDictionary savedState )
    {
      base.OnBeforeInstall( savedState );
      /*
      StreamWriter newWriter = File.CreateText( "C:\\test\\bonjour.txt" );

      newWriter.Write( "Bonjour les amis !!!" );

      newWriter.Close( );
      */
    }
  }
}

Best regards,

Martin
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Launch Condition - Need Help

Hello,

Are you using the ".Net Installer Class Action" predefined custom action to run your Installer Class?

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
MBonevil
Posts: 45
Joined: Fri Jan 22, 2010 4:48 pm

Re: Launch Condition - Need Help

Yes.
ScreenShot.png
ScreenShot.png (149.71 KiB) Viewed 5698 times
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Launch Condition - Need Help

Hi Martin,

It appears you are overriding the OnBeforeInstall method, however in your custom action you are setting the action to "Install".
It is advisable in your code you override the Install method and execute your code there instead of OnBeforeInstall.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”