Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2008, 02:58:14 pm

Login with username, password and session length
Be sure to check out the Dynaverse.Net Repository, the most comprehensive SFC library around !! ftp.dynaverse.net
690316 Posts in 49462 Topics by 2949 Members
Latest Member: Dialga
* Home Help Search Calendar Login Register
Dynaverse.net  |  Taldrenites  |  Starfleet Command Mission Scripting  |  Topic: NSIS Installer people: a few gifts 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: NSIS Installer people: a few gifts  (Read 1628 times)
FireSoul
Modder of shiplists
Lt. Commander
*
Offline Offline

Posts: 1009


mew.


WWW
NSIS Installer people: a few gifts
« on: August 31, 2004, 10:50:08 am »


ESG sound loop installer fix:

Code:
;--------------------------------

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:

Code:
;--------------------------------

; 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. Wink
-- Luc
Logged

Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer:  SFC-EAW for OP Campaigns
Kitbash: SFC2 models
FireSoul
Modder of shiplists
Lt. Commander
*
Offline Offline

Posts: 1009


mew.


WWW
Re: NSIS Installer people: a few gifts
« Reply #1 on: August 31, 2004, 02:30:12 pm »

Frey wants to give me a DNS entry for Directory server. Installer stuff ready, but am waiting for address. Will keep you posted.
Logged

Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer:  SFC-EAW for OP Campaigns
Kitbash: SFC2 models
Age
Federations Greatest
Lt. Commander
*
Offline Offline

Gender: Male
Posts: 1714


Re: NSIS Installer people: a few gifts
« Reply #2 on: October 07, 2004, 03:49:12 pm »

  Does the Directory services installer fix the esg. loop buzz.It would be niceif it did is there an easy way of fixing it.
Logged


Image above is a tribute to HMCS WarriorCV21 a Canadian Aircraft Carrier
Sig is by Pestalence www.nightsoft.net/effhq/
FireSoul
Modder of shiplists
Lt. Commander
*
Offline Offline

Posts: 1009


mew.


WWW
Re: NSIS Installer people: a few gifts
« Reply #3 on: October 13, 2004, 07:35:32 pm »

Logged

Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer:  SFC-EAW for OP Campaigns
Kitbash: SFC2 models
Bonk
Ringworld Child
Administrator
Captain
*
Offline Offline

Posts: 9314


Tanj!


Re: NSIS Installer people: a few gifts
« Reply #4 on: May 14, 2006, 08:59:04 am »

For smaller installers; in addition to NSIS's use of the 7-zip LZMA SDK for high compression ratios of the data, UPX 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:

Code:
!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...)
« Last Edit: May 14, 2006, 09:13:39 am by Bonk » Logged

Reality is what doesn't go away when you stop believing in it. - Philip K. Dick
Bonk
Ringworld Child
Administrator
Captain
*
Offline Offline

Posts: 9314


Tanj!


Re: NSIS Installer people: a few gifts
« Reply #5 on: May 16, 2006, 03:30:25 am »

I recently discoverd the NSIS LogicLib include allowing for structures like this:

Code:
!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
Logged

Reality is what doesn't go away when you stop believing in it. - Philip K. Dick
Pages: [1] Print 
Dynaverse.net  |  Taldrenites  |  Starfleet Command Mission Scripting  |  Topic: NSIS Installer people: a few gifts « previous next »
Jump to:  

Powered by MySQL Powered by PHP Dynaverse.net | Powered by SMF 1.0.15.
© 2001-2008, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!
Page created in 0.161 seconds with 21 queries.