Skip to content

Commit

Permalink
Webinstaller + Installer Wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikp committed Nov 17, 2012
1 parent 7927bf6 commit 53fc86f
Show file tree
Hide file tree
Showing 19 changed files with 444 additions and 66 deletions.
1 change: 0 additions & 1 deletion inc/IPluginBase.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* Plugin SDK - for licensing and copyright see license.txt */


#define PLUGIN_COMPILED_CDK_VERSION "3.4.3" //!< for reuse of compiled Cryengine SDK version (its not defined in CDK directly so we have to do it ourself)
#define PLUGIN_TEXT "Plugin" //!< for logging and misc
#define PLUGIN_FOLDER "Plugins" //!< directory
Expand Down
2 changes: 2 additions & 0 deletions latestredist.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Plugin_SDK_1.1.0.0.exe
https://github.com/downloads/hendrikp/Plugin_SDK/Plugin_SDK_1.1.0.0.exe
4 changes: 4 additions & 0 deletions project/PluginManager.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,19 @@ stylecode.bat</Command>
<None Include="..\.gitignore" />
<None Include="..\authors.txt" />
<None Include="..\changelog.md" />
<None Include="..\latestredist.info" />
<None Include="..\license.txt" />
<None Include="..\readme.md" />
<None Include="..\tools\build.bat" />
<None Include="..\tools\build_all.bat" />
<None Include="..\tools\build_game.bat" />
<None Include="..\tools\build_installer.bat" />
<None Include="..\tools\codestyle.astylerc" />
<None Include="..\tools\DownloadHelper.nsh" />
<None Include="..\tools\Plugin_SDK_Installer.nsi" />
<None Include="..\tools\Plugin_SDK_PluginDescription.nsh" />
<None Include="..\tools\Plugin_SDK_PluginList.nsh" />
<None Include="..\tools\Plugin_SDK_WebInstaller.nsi" />
<None Include="..\tools\stylecode.bat" />
</ItemGroup>
<ItemGroup>
Expand Down
18 changes: 14 additions & 4 deletions project/PluginManager.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,23 @@
</None>
<None Include="..\changelog.md" />
<None Include="..\tools\Plugin_SDK_PluginList.nsh">
<Filter>Tools\Installer</Filter>
<Filter>Installer</Filter>
</None>
<None Include="..\tools\Plugin_SDK_Installer.nsi">
<Filter>Tools\Installer</Filter>
<Filter>Installer</Filter>
</None>
<None Include="..\tools\Plugin_SDK_PluginDescription.nsh">
<Filter>Tools\Installer</Filter>
<Filter>Installer</Filter>
</None>
<None Include="..\tools\build_installer.bat">
<Filter>Installer</Filter>
</None>
<None Include="..\latestredist.info" />
<None Include="..\tools\DownloadHelper.nsh">
<Filter>Installer</Filter>
</None>
<None Include="..\tools\Plugin_SDK_WebInstaller.nsi">
<Filter>Installer</Filter>
</None>
</ItemGroup>
<ItemGroup>
Expand All @@ -95,7 +105,7 @@
<Filter Include="Tools">
<UniqueIdentifier>{4a46776a-27ef-489c-8e23-5cf4379ce9a9}</UniqueIdentifier>
</Filter>
<Filter Include="Tools\Installer">
<Filter Include="Installer">
<UniqueIdentifier>{5c7f2dd5-7db4-4564-95a7-02b191ab4477}</UniqueIdentifier>
</Filter>
</ItemGroup>
Expand Down
60 changes: 60 additions & 0 deletions tools/DownloadHelper.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
; Plugin SDK - for licensing and copyright see license.txt

; Macros to support downloading and executing plugin installers

!macro DownloadAndExecuteLatestPluginInstaller dlsource dlcommand dlparam
; Pluginfo file
StrCpy $3 "$PLUGINDOWNLOADDIR\plugindl.info"

; Cleanup last tempfile
IfFileExists $3 0 +2
Delete $3

; Download
inetc::get ${dlsource} $3 /END
Pop $R0 ; Get the return value
StrCmp $R0 "OK" +3
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Failed to get Plugin Information:$\n${dlsource}$\n$R0"
Goto skipplugin

; Check if File exists
IfFileExists $3 +3 0
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Plugin Information not present:$\n${dlsource}$\n$R0"
Goto skipplugin

