; example1.nsi ; ; This script is perhaps one of the simplest NSIs you can make. All of the ; optional settings are left to their default settings. The installer simply ; prompts the user asking them where to install, and drops a copy of makensisw.exe ; there. ;-------------------------------- Name "Battle Grounds 2 0.17" OutFile "bg2-0.17.exe" SetCompressor /SOLID lzma ; The default installation directory Function GetSteamAccountName ReadRegStr $R0 HKCU "Software\Valve\Steam" "SourceModInstallPath" StrCmp $R0 "" noSteam Goto +2 noSteam: StrCpy $R0 "$PROGRAMFILES\Valve\Steam\SteamApps\SourceMods" Push $R0 FunctionEnd ;-------------------------------- ; Pages Page directory Page instfiles ;-------------------------------- Section "Desktop Icon" SecDesktop CreateShortCut "$DESKTOP\Battle Grounds 2 0.17.lnk" "$INSTDIR\..\..\steam.exe" "-applaunch 320 -game $INSTDIR\bg2" "$INSTDIR\bg2\resource\bg2_icon.ico" SectionEnd ; The stuff to install Section "" ; Set output path to the installation directory. SetOutPath $INSTDIR\bg2 ; Put file there File /r D:\Program\Valve\Steam\SteamApps\SourceMods\install\bg2\* SectionEnd Function .onInit Call GetSteamAccountName Pop $INSTDIR SectionSetFlags ${SecDesktop} 1 FunctionEnd Function .onInstSuccess MessageBox MB_OK "Restart Steam if BG2 doesn't show up in the third party mods list. A desktop shortcut has been created." FunctionEnd