how to redistribute a program using nxogre for windows

maroxe

17-09-2008 23:25:12

Hi,
i wanna know how to redistribute my program using NxOgre under windows ( = create a setup) compiled with visual c++.
i know how to use inno setup to create a basic one, but i don't know how to install automatically install physx game distribution installer and Visual c++ runtime libraries.

KevinMulder

17-09-2008 23:39:39

InstallShield can be a solution if you buy a license for it.

betajaen

17-09-2008 23:46:45

I use Wix for Flour and I'm pretty sure Ogre does too.

maroxe

17-09-2008 23:58:42

but how to integrate physx game distibution to the setup(i silent mode)

mcaden

18-09-2008 05:47:04

The only thing NxOgre needs is the DLLs (you pack it into the installer) and the PhysX system files. If I remember correctly nVidia has a silent .msi installer in their dev zone.

reptor

18-09-2008 18:36:19

I tried it with Inno Setup.

I will show you an example.

This is the Inno Setup script file:


; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
PrivilegesRequired=admin
AppId={{RRRRRR99-940B-4D05-9040-B75FDC077BF0}
AppName=Garage
AppVerName=Garage 0.2
AppPublisher=Blah Studio
AppPublisherURL=http://www.blahstudio.com/
AppSupportURL=http://www.blahstudio.com/
AppUpdatesURL=http://www.blahstudio.com/
DefaultDirName={pf}\Garage
DefaultGroupName=Garage
LicenseFile=H:\Projects\garage\bin\release\eula.txt
OutputDir=H:\Projects\garage-installer
OutputBaseFilename=garage-0.2-installer
Compression=lzma
SolidCompression=no

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "H:\Projects\garage-installer\disk_image\vc\vcredist_x86.exe"; DestDir: "{tmp}\vc"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\disk_image\physx\PhysX_Game_installer_281.msi"; DestDir: "{tmp}\physx"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\disk_image\stripped-directx\*"; DestDir: "{tmp}\directx"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\disk_image\openal\oalinst.exe"; DestDir: "{tmp}\openal"; Flags: ignoreversion

Source: "H:\Projects\garage-installer\game\garage.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\RenderSystem_GL.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\CEGUIBase.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\CEGUIExpatParser.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\CEGUIFalagardWRBase.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\NxCharacter.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\NxCooking.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\NxOgre.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\OgreGUIRenderer.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\OgreMain.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\OIS.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\PhysXLoader.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\RenderSystem_Direct3D9.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\Projects\garage-installer\game\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename: "{tmp}\vc\vcredist_x86.exe"; Parameters: "/q:a /c:""msiexec /i vcredist.msi /qn"""
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\physx\PhysX_Game_installer_281.msi"" /qn"
Filename: "{tmp}\directx\DXSETUP.exe"; Parameters: "/silent"
Filename: "{tmp}\openal\oalinst.exe"; Parameters: "/s"

[Icons]
Name: "{group}\Garage"; Filename: "{app}\garage.exe"; WorkingDir: "{app}"
Name: "{group}\{cm:ProgramOnTheWeb,Garage}"; Filename: "http://www.blahstudio.com/"


Pay special attention to the first 4 sources in the [Files] section and to the [Run] section. There are the DirectX, VC++, OpenAL and PhysX installers. They are integrated to the created installer. The installer copies them to a temporary directory on the user's hard disk drive, and after the installer has installed the other files, the commands in the [Run] section are executed. I have chosen to run each of the installers silently, so that the user does not have to give any extra input to get them installed (don't bother the user with stupid questions). Don't try to do any version checking, just let the installers do their job. After the installation, the temporary directory is deleted.

The "stripped-directx" refers to a directory which has only required DirectX files:

- Aug2008_d3dx9_39_x86.cab
- dsetup32.dll
- DSETUP.dll
- dxdllreg_x86.cab
- dxnt.cab
- DXSETUP.exe
- dxupdate.cab

These files are required to install DirectX to a computer which does not have any version of DirectX already installed. To minimize the size of the installer, I have taken out everything else but the files which are required for my application. Microsoft allows us to do this. I have compiled Ogre3D to use the Aug2008_d3dx9_39_x86, so that is what is needed, everything else in the DirectX redistributable can be left out in this case.

I don't know yet if this installer handles properly the situation in which the DirectX wasn't installed at all: in that case, I have understood, the computer would need to be rebooted after the installation. The thing which should be checked is if the installer informs the user that the computer needs to be rebooted. If only update of DirectX is required, then no rebooting is needed.


Then one more thing which is slightly related: do not expect that the user of the installed program has write access to the program's installation directory! If your program needs to write data to the hard disk drive, then it must go to "Documents and Settings\username" somewhere. This would be log files, settings files etc.

maroxe

20-09-2008 09:24:28

thanks repotor, that's exactly what i was looking for :D