; Read Plugin Information
ClearErrors
StrCpy $1 ""
StrCpy $2 ""
FileOpen $0 $3 r
IfErrors +5
FileRead $0 $1
IfErrors +2
FileRead $0 $2
FileClose $0

; Check Errors
StrCmp $2 "" 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Failed to read Plugin Information:$\n$3"
Goto skipplugin

; Install
DetailPrint "Downloading Plugin: $1"
!insertmacro DownloadAndExecutePluginInstaller "$1" "$PLUGINDOWNLOADDIR\$2" ${dlcommand} "${dlparam}"

skipplugin:
ClearErrors
!macroend

!macro DownloadAndExecutePluginInstaller dlsource dltarget dlcommand dlparam
; Download
inetc::get ${dlsource} ${dltarget} /END
Pop $R0 ; Get the return value
StrCmp $R0 "OK" +3
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Plugin Download failed:$\n${dlsource}$\n$R0"
Goto +4
${dlcommand} '${dltarget} ${dlparam}"$INSTDIR"'
IfErrors 0 +2
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Plugin Installation failed:$\n${dltarget}"
ClearErrors
!macroend
81 changes: 39 additions & 42 deletions tools/Plugin_SDK_Installer.nsi
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
; Plugin SDK - for licensing and copyright see license.txt

; The latest normaler installer

!include "MUI2.nsh"
!include "Sections.nsh"

Expand All @@ -13,10 +17,10 @@ XPStyle on
Name "Plugin SDK ${VERSION} for CryEngine ${VERSIONCDK}"

; The file to write
OutFile "Plugin_SDK.exe"
OutFile "Plugin_SDK_${VERSION}.exe"

; Default Installdir
InstallDir "C:\cryengine3\"
InstallDir "C:\CryENGINE_PC\"

; Request application privileges for Windows Vista/7
RequestExecutionLevel user
Expand All @@ -26,11 +30,11 @@ RequestExecutionLevel user
; MUI Settings
!define MUI_ABORTWARNING

!define MUI_ICON "..\images\logos\PluginWizard.ico"
!define MUI_UNICON "..\images\logos\PluginWizard.ico"
!define MUI_ICON "${FILES_ROOT}\images\logos\PluginWizard.ico"
!define MUI_UNICON "${FILES_ROOT}\images\logos\PluginWizard.ico"

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "..\images\logos\PluginSDK_Logo_Installer.bmp"
!define MUI_HEADERIMAGE_BITMAP "${FILES_ROOT}\images\logos\PluginSDK_Logo_Installer.bmp"
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH

###################################
Expand All @@ -42,7 +46,7 @@ RequestExecutionLevel user
;!insertmacro MUI_PAGE_WELCOME

; License page
!insertmacro MUI_PAGE_LICENSE "..\license.txt"
!insertmacro MUI_PAGE_LICENSE "${FILES_ROOT}\license.txt"

; Components page
!insertmacro MUI_PAGE_COMPONENTS
Expand All @@ -61,18 +65,24 @@ RequestExecutionLevel user
SectionGroup "Redistributable" SEC_BIN
Section "Plugin Manager" SEC_PLUGINMANAGER
SectionIn RO
SetOutPath $INSTDIR\Bin32\Plugins

SetOutPath "$INSTDIR\Bin32\Plugins"
File "${FILES_ROOT}\..\..\Bin32\Plugins\Plugin_Manager.dll"

SetOutPath $INSTDIR\Bin64\Plugins
SetOutPath "$INSTDIR\Bin64\Plugins"
File "${FILES_ROOT}\..\..\Bin64\Plugins\Plugin_Manager.dll"

CreateDirectory $INSTDIR\Bin32\Plugins
CreateDirectory $INSTDIR\Bin64\Plugins

; Standard Code directory also used in git repo
SetOutPath "$INSTDIR\Code\Plugin_SDK"
File "${FILES_ROOT}\authors.txt"
File "${FILES_ROOT}\license.txt"
File "${FILES_ROOT}\readme.md"
File "${FILES_ROOT}\changelog.md"

Call ShowChangelog

; Root path for Plugin Downloads and Informations
SetOutPath $INSTDIR\Plugin_SDK
SetOutPath "$INSTDIR\Plugin_SDK"
File "${FILES_ROOT}\authors.txt"
File "${FILES_ROOT}\license.txt"
File "${FILES_ROOT}\readme.md"
Expand All @@ -85,10 +95,10 @@ SectionGroup "Redistributable" SEC_BIN
SectionEnd

