Numbershark and Wordshark

From Wiki

Revision as of 20:34, 23 August 2010 by Mr wordshark (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to:navigation, search

Numbershark and Wordshark Network 4.05 MSI deployment

Everything here about Numbershark is the same for Wordshark.

For some reason Numbershark 4 doesn't have an MSI installer, or really any installer, just copy the files, add a shortcut, and in the target/working dir of the shortcut add the path to the share on the network.

Simple...ish

  • Install Wix 3 http://wix.sourceforge.net/
  • Copy numbershark-programs and numbershark-public to a folder called SourceDir
  • Run: "\Program Files\Windows Installer XML v3\bin\heat.exe" dir SourceDir -cg Numbershark -out ns001a.wxs -gg -dr INSTALLDIR

It might complain about Java 1.4 dlls and things, shouldn't matter: eg: heat.exe : warning HEAT5150 : Could not harvest data from a file that was expected to be a SelfReg DLL: C:\wix\SourceDir\numbershark-programs\bin\NPOJI610.dll. If this file does not support SelfReg you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: Exception has been thrown by the target of an invocation..


This creates a .wix fragment. Put that fragment between:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="{GUID}" Language="1033"
       Manufacturer="White Space" Name="Numbershark"
       UpgradeCode="{GUID}" Version="4.0.5.0">
        <Package Compressed="no" InstallerVersion="200" InstallScope='perMachine' />
        <Directory Id="TARGETDIR" Name="SourceDir">
	  <Directory Id="ProgramFilesFolder">
	     <Directory Id="INSTALLDIR" Name="Numbershark" FileSource="SourceDir">
	     </Directory>
	  </Directory>
	  <Directory Id="ProgramMenuFolder">
    	    <Directory Id="ApplicationMenuFolder" Name="Maths"/>
	  </Directory>
	  <Directory Id="NetworkShared" Name="." />
	</Directory>
        <Feature Id="ProductFeature" Level="1" Title="Numbershark">
          <ComponentGroupRef Id="Numbershark" />
	  <ComponentRef Id="ApplicationShortcut" />	
        </Feature>
        <Media Id="1" />
	<CustomAction Id="SetNetworkShared" Directory="NetworkShared"
              Value="\\domain.local\share$\SharedData\Numbershark-shared" />
	<InstallExecuteSequence>
          <Custom Action="SetNetworkShared" After="CostFinalize">Not Installed</Custom>
        </InstallExecuteSequence>
    </Product>
    <Fragment>
      <DirectoryRef Id="ApplicationMenuFolder">
        <Component Id="ApplicationShortcut" Guid="{GUID}">
            <Shortcut Id="ApplicationStartMenuShortcut" 
                  Name="Numbershark Network"
                  Description="Numbershark Network Version"
                  Target="[INSTALLDIR]Numbershark-programs\Numbershark4nrun.exe"
                  WorkingDirectory="NetworkShared" Advertise="no" />
        </Component>
      </DirectoryRef>
    </Fragment>

and

</Wix>

Because I don't quite know how to use WiX, find sections for numbershark-programs and -public

    <Fragment>
        <DirectoryRef Id="someGUID">
            <Directory Id="dir4A916887A737B027BC358ACFA851914C" Name="numbershark-programs" />
        </DirectoryRef>
    </Fragment>

and

    <Fragment>
        <DirectoryRef Id="someGUID">
            <Directory Id="dir46DD2280A050F96FFEC29E7974D3141B" Name="numbershark-public" />
        </DirectoryRef>
    </Fragment>

and change "someGUID" to "INSTALLDIR"

  • Change the name in ApplicationMenuFolder from Maths to whatever submenu you want it to appear in in the start menu.
  • Change the share in CustomAction Id="SetNetworkShared" Directory="NetworkShared" Value="\\domain.local\share$\SharedData\Numbershark-shared" to your shared dir.
  • Save the new file as numbershark.wxs
  • Run "\Program Files\Windows Installer XML v3\bin\candle.exe" numbershark.wxs

this will complain about ICE18, 38, 43 and 60, ignore.

  • Finally run "\Program Files\Windows Installer XML v3\bin\light.exe" numbershark.wixobj to create the MSI
  • Copy the MSI and the SourceDir (or Numbershark, not sure) dir to your DFS share, deploy via GPO.

Notes: It would be better to make the MSI then have an MST to change the share path, then you can give the MSI to others, and the GUIDs wouldn't need to change.

The Custom Action is needed for some reason to make the workingdir point to a unc path, that's also why it can't be an advertised shortcut