Dynaverse.net
Taldrenites => Starfleet Command Mission Scripting => Topic started by: FireSoul on August 31, 2004, 10:50:08 am
-
ESG sound loop installer fix:
;--------------------------------
Section "ESG SoundLoop Fix"
SectionIn 1
SetDetailsPrint textonly
DetailPrint "Removing ESG SoundLoop..."
SetDetailsPrint listonly
DetailPrint "- Removing ESG SoundLoop..."
SetOutPath "$INSTDIR"
IfFileExists "$INSTDIR\assets\sound\sounds.txt.orig" delete_backup proceed_with_fixing
delete_backup:
SetFileAttributes "$INSTDIR\Assets\Sound\sounds.txt.orig" NORMAL
Delete "$INSTDIR\Assets\Sound\sounds.txt.orig"
proceed_with_fixing:
IfFileExists "$INSTDIR\assets\sound\sounds.txt" do_fix no_fix
do_fix:
; Rename file
SetFileAttributes "$INSTDIR\Assets\Sound\sounds.txt" NORMAL
Rename "$INSTDIR\Assets\Sound\sounds.txt" "$INSTDIR\Assets\Sound\sounds.txt.orig"
FileOpen $9 "$INSTDIR\Assets\Sound\sounds.txt.orig" r
; open new replacement file
FileOpen $8 "$INSTDIR\Assets\Sound\sounds.txt" w
; copy-paste the "wave" lines from the file, to preserve the tabs
StrCpy $2 "wave kSndESG0Loop esgloo0.wav ESG Level 0 Sphere Loop y 1 11 99 Esg 35 35 y"
StrCpy $3 "wave kSndESG1Loop esgloo1.wav ESG Level 1 Sphere Loop y 1 14 99 Esg 35 35 y"
StrCpy $4 "wave kSndESG2Loop esgloo2.wav ESG Level 2 Sphere Loop y 1 17 99 Esg 35 35 y"
StrCpy $5 "wave kSndESG3Loop esgloo3.wav ESG Level 3 Sphere Loop y 1 20 99 Esg 35 35 y"
fileread_loop:
FileRead $9 $1
IfErrors close_files
; Strip out 2 EOL special chars for compare
StrLen $R1 $1
IntOp $R1 $R1 - 2
StrCpy $R2 $1 $R1
; compare block -- Locate wanted strings
StrCmp $R2 $2 line_found
StrCmp $R2 $3 line_found
StrCmp $R2 $4 line_found
StrCmp $R2 $5 line_found line_not_found
line_found:
DetailPrint " Commenting out ESGLoop line"
StrCpy $6 " $1"
StrCpy $1 $6
line_not_found:
FileWrite $8 $1
goto fileread_loop
close_files:
FileClose $8
FileClose $9
goto end
no_fix:
MessageBox MB_OK "$INSTDIR\Assets\Sound\sounds.txt does not exist. Unable to fix soundloop problem."
end:
SectionEnd
Dynaverse Directory Servers installer-based fix:
;--------------------------------
; MetaAssets\ServerProfiles\Multiplayer\WONServerSetup.gf
; [WONDirectoryServer/Addresses]
; 0="63.101.60.125:15101"
; //0="sfc2.west.won.net:15101"
; //1="sfc2.central.won.net:15101"
; //2="sfc2.east.won.net:15101"
Section "Update Dynaverse2 Directory Servers"
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint "Updating Dynaverse2 Directory Server addresses..."
SetDetailsPrint listonly
DetailPrint "- Updating Dynaverse2 Directory Server addresses..."
SetOutPath "$INSTDIR"
SetFileAttributes "$INSTDIR\MetaAssets\ServerProfiles\Multiplayer\WONServerSetup.gf" NORMAL
DeleteINIStr "$INSTDIR\MetaAssets\ServerProfiles\Multiplayer\WONServerSetup.gf" "WONDirectoryServer/Addresses" "0"
DeleteINIStr "$INSTDIR\MetaAssets\ServerProfiles\Multiplayer\WONServerSetup.gf" "WONDirectoryServer/Addresses" "1"
DeleteINIStr "$INSTDIR\MetaAssets\ServerProfiles\Multiplayer\WONServerSetup.gf" "WONDirectoryServer/Addresses" "2"
WriteINIStr "$INSTDIR\MetaAssets\ServerProfiles\Multiplayer\WONServerSetup.gf" "WONDirectoryServer/Addresses" "0" "63.101.60.125:15101"
SectionEnd
;--------------------------------
Enjoy. Use. Make these common. ;)
-- Luc
-
Frey wants to give me a DNS entry for Directory server. Installer stuff ready, but am waiting for address. Will keep you posted.
-
Does the Directory services installer fix the esg. loop buzz.It would be niceif it did is there an easy way of fixing it.
-
No. It doesn't.
This does:
http://klingon.stasis.ca/SFCOP_mini_updater/
-
For smaller installers; in addition to NSIS's use of the 7-zip (http://www.7-zip.org/) LZMA SDK for high compression ratios of the data, UPX (http://upx.sourceforge.net/) can be used with NSIS to compress the exe header of an NSIS installer to shave a few more KB off the installer.
like so:
!packhdr "tmp.dat" "c:\upx\upx.exe -9 tmp.dat"
aside: 7-zip can now be used to open compiled NSIS installers (though it will not extract the original nsi script, there was a beta released that did however...)
-
I recently discoverd the NSIS LogicLib include allowing for structures like this:
!include "LogicLib.nsh"
Var port_counter
Var test_host_return
${For} $port_counter 2300 2400
DetailPrint "Testing port $port_counter TCP..."
SetDetailsPrint none
ExecWait '"$EXEDIR\sfc_test_host.exe" -l -p $port_counter -d -n -w 2' $test_host_return
;DetailPrint "sfc_test_host.exe returned $test_host_return"
SetDetailsPrint both
${If} $test_host_return = 0
DetailPrint "...passed!"
${Else}
DetailPrint "...failed!"
${EndIf}
${Next}
Weeee! No more strcmp and gotos for me! :woot: