<?xml version="1.0" encoding="UTF-8"?>

<packages>

<package
  id="GSpot"
  name="GSpot"
  revision="270"
  reboot="false"
  priority="1">
  
  <check type="file" condition="exists" path="%PROGRAMFILES%\Audio and Video\GSpot\GSpot.exe" />

  <!-- Test first to see if the GSpot directory already 
  exists.  Otherwise, if it exists and an attempt is made to create it, which
  will fail, the entire installation process will fail as well. 
  Note: the double quotes must appear around the file name used as
  a test for "if not exist", since %PROGRAMFILES% expands to a directory
  path with a space in it. -->
  <install cmd='cmd /c if not exist "%PROGRAMFILES%\Audio and Video\GSpot" mkdir "%PROGRAMFILES%\Audio and Video\GSpot"' />
  <!-- Copy all of the GSpot files from the WPKG share on the server -->
  <install cmd='cmd /c copy %SOFTWARE%\audio-video\GSpot\* "%PROGRAMFILES%\Audio and Video\GSpot\"' />
  <!-- If an "Audio & Video" entry doesn't already exist under the Start Menu,
   create one -->
  <install cmd='cmd /c if not exist "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Audio &amp; Video" mkdir "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Audio &amp; Video"' />
  <!-- Create the shortcut pointing to gspot.exe. By default, this will get
   created in %PUBLIC%\Desktop, which is usually C:\Users\Public\Desktop, so it
   will need to be moved under the start menu. -->
  <install cmd='cmd /c %WPKG_ROOT%\tools\CreateShortcut.js /target:"%ProgramFiles%\Audio and Video\GSpot\gspot.exe" /name:"GSpot"' />
  <install cmd='cmd /c move "%Public%\Desktop\GSpot.lnk" "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Audio &amp; Video\."' /> 

  <remove cmd='cmd /c rmdir /s /q "%PROGRAMFILES%\Audio and Video\GSpot"' />
  <remove cmd='cmd /c del "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Audio &amp; Video\GSpot.lnk"' />
  
  <upgrade cmd='cmd /c copy %SOFTWARE%\audio-video\GSpot\* "%PROGRAMFILES%\Audio and Video\GSpot\."' />

</package>

</packages>