Section "Prebuilt GameDLL" SEC_CRYGAME
SetOutPath $INSTDIR\Bin32
SetOutPath "$INSTDIR\Bin32"
File "${FILES_ROOT}\..\..\Bin32\CryGame.dll"

SetOutPath $INSTDIR\Bin64
SetOutPath "$INSTDIR\Bin64"
File "${FILES_ROOT}\..\..\Bin64\CryGame.dll"
SectionEnd
SectionGroupEnd
Expand All @@ -109,40 +119,22 @@ SectionGroup "Developer Tools" SEC_DEV
Push "$DOCUMENTS\Visual Studio 2010\Wizards\PluginWizard\PluginWizard.vsz" #file to replace in
Call AdvReplaceInFile

SetOutPath $INSTDIR\Code\Plugin_SDK\wizard\vc10
File /r /x *.sdf "${FILES_ROOT}\wizard\vc10\"
SetOutPath "$INSTDIR\Code\Plugin_SDK\wizard\vc10"
File /r /x *.sdf /x *.aps /x *.suo /x *.user /x Release /x Debug /x x64 "${FILES_ROOT}\wizard\vc10\"

SetOutPath $INSTDIR\Code\Plugin_SDK\project
SetOutPath "$INSTDIR\Code\Plugin_SDK\project"
File "${FILES_ROOT}\project\Plugin_Settings.props"

SetOutPath $INSTDIR\Code\Plugin_SDK\inc
SetOutPath "$INSTDIR\Code\Plugin_SDK\inc"
File /r "${FILES_ROOT}\inc\"

; Standard Code directory also used in git repo
SetOutPath $INSTDIR\Code\Plugin_SDK
File "${FILES_ROOT}\authors.txt"
File "${FILES_ROOT}\license.txt"
File "${FILES_ROOT}\readme.md"
File "${FILES_ROOT}\changelog.md"
SectionEnd
SectionGroupEnd

####################################

!macro DownloadAndExecutePluginInstaller dlsource dltarget
; Download
inetc::get ${dlsource} ${dltarget} /END
Pop $R0 ; Get the return value
StrCmp $R0 "OK" +3
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Plugin Download failed:$\n${dlsource}$\n$R0"
Goto +3
ExecWait '${dltarget} /S /D="$INSTDIR"'
IfErrors +1 +2
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND "Plugin Installation failed:$\n${dltarget}"
ClearErrors
!macroend

SectionGroup "Download Plugins" SEC_PLUGINS
!include "DownloadHelper.nsh"

SectionGroup /e "Download Plugins" SEC_PLUGINS
!include "Plugin_SDK_PluginList.nsh"
SectionGroupEnd

Expand Down Expand Up @@ -174,7 +166,12 @@ VIProductVersion "${VERSION}"

####################################

; Custom functions
; Show changelog
Function "ShowChangelog"
Exec 'notepad "$INSTDIR\Code\Plugin_SDK\changelog.md"'
FunctionEnd

; Check Installation prequisits
Function "IsValidCEInstallation"
IfFileExists "$INSTDIR\Bin32\CrySystem.dll" cont
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND \
Expand Down Expand Up @@ -316,4 +313,4 @@ Function AdvReplaceInFile
Pop $2
Pop $3
Pop $4
FunctionEnd
FunctionEnd
10 changes: 7 additions & 3 deletions tools/Plugin_SDK_PluginDescription.nsh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
; Plugin SDK - for licensing and copyright see license.txt

; Contains the plugin descriptions

!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGINS} "Plugins that can be installed automatically also Plugin SDK for more avaible Plugins.$\n$\nReview the licenses of the Plugins!"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGINS} "The latest plugins that can be installed automatically. For more available Plugins visit Crydev.$\n$\nReview the licenses of the Plugins!"

