Qhimm.com Forums
Final Fantasy 7 => FF7 Tools => Topic started by: pyrozen on 2011-04-13 01:16:51
-
(http://img.photobucket.com/albums/v220/pyrozen/Untitled-1-17.jpg)
I created this a while back for TA release, but have decided that it may be helpful to other on Qhimm. It is an NSIS script that creates a spiffy installer for you after you declare a few different things. If you are inexperienced with NSIS scripting, this might be an easy way to ease into it, because I have done all of the difficult coding for you already. All you have to do is place your fies in the same directory, then declare them in the script and compile! It's a bit more involved than that, but i have fully commented the entire script, so nothing is difficult to locate. I would suggest using Notepad++ for ease of viewing. If you dont have NSIS experience i would recommend reading about it on the NSIS website, as well as the UltraModernUI website, since i will only provide basic support here.
First you will need to download NSIS and UltraModernUI:
Download (http://sourceforge.net/projects/ultramodernui/files/UltraModernUI/UltraModernUI%201.00b2-dev/NSIS_2.46_UltraModernUI_1.00_2010-11-11.exe/download)
Full Documentation:
NSIS webpage (http://search.yahoo.com/r/_ylt=A0oG7lWh96RNWRYA92hXNyoA;_ylu=X3oDMTE1dnJ0cTVrBHNlYwNzcgRwb3MDMQRjb2xvA2FjMgR2dGlkA1ZJUDAyM18xNTI-/SIG=11p245tmq/EXP=1302678529/**http%3a//nsis.sourceforge.net/Main_Page)
UltraModernUI webpage (http://nsis.sourceforge.net/UltraModernUI)
Do a full installation. Without this package you cannot compile this script. There is also a fair chance that this may not compile the same on your computer as mine, I have never tried to transfer a raw NSIS script, but I am pretty sure everything is worked out.
Included in the installer:
=AutoFind FF7 directory (windows only)
=Aali Driver Check
=Spiffy Music
=Background graphics
=Spiffy ending fanfare
All of these elements are changable with the right knowledge. Most elements don't need to be changed, only things such as installer name, folder names, and a few text fields. Everything has been labeled in the script, so any important function will have its use listed next to it. There is also an example installer in the ZIP file so you can try it out before you decide if you want to use it.
Download Template (http://www.mediafire.com/file/99msykm4dyyh9vt/INSTALLER.zip)
If you have any problems let me know, if they are graphical in nature, provide a picture. I ask you provide credit for me somewhere, but its not a big deal.
have fun!
lee
-
*cough* credit *cough*
-
*cough* credit *cough*
This... yeah, is awesome.
-
Sweet. gotta love Nsis.its my personal favorate install system for windows.
=AutoFind FF7 directory (windows only)
basicly as long as your doing something like this:
Section "Find FF7"
${If} ${RunningX64}
ReadRegStr $1 HKLM "SOFTWARE\Wow6432Node\Square Soft, Inc.\Final Fantasy VII\" AppPath
${Else}
ReadRegStr $1 HKLM "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\" AppPath
${EndIf}
SectionEnd
then your path detection should work just fine in any version of windows or in wine.
-
this is great, maybe now even I can make an installer :D
-
Wow, that's pretty bad ass. Maybe I'll make an Installer for my old bike mod.
-
inno = Class.
-
Wow, that's pretty bad ass. Maybe I'll make an Installer for my old bike mod.
it'll move files around, but open/closing the LGPs is something that SL is much more familiar with. He helped me get going on this initially by providing me with the original TA installer script. It contains provisions for altering the LGPs, and ATM this script is more for the PNG based mods, though i am sure LGP functionality could easily be added *nudges SL. It would become more difficult to manage for an inexperienced user though.
-
I already figured most of this out on my own (by which I mean with sl's help), but I will give this a look to see how you did the background graphics and music.
-
Ugh, yeah it can be done. I dont have the original installer script handy right now though.
-
just made a test installer to make sure I understand everything and its working great, at least for pngs! This will make distributing my project a lot easier. Thank you :D
-
I already figured most of this out on my own (by which I mean with sl's help), but I will give this a look to see how you did the background graphics and music.
background and graphics are easily done by using the UltraModernUI. The music and finished sound were a bit trickier to get working properly, and making sure they ended up in the TEMP directory so they are deleted later on. Outside of that, its a fairly straight forward script, and anyone with NSIS experience won't be wow'd by it, but its a good starting point for people who have never used it before.
I encourage anyone to modify it and add functionality, I have already revised the initial script a bit, so a few updates are sure to materialize over time. If anyone has any suggestions please post up the code.
lee
-
Code to unlgp an lgp:
nsExec::ExecToLog /OEM '"$INSTDIR\unlgp.exe" "$INSTDIR\Backup Files\battle.lgp" "$INSTDIR\Temp\"'
nsExec::ExecToLog /OEM '"$INSTDIR\lgp.exe" "$INSTDIR\Temp" "$INSTDIR\data\battle\battle.lgp"'
Be careful with the quotes, removing one or using a different one instead as it will not work. Replace directories as needed.
-
Code to unlgp an lgp:
nsExec::ExecToLog /OEM '"$INSTDIR\unlgp.exe" "$INSTDIR\Backup Files\battle.lgp" "$INSTDIR\Temp\"'
nsExec::ExecToLog /OEM '"$INSTDIR\lgp.exe" "$INSTDIR\Temp" "$INSTDIR\data\battle\battle.lgp"'
Be careful with the quotes, removing one or using a different one instead as it will not work. Replace directories as needed.
very nice, i'll definitely make sure that gets in there
-
i found a little tool called reg2nsis and generated the registry-values of ff7 for my personal use. but for any purpose of making some nice mods and creating nsis installer - here's the code:
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc." "" ""
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "DataDrive" "M:\"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "AppPath" "$INSTDIR\"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "DataPath" "$INSTDIR\Data\"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "MoviePath" "$INSTDIR\movies\"
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "DiskNo" 0x0
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "FullInstall" 0x1
WriteRegBin HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "SSI_DEBUG" 53484f574d455448454150504c4f4700
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII" "DiscNo" 0x1
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00" "" ""
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics" "DriverPath" "ff7_opengl.fgd"
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics" "Driver" 0x3
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics" "Mode" 0x2
WriteRegBin HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics" "DD_GUID" 00000000000000000000000000000000
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Graphics" "Options" 0x12
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\MIDI" "MIDI_DeviceID" 0x0
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\MIDI" "MIDI_data" "GENERAL_MIDI"
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\MIDI" "MusicVolume" 0x64
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\MIDI" "Options" 0x1
WriteRegBin HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Sound" "Sound_GUID" 640316afafc34b40b88077dc5685fe91
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Sound" "Options" 0x0
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Square Soft, Inc.\Final Fantasy VII\1.00\Sound" "SFXVolume" 0x64
you have to put this in a section
and if you like to create some shortcuts, you can use for example:
CreateDirectory "$SMPROGRAMS\Final Fantasy 7"
CreateShortCut "$SMPROGRAMS\Final Fantasy 7\Final Fantasy 7 [Englisch - Hardcore].lnk" "$INSTDIR\FF7.bat" "" "$INSTDIR\ff7.ico"
CreateShortCut "$SMPROGRAMS\Final Fantasy 7\Final Fantasy 7 [Deutsch - Normal].lnk" "$INSTDIR\FF7ger.bat" "" "$INSTDIR\ff7.ico"
CreateShortCut "$DESKTOP\Final Fantasy 7 [Englisch - Hardcore].lnk" "$INSTDIR\FF7.bat" "" "$INSTDIR\ff7.ico"
CreateShortCut "$DESKTOP\Final Fantasy 7 [Deutsch - Normal].lnk" "$INSTDIR\FF7ger.bat" "" "$INSTDIR\ff7.ico"
post this in section too
-
hey
i just performed a little ff7_opengl.cfg tweak. i wrote a bat which automatically changes the window_size in config to the given display size. maybe you can use this code to do other straight things changing in textfiles. there is also the possibility to convert the batch to exe with a simple tool called "BatToExe".
graphics.bat looks like that:
@echo off & setlocal enabledelayedexpansion
wmic desktopmonitor get screenwidth > ff7winx.tx
wmic desktopmonitor get screenheight > ff7winy.tx
more +1 ff7winx.tx > ff7winx2.tx
more +1 ff7winy.tx > ff7winy2.tx
for /f "delims=;" %%i in (ff7winx2.tx) do @set winxsiz=%%i
for /f "delims=;" %%j in (ff7winy2.tx) do @set winysiz=%%j
del ff7winx.tx
del ff7winy.tx
del ff7winx2.tx
del ff7winy2.tx
set winxout= "window_size_x = %winxsiz%"
set winyout= "window_size_y = %winysiz%"
%windir%\system32\cmd.exe /C "START /WAIT CScript //NoLogo ff7winx.vbs ff7_opengl.cfg ff7_opengl.cfg_temp %winxout%"
del ff7_opengl.cfg
ren ff7_opengl.cfg_temp ff7_opengl.cfg
%windir%\system32\cmd.exe /C "START /WAIT CScript //NoLogo ff7winy.vbs ff7_opengl.cfg ff7_opengl.cfg_temp %winyout%"
del ff7_opengl.cfg
ren ff7_opengl.cfg_temp ff7_opengl.cfg
the *.vbs look like this:
Const ForReading = 1
Const ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set objRE01 = CreateObject("VBScript.RegExp")
objRE01.Global = True
objRE01.IgnoreCase = True
InputFile = WScript.Arguments(0)
OutoutFile = WScript.Arguments(1)
repl = WScript.Arguments(2)
Set inFile = fso.OpenTextFile(InputFile, ForReading)
Set outFile = fso.OpenTextFile(OutoutFile, ForWriting, True)
Do Until inFile.AtEndOfStream
strLine = inFile.ReadLine
Set colMatches01 = objRE01.Execute(strLine)
If colMatches01.Count > 0 Then
objRE01.Pattern = ".*window_size_x.*"
strLine = objRE01.Replace(strLine, repl)
End If
outFile.WriteLine strLine
Loop
you can use this things to create once some specific settings for the installing process of your mod.
just ask me if you have problems with getting smart with this code