Comment: IA_DemoServerSetup Setup Project
Set Variable ISWINDOWS64BIT to FALSE
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT
 
[DEFINE REGION: Check Application Requirements]
Get System Setting Internet Explorer 6.0 Service Pack 1 into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Internet Explorer 6.0 Service Pack 1.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
Get System Setting Windows XP into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Windows XP.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
[END REGION]
 
[DEFINE REGION: Check/Install Application Pre-Requisites]
 
[DEFINE REGION: Check Application Pre-Requisites]
Comment: Check setup pre-requisites
Set Variable PREREQ to FALSE
Set Variable PRELIST to 
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Previous Version Uninstallation
end
Include Script: checkmsi31
Include Script: checkvc10_x86
Comment: Check for 64 bit
if Variable ISWINDOWS64BIT Equals TRUE
  Include Script: checkmsxml60_x64
  Include Script: checknet35sp1_x64
  Include Script: checknet4aip_client_x64
  Include Script: checknet4aip_x64
else
  Include Script: checkmsxml60
  Include Script: checknet351
  Include Script: checknet4aip_client_x86
  Include Script: checknet4aip_x86
end
[compiler end]
[END REGION]
 
[DEFINE REGION: Install Application Pre-Requisites]
Comment: Install setup pre-requisites
if Variable PREREQ not Equals FALSE
  Display Dialog: prereq, wait for dialog to return (modal)
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
  Display Dialog: progressprereq, use as progress dialog (non-modal)
  [compiler if Variable BUILDMODE not Equals PATCH]
  if Variable NEEDSUPGRADE Equals TRUE
    Set Variable REMOVEOLD to 
    Set Variable ERROROLD to 
    Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
    if Variable REMOVEOLD Equals ERROR
      MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
      Terminate Installation
    end
    if Variable REMOVEOLD Equals REBOOT
      MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
      if Variable REBOOTNOW Equals OK
        Reboot Computer and Resume Setup
      else
        Terminate Installation
      end
    end
    Set Variable MAINTENANCE to FALSE
  end
   
  [DEFINE WEB MEDIA Microsoft Windows Installer 3.1]
  Include Script: setupmsi31
  [DEFINE WEB MEDIA Microsoft Visual C++ Runtime 10.0 (includes ATL and MFC)]
  Include Script: setupvc10_x86
   
  Comment: Check for 64 bit and run those prereqs
  if Variable ISWINDOWS64BIT Equals TRUE
    [DEFINE WEB MEDIA Microsoft XML Parser 6.0 (x64)]
    Include Script: setupmsxml60_x64
    [DEFINE WEB MEDIA Microsoft .NET Framework 3.5 with Service Pack 1 (x64)]
    Include Script: setupnet35sp1_x64
    [DEFINE WEB MEDIA Microsoft .NET Framework Client 4 (x64)]
    Include Script: setupnet4aip_client_x64
    [DEFINE WEB MEDIA Microsoft .NET Framework 4 (x64)]
    Include Script: setupnet4aip_x64
    Comment: Else run the x86 prereqs
  else
    [DEFINE WEB MEDIA Microsoft XML Parser 6.0]
    Include Script: setupmsxml60
    [DEFINE WEB MEDIA Microsoft .NET Framework 3.5 with Service Pack 1]
    Include Script: setupnet351
    [DEFINE WEB MEDIA Microsoft .NET Framework Client 4]
    Include Script: setupnet4aip_client_x86
    [DEFINE WEB MEDIA Microsoft .NET Framework 4]
    Include Script: setupnet4aip_x86
  end
   
  [compiler end]
  Hide Dialog
end
[END REGION]
 
[END REGION]
 
[DEFINE REGION: Define Setup Globals]
Comment: Define Setup Components
Define Component: Default
 
 
Comment: Initialize Setup Globals
Get System Setting Windows NT Kernel (NT4, 2000, XP, 2003, Vista, 2008, 7, 2008 R2, 8, Server 8) into ISNT
Get Folder Location System->Program Files Directory into PROGRAMFILES
Get Common Folder Location System->Program Files Directory into COMMONFILES
Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
 
if Variable SHORTCUTFILESALL Equals 
  Set Variable SHORTCUTFILESALL to $SHORTCUTFILES$
end
if Variable ISWINDOWS64BIT Equals TRUE
  Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
  MessageBox: $TITLE$ Setup Debug, Running setup on a WIN x64 OS Target!
else
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
  MessageBox: $TITLE$ Setup Debug, Running setup on a WIN x86 OS Target!
end
 
Get Folder Location System->Desktop Directory into DESKTOPDIR
Get Folder Location System->Windows Directory into WINDIR
Get Folder Location System->System Directory into SYSTEM32
 
Comment: Set Variable SYSWOW64 to 
Comment: if Variable ISWINDOWS64BIT not Equals TRUE
Comment: Get Folder Location System->System Directory into SYSWOW64
Comment: end
 
Get Folder Location Taskbar->Quick Launch Directory into QUICKLAUNCHDIR
Get Folder Location WWW->WWWRoot into WWWROOTDIR
 
[END REGION]
 
[DEFINE REGION: Setup User Interview]
if Variable MAINTENANCE Equals TRUE
  GoTo Label: Maintenance
else
  [compiler if Variable BUILDMODE not Equals PATCH]
  Comment: First Time Install
  Set Variable TARGETDIR to $PROGRAMFILES$\$COMPANY$\$TITLE$
  Set Variable STARTMENU to $COMPANY$\$TITLE$
  [compiler end]
end
 