!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_VIDEOPLAYER} "Videoplayer for 2D screen and 3D objects using WebM format, requires D3D Plugin"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_VIDEOPLAYER_MAIN} "Plugin for Users, Designers and Developers"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_VIDEOPLAYER_SAMPLES} "Usage Samples for Designers and Developers"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_OSC} "Open Sound Control protocol support for integrating external applications / sound hardware"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_FLITE} "Provides Text to Speech"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_FLITE} "Provides Text to Speech Commands and Flownodes"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_D3D} "Exposes Direct3D 9 and 11 functionality, also access to the renderthread"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_JOYSTICK} "Adds Joystick/Controllers as Flownode Input node"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_JOYSTICK} "Adds Joystick / Controllers as Flownode Input node"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_PLUGIN_CRASH} "Crashes the process and serves as sample plugin"
43 changes: 34 additions & 9 deletions tools/Plugin_SDK_PluginList.nsh
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
; Plugin SDK - for licensing and copyright see license.txt

; Contains the plugins that can be downloaded by the Plugin SDK installer
; The files need to be executable nsis installers
; msi or other installers is also possible but may require custom parameters

Section "Videoplayer 1.7" SEC_PLUGIN_VIDEOPLAYER
!insertmacro DownloadAndExecutePluginInstaller "https://github.com/downloads/hendrikp/Plugin_Videoplayer/Plugin_Videoplayer_1.6.2.zip" "$PLUGINDOWNLOADDIR\Plugin_Videoplayer_1.6.2.zip"
!insertmacro DownloadAndExecutePluginInstaller "https://github.com/downloads/hendrikp/Plugin_Videoplayer/Plugin_Videoplayer_1.6.2_Samples.zip" "$PLUGINDOWNLOADDIR\Plugin_Videoplayer_1.6.2_Samples.zip"
SectionEnd
; .info file description
; First line: Filename Installer with Version string (will get stored in the Plugin SDK Download directory)
; e.g. Plugin_Videoplayer_1.7.0.0.exe
; Second line: Source URL (http/https and 301 redirects supported)
; e.g. https://github.com/downloads/hendrikp/Plugin_Videoplayer/Plugin_Videoplayer_1.7.0.0.exe

SectionGroup "Videoplayer" SEC_PLUGIN_VIDEOPLAYER
Section /o "Plugin" SEC_PLUGIN_VIDEOPLAYER_MAIN
AddSize 1500
!insertmacro DownloadAndExecuteLatestPluginInstaller "https://raw.github.com/hendrikp/Plugin_Videoplayer/master/latestredist.info" ExecWait "/S /D="
SectionEnd

Section /o "Samples" SEC_PLUGIN_VIDEOPLAYER_SAMPLES
AddSize 54000
!insertmacro DownloadAndExecuteLatestPluginInstaller "https://raw.github.com/hendrikp/Plugin_Videoplayer/master/latestsamples.info" ExecWait "/S /D="
SectionEnd
SectionGroupEnd

Section "OSC 1.1" SEC_PLUGIN_OSC
Section /o "OSC" SEC_PLUGIN_OSC
AddSize 500
!insertmacro DownloadAndExecuteLatestPluginInstaller "https://raw.github.com/hendrikp/Plugin_OSC/master/latestredist.info" ExecWait "/S /D="
SectionEnd

Section "Flite 1.1" SEC_PLUGIN_FLITE
Section /o "Flite" SEC_PLUGIN_FLITE
AddSize 14000
!insertmacro DownloadAndExecuteLatestPluginInstaller "https://raw.github.com/hendrikp/Plugin_Flite/master/latestredist.info" ExecWait "/S /D="
SectionEnd

Section "D3D 1.7" SEC_PLUGIN_D3D
Section /o "D3D" SEC_PLUGIN_D3D
AddSize 200
!insertmacro DownloadAndExecuteLatestPluginInstaller "https://raw.github.com/hendrikp/Plugin_D3D/master/latestredist.info" ExecWait "/S /D="
SectionEnd

Section "Joystick 1.1" SEC_PLUGIN_JOYSTICK
Section /o "Joystick" SEC_PLUGIN_JOYSTICK
AddSize 200
!insertmacro DownloadAndExecuteLatestPluginInstaller "https://raw.github.com/hendrikp/Plugin_Joystick/master/latestredist.info" ExecWait "/S /D="
SectionEnd

Section "Crash 1.1" SEC_PLUGIN_CRASH
Section /o "Crash" SEC_PLUGIN_CRASH
AddSize 200
!insertmacro DownloadAndExecuteLatestPluginInstaller "https://raw.github.com/hendrikp/Plugin_Crash/master/latestredist.info" ExecWait "/S /D="
SectionEnd
Loading

0 comments on commit 53fc86f

Please sign in to comment.