Code center > Darwinbots Program Source Code
NSIS-based installer
goffrie:
I created an NSIS-based installer for Darwinbots 2.43.1L. It currently installs all the OCX's installed by the original installer as well as msstdfmt.dll (needed for the custom costs dialog), and registers them all. It does not install comdlg32.dll, which is usually already present. If it should be added, tell me. Currently the installed bots consist of Alga Minimalis, Animal Minimalis, Seasnake, and Republican Bee. If you want to recommend any example bots, then do so
I tested it on a brand-new Windows XP SP2 install (hosed my old VirtualBox image thanks to a lack of disk space when merging a snapshot) and it seems to work mostly fine, although for some reason the Settings directory didn't seem to get created (it's in the script though as a recursive copy, although with only default.set).
If you were to make a consistent way of downlloading the newest Darwinbots executable (I.e. in a single place which doesn't change between versions), I could make the installer download the newest version during the installation, using NSISdl. ZIP decompression is also supported in NSIS so that isn't a problem.
The installer is internally compressed with solid LZMA compression so don't bother compressing it again.
(edit: new installer below)
Oh, and here is the NSIS script. It'll need some adjusting to work on Windows since I use it on Linux and it is using Unix-style paths.
Right now, it doesn't uninstall any of the DLLs/OCXs which it installs. If that's an issue I can still add the removal to the uninstall code, but I'd have to add more registry keys to remember whether or not it existed before the installer ran.
--- Code: ---!include MUI2.nsh
!include VB6RunTime.nsh
Name "DarwinBots 2.4"
OutFile "Darwin_setup.exe"
InstallDir "$PROGRAMFILES\DarwinBots"
InstallDirRegKey HKCU "Software\DarwinBots" ""
RequestExecutionLevel admin
BrandingText " "
XPStyle on
CRCCheck on
SilentInstall normal
SetCompressor /SOLID lzma
Var AlreadyInstalled
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section "Install" Install
SetOutPath "$INSTDIR"
File "/home/goffrie/Darwinbots/DarwinBotsII/Darwin.exe"
File "/home/goffrie/Darwinbots/DarwinBotsII/How to setup a DarwinBots server.txt"
SetOverwrite off
File "/home/goffrie/Darwinbots/DarwinBotsII/intsett.ini"
File /r "/home/goffrie/Darwinbots/DarwinBotsII/Robots"
File /r "/home/goffrie/Darwinbots/DarwinBotsII/Settings"
SetOutPath "$INSTDIR\Autosave"
SetOutPath "$INSTDIR\Saves"
SetOutPath "$INSTDIR\Transfers"
SetOutPath "$INSTDIR\Transfers\F1"
SetOutPath "$INSTDIR\Transfers\F1\in"
SetOutPath "$INSTDIR\Transfers\F1\out"
SetOutPath "$SYSDIR"
File "/home/goffrie/Darwinbots/OCX/*.OCX"
RegDLL "$SYSDIR\COMCT232.OCX"
RegDLL "$SYSDIR\COMDLG32.OCX"
RegDLL "$SYSDIR\MSCOMCTL.OCX"
RegDLL "$SYSDIR\MSINET.OCX"
RegDLL "$SYSDIR\RICHTX32.OCX"
RegDLL "$SYSDIR\TABCTL32.OCX"
File "msstdfmt.dll"
RegDLL "$SYSDIR\msstdfmt.dll"
SetOverwrite on
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
;Store installation folder
WriteRegStr HKCU "Software\Darwinbots" "" $INSTDIR
;Install VB runtime
IfFileExists "$INSTDIR\Darwin.exe" 0 new_installation
StrCpy $AlreadyInstalled 1
new_installation:
!insertmacro VB6RunTimeInstall /home/goffrie/Darwinbots/vb6 $AlreadyInstalled
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\Darwin.exe"
Delete "$INSTDIR\How to setup a DarwinBots server.txt"
Delete "$INSTDIR\intsett.ini"
Delete "$INSTDIR\Uninstall.exe"
Delete "$INSTDIR\Robots\Alga_Minimalis.txt"
Delete "$INSTDIR\Robots\Animal_Minimalis.txt"
Delete "$INSTDIR\Robots\Gridlock.txt"
Delete "$INSTDIR\Robots\Republican_Bee.txt"
Delete "$INSTDIR\Robots\Seasnake_1.0.txt"
Delete "$INSTDIR\Settings\default.set"
RMDir "$INSTDIR\Autosave"
RMDir "$INSTDIR\Robots"
RMDir "$INSTDIR\Saves"
RMDir "$INSTDIR\Settings"
RMDir "$INSTDIR\Transfers\F1\in"
RMDir "$INSTDIR\Transfers\F1\out"
RMDir "$INSTDIR\Transfers\F1"
RMDir "$INSTDIR\Transfers"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\Darwinbots"
;Remove VB runtime
!insertmacro VB6RunTimeUnInstall
SectionEnd
--- End code ---
Gah, another thing I forgot to mention: It doesn't install any shortcuts, I forgot to add it in. I'll put it in... later
goffrie:
Nobody wants to comment?
ikke:
--- Quote from: goffrie ---Nobody wants to comment?
--- End quote ---
Speaking for myself: not commenting is a sign of lack of knowledge on my part, not for lack of respect for the work done...
Numsgil:
It looks good, but like you say it needs to add shortcuts (one of the shortcuts should be to the actual folder itself, since much work needs to be done in that folder). Also, the directory name should be DarwinbotsII (even though it's confusing since most haven't seen DB1). Mostly this is to allow me to eventually have a Darwinbots3 directory that's distinct without causing people to panic when they can't find DB2. You should also keep the exe name unchanged, so users can find a way to know what version they're using by opening up their directory. Any maybe a text file that explains where to find the latest patches and what to do with them. When I start up the exe, it prompts me about missing settings files. It would be nice if the installer handled all of that, and we could do away with that whole clause. After I click through the dialogs, my new install does not start a simulation, or it starts an empty simulation (hard to tell either way). I would set up some quick settings for the different bots included, so people can load them immediately when they first start the game. It's especially important that these default settings be something that they can leave running for a time and see some mutations going on. So the settings should be set to let it run without crashing (the population, not the program ). The default settings that the program launches with should be animal minimalis (but then again, I'm hardly an impartial judge ) When I uninstalled the program, I accidentally left the game running, so not everything got deleted. The uninstaller should give me a warning message or something to let me know.
Also, some notes to Eric: the splash screen that used to launch when the program was run no longer does. At the very least it should spash the first time the game is run (which you can detect if there's no lastexit.sim file maybe?). intsett.ini should remove any irrelevant data (such as the bogus http), to prevent users from thinking that it is important, and not knowing what to set it to.
And I would include the bot Dominator Invincibalis. It's a good middle tier bot that's very resistant to breaking changes in newer versions.
I'm appreciative of the effort. Don't think my long list of complaints is anything but nitpicking
goffrie:
Shortcuts have been added to the script (on my hard drive for now.)
Just a question - is the proper capitalization "DarwinBots" or "Darwinbots"? It's been used both ways, so I'm wondering which I should use for paths and such.
--- Quote ---After I click through the dialogs, my new install does not start a simulation, or it starts an empty simulation (hard to tell either way). I would set up some quick settings for the different bots included, so people can load them immediately when they first start the game.
--- End quote ---
Sorry, I don't really understand you here - what file(s) should be added?
About uninstalling, I already have the "confirm" page, which lists the install directory. What else should I add there?
Navigation
[0] Message Index
[#] Next page
Go to full version