This is an old revision of the document!


Customization
Private Label
  • Get private label information:
    • Company Name.
    • Address.
    • Phone number, Email, Fax, Website.
    • Logo (PNG or JPG format). Place logo image file in <src>/ezFIT/images/custom/logos folder.
    • Product Names
  • Add image files to ezFIT project in MS Visual Studio:
    • <src>/ezFIT/images/custom/icons/icon-acme.ico
    • <src>/ezFIT/images/custom/logos/logo-acme.png
    • <src>/ezFIT/images/custom/logos/ezfit-logo-acme.png
    • <src>/ezFIT/images/custom/splash/splash-acme.png
  • Add Custom Company:
    • Edit Types.cs in AHI.App.Types assembly. Add new company to TCustomCompany enum. Eg: Acme = 99
    • Edit AppCustomization.cs in AHI.App.Customization assembly. Add a new company in TCompanyInfoList.CreateDefaultList(). Eg:
      #region Company Acme Inc
        aCompany                = new TCompanyInfo();
        aCompany.Code           = TCustomCompany.Acme;
        aCompany.ManufacturerID = TManufacturerID.Audina;  // Audina manufacturer is used for Private Label
        aCompany.Name           = "Acme Inc.";
        aCompany.Address        = "Main St, SmallTown, FL 32000, USA";
        aCompany.Phone          = "1-888-HEARING";
        aCompany.Fax            = "";
        aCompany.Email          = "info@acme.com";
        aCompany.Website        = "http://www.acme.com";
        aCompany.Logo           = "images/custom/logos/logo-acme.png";
        this.Add(aCompany);
      #endregion
    • Edit AppCustomization.cs in AHI.App.Customization assembly. Add a new company in TCompanyAppInfoList.CreateDefaultList(). Eg:
      #region Company Acme Inc
        aCompany                = new TCompanyAppInfo();
        aCompany.CompanyInfo.Code           = TCustomCompany.Acme;
        aCompany.CompanyInfo.ManufacturerID = TManufacturerID.Audina;  // Audina manufacturer is used for Private Label
        aCompany.CompanyInfo.Name           = "Acme Inc.";
        aCompany.CompanyInfo.Address        = "Main St, SmallTown, FL 32000, USA";
        aCompany.CompanyInfo.Phone          = "1-888-HEARING";
        aCompany.CompanyInfo.Fax            = "";
        aCompany.CompanyInfo.Email          = "info@acme.com";
        aCompany.CompanyInfo.Website        = "http://www.acme.com";
        aCompany.CompanyInfo.Logo           = "images/custom/logos/logo-acme.png";
        SetAppInfo(aCompany, "AcmeEzFITApp");
        this.Add(aCompany);
      #endregion
  • Add Supported Products and their names.
    • Edit file ProductSpecs.cs in AHI.Products.Specifications assembly.
    • Set product name in TProductSpecificationList.RefreshList(), under specified company for the required product.
    • #region Product BTE 675DP+
        _prod = new TProductSpecification();
        . . .
        case TCustomCompany.Acme:
            _prod.Name = "Acme BTE";
            this.Add(_prod);
            break;
        . . .
      #endregion
  • Add Supported Housings.
    • Edit file HousingSpecs.cs in AHI.Products.Specifications assembly.
    • Under each housing in THousingSpecificationList.RefreshList(), specify the IsVisible property for the specified company.
    • #region Housing: BTE_Classic
        _Housing= new THousingSpecification();
        . . .
        case TCustomCompany.Acme:
            _Housing.IsVisible = true;
            break;
        . . .
      #endregion
  • Add Splash and Icon image resources to AHI.App.Logo assembly.
    • Add Splash (BMP) and icons (ICO) images to C:\programming\audina\ezFIT5\src\AHI.App.Logo\images.
    • Edit file LogoRes.rc:
      // 1. Compile resource file LogoRes.rc into LogoRes.res 
      //    using the Visual Studio Command Prompt:
      //    - VS2010: Start > All Applications > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio Command Prompt (2010).
      //    - VS2013: Start > All Applications > Visual Studio 2013 > Visual Studio Tools > Developer Command Prompt for VS2013.
      //    - VS2015: Start > All Applications > Visual Studio 2015 > Visual Studio Tools > Developer Command Prompt for VS2015.
      //    Eg: C:\> RC <src>\AHI.App.Logo\LogoRes.rc  (or C:> <src>\AHI.App.Logo\compile-resources.bat)
      // 
      // 2. Add res file to assembly. Project > Properties > Application (tab) > Resource File, and select LogoRes.res.
      // 3. Build assembly.
      LOGO001      BITMAP "images/logo16.bmp"
      LOGO002      BITMAP "images/logo256.bmp"
      
      // Must in Alphabetical order
      SPLASH_AUDINA         BITMAP "images\splash-audina.bmp"
      SPLASH_ACME           BITMAP "images\splash-acme.bmp"
      ...
      // Must in Alphabetical order
      ICON_AUDINA           ICON "images\icon-audina.ico"  // icon index 0
      ICON_ACME             ICON "images\icon-acme.ico"    // icon index 1
      ...
      // Order numerically, and strings in Alphabetical order
      STRINGTABLE
      {
        1001, "Audina ezFIT"
        1002, "Acme ezFIT"
        ...
      }

      Make sue AppIconIdx matches the icon index in <src>/installer/installer-ezfit.iss

  • Generate Logo assembly:
    • Compile resource file LogoRes.rc into LogoRes.res using the Visual Studio Command Prompt. In VS2015: Start > All Applications > Visual Studio 2015 > Visual Studio Tools > Developer Command Prompt for VS2015. Eg: C:\> RC <src>\AHI.App.Logo\LogoRes.rc (or C:> <src>\AHI.App.Logo\compile-resources.bat)
    • Add res file to assembly. Project > Properties > Application (tab) > Resource File, and select LogoRes.res.
    • Build assembly.
  • Encode Company Code.
    • Use utility <src>/EncodeUtil/bin/Debug/EncodeUtil.exe. Eg: Acme, when encrypted becomes McFQ/ZiAWwo=.
    • Add encoded company custom code to installer in <src>/installer/installer-ezfit.iss:
      #if AppCustomOrg == "Audina"
        ...
      #elif AppCustomOrg == "Acme"
        #define AppTitle     "Acme ezFIT"
        #define AppPath      "Acme\ezFIT5"
        #define AppGroup     "Acme ezFIT " + AppVersion
        #define AppIconIdx   14
        #define AppPublisherName    "Acme"
        #define AppPublisherWebsite "http://www.acme.com"
        #define AppRegKey "Software\Audina Hearing Instruments\ezFIT\5.0\Setup"
        #define AppDestName "acmeezfitapp"
        #define AppCustomCode "McFQ/ZiAWwo="
      #else
        ...
      #endif

      Make sue AppIconIdx matches the icon index in <src>\src\AHI.App.Logo\LogoRes.rc

  • Add custom Spec Sheets.
    • Place custom PDF documents in <src>\ezFIT\Products\Catalog\<CompanyName>
    • In installer, add support to product catalog:
      ;---------------------------------------------------
      ; Product Catalog
      ;---------------------------------------------------
      #if AppCustomOrg == "Acme"
      Source: ..\ezFIT\Products\Catalog\{#AppCustomOrg}\*.pdf; DestDir: {app}\Products\Catalog; Flags: ignoreversion
      #else
      Source: {#SrcAppDir}\Products\Catalog\*.pdf; DestDir: {app}\Products\Catalog; Flags: ignoreversion
      #endif
  • Add software customizations:
    • Disable ezFIT 4 support if not required (both, in app and installer).
    • #if AppCustomOrg == "Acme"
      ; Do not install ezFIT4
      #else
      Filename: {tmp}\{#AppDestName}4-setup-{#AppCustomOrg}.exe; ...
      #endif
  • Create custom User Documentation.
    • Create necessary files in C:\programming\audina\ezFIT5\src\UserDoc\custom.
      • acme.cfg (edit as necessary)
      • acme-header.html
      • acme-footer.html
      • images\splash-acme.png
    • Edit product software requirements matrix in <src>\UserDoc\104-hi-swrequirementmatrix.txt.
    • Edit Sparo conditional references (i.e, if supported by private label) in
      • <src>\UserDoc\200-howto.txt.
      • <src>\UserDoc\202-sparo.txt
    • Create end-user license in C:\programming\audina\ezFIT5\src\installer\license\license-Acme.txt.
  • Create custom Autorun.
    • Edit logo and application installation instructions in <src>\Autorun\main.pas.
    • Recompile Lazarus project <src>\Autorun\Autorun.lpi.
    • Copy Autorun.exe to CD Image folder.
  • Create CD Image folder in C:\programming\audina\ezFIT5\src\cdimg. Eg:
    • Acme\drivers\
      • EMiniTec-2.08.24-2012-Drivers.exe
      • HIPRO-4.0.0-2012-Drivers.exe
      • NOAHlink-01.56.05-2013-Drivers.exe
      • ProgBox-Drivers-setup-2014-0311.exe
    • Acme\installers\
      • acmeezfitapp5-setup.exe
      • FBserver-setup.exe
    • Acme\Autorun.exe
    • Acme\favicon.ico
  • Create NAnt-Gui script to build custom application.
  • Create AutoUpdate files in webserver (locatee in \\webserver\website\downloads\ezfit, URL http://www.audina.net/downloads/ezfit):
    • acmeezfitapp-Acme-2014-AutoUpdater.xml
    • acmeezfitapp-Acme-2014-ReleaseNotes.htm
    • acmeezfitapp-Acme-2014-latest.exe
  • Add references to software installer in /root/upd-ezfit-latest.sh in web server:
    file upd-ezfit-latest.sh
    #!/bin/bash
    ## script: ./upd-ezfit-latest.sh
    #
    #------------------------------------------------------------------------------
    # Description: Update latest ezFIT installer
    # Usage:
    #   Format:
    #     Current date:    % ./upd-ezfit-latest.sh
    #     Arbitrary date:  % ./upd-ezfit-latest.sh [YYYY-MMDD]
    #            YYYY - Year (4 digits).
    #            MM   - Month (always 2 digits, including leading zero if necessary).
    #            DD   - Day of month (always 2 digitis, including leading zero if necessary).
    #   Example: % ./publish-ezfit-latest.sh 2014-0422
    #------------------------------------------------------------------------------
     
    #-----------------------------
    # Define Target Directory
    #-----------------------------
    TARGETDIR="/var/www/downloads/prototypes"
    #SYSDATESTAMP="2013-0117"
    SYSDATESTAMP=$(date +%Y-%m%d)
    SYSDATEYEAR=$(date +%Y)
     
    # Use command line argument to override variables
    if [ -n "$1" ]
    then
      echo "Current version $SYSDATESTAMP will be ovewritten with $1"
      SYSDATESTAMP="$1"
      SYSDATEYEAR=${SYSDATESTAMP:0:4}
    fi
     
    # Try to create TargetDir if it does not exist
    if ! cd $TARGETDIR; then
      mkdir $TARGETDIR
    fi
     
    # Perform operations if TargetDir exists
    if cd $TARGETDIR; then
      #-----------------------------
      # Link current ezfit installer to ezfit-latest.exe
      #-----------------------------
      rm ezfit-Audina-$SYSDATEYEAR-latest.exe
      rm ezfit-Auditiva-$SYSDATEYEAR-latest.exe
      rm ezfit-MDHearingAid-$SYSDATEYEAR-latest.exe
      rm ezfit-Acme-$SYSDATEYEAR-latest.exe
      ln -s ezfit-setup-Audina-$SYSDATESTAMP.exe ezfit-Audina-$SYSDATEYEAR-latest.exe
      ln -s ezfit-setup-Auditiva-$SYSDATESTAMP.exe ezfit-Auditiva-$SYSDATEYEAR-latest.exe
      ln -s ezfit-setup-MDHearingAid-$SYSDATESTAMP.exe ezfit-MDHearingAid-$SYSDATEYEAR-latest.exe
      ln -s ezfit-setup-Acme-$SYSDATESTAMP.exe ezfit-Acme-$SYSDATEYEAR-latest.exe
     
      echo "Success linking version $SYSDATESTAMP to ezfit-setup-Audina-$SYSDATEYEAR-latest.exe"
      echo "Success linking version $SYSDATESTAMP to ezfit-setup-Auditiva-$SYSDATEYEAR-latest.exe"
      echo "Success linking version $SYSDATESTAMP to ezfit-setup-MDHearingAid-$SYSDATEYEAR-latest.exe"
      echo "Success linking version $SYSDATESTAMP to ezfit-setup-Acme-$SYSDATEYEAR-latest.exe"
    else
      echo "Failed to link version $SYSDATESTAMP to ezfit-Audina-$SYSDATEYEAR-latest.exe"
      echo "Failed to link version $SYSDATESTAMP to ezfit-Auditiva-$SYSDATEYEAR-latest.exe"
      echo "Failed to link version $SYSDATESTAMP to ezfit-MDHearingAid-$SYSDATEYEAR-latest.exe"
      echo "Failed to link version $SYSDATESTAMP to ezfit-Acme-$SYSDATEYEAR-latest.exe"
    fi
     
     
    #------------------------------------------------
    # GetDate
    #------------------------------------------------
    function GetDate()
    {
       SYSDATE=$(date +%Y%m%d)
    }
     
    #------------------------------------------------
    # GetDateTime
    #------------------------------------------------
    function GetDateTime()
    {
       SYSDATETIME=$(date +%Y%m%d-%H%M)
    }
     
    #------------------------------------------------
    # GetDateStamp
    #------------------------------------------------
    function GetDateStamp()
    {
       SYSDATESTAMP=$(date +%Y-%m%d)
    }
     
    #------------------------------------------------
    # GetDate
    #------------------------------------------------
    function GetYear()
    {
      SYSDATEYEAR=$(date +%Y)
    }
     
    #------------------------------------------------
    # DisplayDate
    #------------------------------------------------
    function DisplayDate()
    {
       if [ ! -z $SYSDATE ]; then
          echo $SYSDATE
       else
          echo "SYSDATE not defined.  Define using GetDate()"
       fi
    }
  • Add references to software installer in /root/publish-ezfit-latest.sh in web server:
    file publish-ezfit-latest.sh
    #!/bin/bash
    ## script: ./publish-ezfit-latest.sh
    #
    #------------------------------------------------------------------------------
    # Description: Publish ezFIT installer to AutoUpdate website
    # Usage:
    #   Format:
    #     Current date:    % ./publish-ezfit-latest.sh
    #     Arbitrary date:  % ./publish-ezfit-latest.sh [YYYY-MMDD]
    #            YYYY - Year (4 digits).
    #            MM   - Month (always 2 digits, including leading zero if necessary).
    #            DD   - Day of month (always 2 digitis, including leading zero if necessary).
    #   Example: % ./publish-ezfit-latest.sh 2014-0422
    #------------------------------------------------------------------------------
     
    #-----------------------------
    # Define Target Directory
    #-----------------------------
    SOURCEDIR="/var/www/downloads/prototypes"
    TARGETDIR="/var/www/downloads/ezfit"
    #SYSDATESTAMP="2013-0117"
    SYSDATESTAMP=$(date +%Y-%m%d)
    SYSDATEYEAR=$(date +%Y)
     
    # Use command line argument to override variables
    if [ -n "$1" ]
    then
      echo "Current version $SYSDATESTAMP will be ovewritten with $1"
      SYSDATESTAMP="$1"
      SYSDATEYEAR=${SYSDATESTAMP:0:4}
    fi
     
    # Try to create TargetDir if it does not exist
    if ! cd $TARGETDIR; then
      mkdir $TARGETDIR
    fi
     
    # Perform operations if TargetDir exists
    if cd $TARGETDIR; then
      #-----------------------------
      # Link current ezfit installer to ezfit-latest.exe
      #-----------------------------
      rm ezfit-Audina-$SYSDATEYEAR-latest.exe
      rm fitpro-Auditiva-$SYSDATEYEAR-latest.exe
      rm mdtune-MDHearingAid-$SYSDATEYEAR-latest.exe
      rm acmeezfitapp-Acme-$SYSDATEYEAR-latest.exe
     
      echo "Copying from $SOURCEDIR to $TARGETDIR . . ."
      #ln -s $1 ezfit-setup-2012-latest.exe
      if [ -n "$1" ]
      then
        cp $SOURCEDIR/ezfit-setup-Audina-$SYSDATESTAMP.exe ezfit-Audina-$SYSDATEYEAR-latest.exe
        cp $SOURCEDIR/ezfit-setup-Auditiva-$SYSDATESTAMP.exe fitpro-Auditiva-$SYSDATEYEAR-latest.exe
        cp $SOURCEDIR/ezfit-setup-MDHearingAid-$SYSDATESTAMP.exe mdtune-MDHearingAid-$SYSDATEYEAR-latest.exe
        cp $SOURCEDIR/ezfit-setup-Acme-$SYSDATESTAMP.exe acmeezfitapp-Acme-$SYSDATEYEAR-latest.exe
      else
        cp $SOURCEDIR/ezfit-Audina-$SYSDATEYEAR-latest.exe ezfit-Audina-$SYSDATEYEAR-latest.exe
        cp $SOURCEDIR/ezfit-Auditiva-$SYSDATEYEAR-latest.exe fitpro-Auditiva-$SYSDATEYEAR-latest.exe
        cp $SOURCEDIR/ezfit-MDHearingAid-$SYSDATEYEAR-latest.exe mdtune-MDHearingAid-$SYSDATEYEAR-latest.exe
        cp $SOURCEDIR/ezfit-Acme-$SYSDATEYEAR-latest.exe acmeezfitapp-Acme-$SYSDATEYEAR-latest.exe
      fi
     
      chown www-data:web ezfit-Audina-$SYSDATEYEAR-latest.exe
      chown www-data:web fitpro-Auditiva-$SYSDATEYEAR-latest.exe
      chown www-data:web mdtune-MDHearingAid-$SYSDATEYEAR-latest.exe
      chown www-data:web acmeezfitapp-Acme-$SYSDATEYEAR-latest.exe
     
      echo "Success copying version $SYSDATEYEAR to ezfit-Audina-$SYSDATEYEAR-latest.exe"
      echo "Success copying version $SYSDATEYEAR to fitpro-Auditiva-$SYSDATEYEAR-latest.exe"
      echo "Success copying version $SYSDATEYEAR to mdtune-MDHearingAid-$SYSDATEYEAR-latest.exe"
      echo "Success copying version $SYSDATEYEAR to acmeezfitapp-Acme-$SYSDATEYEAR-latest.exe"
    else
      echo "Failed to link version $SYSDATEYEAR to ezfit-Audina-$SYSDATEYEAR-latest.exe"
      echo "Failed to link version $SYSDATEYEAR to fitpro-Auditiva-$SYSDATEYEAR-latest.exe"
      echo "Failed to link version $SYSDATEYEAR to mdtune-MDHearingAid-$SYSDATEYEAR-latest.exe"
      echo "Failed to link version $SYSDATEYEAR to acmeezfitapp-Acme-$SYSDATEYEAR-latest.exe"
    fi
     
     
    #------------------------------------------------
    # GetDate
    #------------------------------------------------
    function GetDate()
    {
       SYSDATE=$(date +%Y%m%d)
    }
     
    #------------------------------------------------
    # GetDateTime
    #------------------------------------------------
    function GetDateTime()
    {
       SYSDATETIME=$(date +%Y%m%d-%H%M)
    }
     
    #------------------------------------------------
    # GetDateStamp
    #------------------------------------------------
    function GetDateStamp()
    {
       SYSDATESTAMP=$(date +%Y-%m%d)
    }
     
    #------------------------------------------------
    # GetDate
    #------------------------------------------------
    function GetYear()
    {
      SYSDATEYEAR=$(date +%Y)
    }
     
    #------------------------------------------------
    # DisplayDate
    #------------------------------------------------
    function DisplayDate()
    {
       if [ ! -z $SYSDATE ]; then
          echo $SYSDATE
       else
          echo "SYSDATE not defined.  Define using GetDate()"
       fi
    }
Private Brand
  • Same steps as Private Label software, except the following field:
    aCompany.ManufacturerID = TManufacturerID.Custom // Custom manufacturer is used for Private Brand