Topic: The NSIS script of SFC3: Rebalance Expansion installer  (Read 2330 times)

0 Members and 1 Guest are viewing this topic.

yochenhsieh

  • Guest
The NSIS script of SFC3: Rebalance Expansion installer
« on: January 17, 2007, 11:11:24 pm »
Though NSIS is not very widely used in SFC Community, I decided to give out the codes of my installer in case someone might want to try NSIS and don't know how to start.

Code: [Select]
;NSIS Modern User Interface
;-----------------------------------------------------
SetCompressor /SOLID lzma
SetCompressorDictSize 16
SetDatablockOptimize on
!include "MUI.nsh"
Name "SFC3 Rebalance Expansion"
OutFile "SFC3REX_2007.exe"

;Get install folder from registry for updates
InstallDirRegKey HKLM "Software\Activision\Star Trek Starfleet Command III" "InstallPath"
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"

Section "Files"
  SetOverwrite on
  SetOutPath "$INSTDIR"
  CreateDirectory $INSTDIR\backup
  CopyFiles $INSTDIR\assets\commonsettings $INSTDIR\backup
  CopyFiles $INSTDIR\assets\specs $INSTDIR\backup
  CopyFiles $INSTDIR\assets\strings\shipnames.txt $INSTDIR\backup
  CopyFiles $INSTDIR\assets\textures\fx1.bmp $INSTDIR\backup
  RMDir /r $INSTDIR\assets\models\akira
  RMDir /r $INSTDIR\assets\models\borgdiamond
  RMDir /r $INSTDIR\assets\models\bop
  RMDir /r $INSTDIR\assets\models\defiant
  RMDir /r $INSTDIR\assets\models\excelsior
  RMDir /r $INSTDIR\assets\models\galaxy
  RMDir /r $INSTDIR\assets\models\intrepid
  RMDir /r $INSTDIR\assets\models\klingon_neghvar
  RMDir /r "$INSTDIR\assets\models\k't'inga"
  RMDir /r "$INSTDIR\assets\models\k'vort"
  RMDir /r $INSTDIR\assets\models\marauder
  RMDir /r $INSTDIR\assets\models\nebula
  RMDir /r $INSTDIR\assets\models\norway
  RMDir /r $INSTDIR\assets\models\romulan_warbird
  RMDir /r $INSTDIR\assets\models\saber
  RMDir /r $INSTDIR\assets\models\sovereign
  RMDir /r $INSTDIR\assets\models\vorcha
  Delete $INSTDIR\assets\textures\*damage*.bmp
  Delete $INSTDIR\assets\textures\*plasma.bmp
  Delete $INSTDIR\assets\textures\targeting*.bmp
  Delete $INSTDIR\assets\textures\L-crosshair*.bmp
  Delete $INSTDIR\assets\textures\*sun*.bmp
  Delete $INSTDIR\assets\textures\fx2.bmp
  Delete $INSTDIR\assets\textures\fx4.bmp
  Delete $INSTDIR\assets\textures\fx5.bmp
  Delete $INSTDIR\assets\textures\fx6.bmp
  Delete $INSTDIR\assets\textures\debris1.bmp
  Delete $INSTDIR\assets\textures\pk-maw.bmp
  Delete $INSTDIR\assets\textures\gravimetric-torpedo.bmp
  Delete $INSTDIR\assets\textures\heavy-photon.bmp
  Delete $INSTDIR\assets\textures\klingon-splat.bmp
  File /r Assets
  File *.txt
  WriteINIStr $INSTDIR\sfc.ini UI MakeItSo 1
  WriteINIStr $INSTDIR\sfc.ini 3D Specularity 1
  WriteINIStr $INSTDIR\sfc.ini 3D BlueLight 0
  WriteINIStr $INSTDIR\sfc.ini 3D writeoutmodelsizfile 0
  WriteINIStr $INSTDIR\sfc.ini 3D DamageSkinResolution 100
  WriteINIStr $INSTDIR\sfc.ini Game RaceShieldFX 0
SectionEnd

These codes are combined from v2.0 and v2.5.1 installer, and will be used as a base for my next release. If you want to use it for your mod, don't forget to chage the names and remove the lines you don't need.  ;)

Offline Rod ONeal

  • D.Net Beta Tester
  • Commander
  • *
  • Posts: 3592
  • Gender: Male
Re: The NSIS script of SFC3: Rebalance Expansion installer
« Reply #1 on: January 18, 2007, 02:46:56 am »
This is very cool of you. May mucho karma come your way. I don't know programming, but can usually figure out what I need to know from an example like this. I wish that someone would have been so kind a long time ago. Thanks! 8) :thumbsup:
If Romulans aren't cowards, then why do they taste like chicken?