wizard loop
Display Dialog: welcome, wait for dialog to return (modal)
[compiler if Variable BUILDMODE not Equals PATCH]
Comment: Display Dialog: licensecheck, wait for dialog to return (modal)
Comment: Display Dialog: readme, wait for dialog to return (modal)
Display Dialog: registration, wait for dialog to return (modal)
Display Dialog: destination, wait for dialog to return (modal)
Comment: Display Dialog: startmenu, wait for dialog to return (modal)
[compiler end]
Display Dialog: startinstallation, wait for dialog to return (modal)
end
GoTo Label: Main Install
 
label: Maintenance
Comment: Maintenance Install/Uninstall
wizard loop
Display Dialog: maintenance, wait for dialog to return (modal)
Display Dialog: startinstallation, wait for dialog to return (modal)
end
[END REGION]
 
[DEFINE REGION: Process (Un)Installation]
label: Main Install
Comment: Exit Setup if Wizard Loop cancelled
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
 
Comment: Prepare to install
Set Variable PROGRESSTEXT to Installing $TITLE$
Set Variable SUCCESS to 
Set Variable LASTERROR to 
if Variable ALLUSERS Equals TRUE
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\$STARTMENU$
else
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILES$\$STARTMENU$
end
Display Dialog: progress, use as progress dialog (non-modal)
 
Comment: Modify Target System
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
  Comment: Uninstall product
  Comment: TO-DO: Insert any additional uninstall commands here
  Apply Uninstall (get result into variable SUCCESS)
  Set Variable PROGRESS to 100
else
  [END REGION]
  [DEFINE REGION: Perform First Time or Maintenance Installation]
  Comment: Install/Re-Install product
  Create Shortcut $SHORTCUTFOLDER$\Uninstall #TITLE# to $UNINSTALLLINK$
  [OFFLINE CONTENT]
  Comment: Install Files C:\code\bin\i61850DemoServer.exe to $TARGETDIR$
  Comment: Create Shortcut $DESKTOPDIR$\IEC 61850 Demo Server to $TARGETDIR$\i61850DemoServer.exe
  Comment: Create Shortcut $SHORTCUTFOLDER$\IEC 61850 Demo Server to $TARGETDIR$\i61850DemoServer.exe
  Comment: Install Files C:\code\bin\i61850DemoServer.exe.config to $TARGETDIR$
  Comment: Install Files C:\code\bin\i61850DLL.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\i61850LicenseManager.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\ndif.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\TMW.i61850.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\TMW.NodeGUI.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\TMWBase.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\TMWLicenseTool.exe to $TARGETDIR$
  Comment: Install Files C:\code\bin\TTW32N55.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\TTW32N55.INI to $TARGETDIR$
  Comment: Install Files C:\code\TMW61850\NetLibrary\Examples\i61850Server\breaker.icd to $TARGETDIR$
  Comment: Install Files C:\code\TMW61850\ThirdParty\openssl\out32dll\libeay32.dll to $TARGETDIR$
  Comment: Install Files C:\code\TMW61850\ThirdParty\openssl\out32dll\ssleay32.dll to $TARGETDIR$
  Comment: Install Files C:\code\bin\TMW.i61850Ex.dll to $TARGETDIR$
  Comment: Comment: Add the copy below back here when LicenseServer was commented out
  Comment: Install Files C:\code\bin\TMWLicServer2.exe to $WINSYSDIR$
  Comment: Install Files C:\code\TMW61850\cLibrary\ndif_dll\PCADLL\Release\LegacyInstall.exe to $TARGETDIR$
   
  if Variable ISWINDOWS64BIT Equals TRUE
    MessageBox: Debug, SysFolder = $SYSTEM32$\drivers
    Comment: Install Files C:\code\TMW61850\cLibrary\ndif_dll\Drivers\64BitTT\TTMp50.sys to $TARGETDIR$\drivers
    Comment: Install Files C:\code\TMW61850\cLibrary\ndif_dll\Drivers\64BitTT\TTSp50.sys to $TARGETDIR$\drivers
  else
    MessageBox: Debug, SysFolder = $SYSTEM32$\drivers
    Comment: Install Files C:\code\TMW61850\cLibrary\ndif_dll\Drivers\32BitTT\TTMp50.sys to $WINSYSDIR$\drivers
    Comment: Install Files C:\code\TMW61850\cLibrary\ndif_dll\Drivers\32BitTT\TTSp50.sys to $WINSYSDIR$\drivers
  end
  Comment: Include Script: LicenseServer
  Comment: Install Files C:\Users\daveg\Documents\InstallAware\IA_DemoServerSetup\copy.bat to $TARGETDIR$
  [DEFINE WEB MEDIA Default]
  Get Component Default Selection State into Variable SELECTED
  if Variable SELECTED Equals TRUE
  end
  Comment: TO-DO: Insert any additional install commands here
  [compiler if Variable BUILDMODE Equals PATCH]
  Apply Patch (get result into variable SUCCESS)
  [compiler else]
  if Variable ADVERTISE Equals TRUE
    Apply Advertised (get result into variable SUCCESS)
  else
    Comment: Include Script: LicenseServer
    Apply Install (get result into variable SUCCESS)
    if Variable SUCCESS not Equals ERROR
      if Variable SUCCESS not Equals CANCEL
      end
    end
    Include Script: Goose
    [compiler end]
    Set Variable PROGRESS to 100
  end
end
[END REGION]
[END REGION]
 
[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
  if Variable REBOOTCOMPUTER Equals TRUE
    if Variable SUCCESS Equals REBOOT
      Reboot Computer
    end
  end
  if Variable ISWINDOWS64BIT Equals TRUE
    if Variable RUNAPP Equals TRUE
      if Variable REMOVE Equals FALSE
        if Variable SUCCESS Equals COMPLETE
          Comment: Run Program $TARGETDIR$\copy.bat 
          Comment: TO-DO: Insert command that starts your application here
        end
      end
    end
  end
end
[END REGION]
 
