JRWR
18th February 2008 20:28 UTC
Wild Card Folders?
I'm a little new to NSIS, so i dont know how i would do this,
I'm making a simple installer for Gmod users, to install a massive addons pack, and the folder names can change (only one really)
C:\Program Files\Steam\Steamapps\<name>\garrysmod\garrysmod
so ether A) have a page for the user to select what username to install or B) to install to all folders that have the garrysmod sub folder
bholliger
18th February 2008 22:15 UTC
Hi there!
Use SetOutPath [1] in conjunction with File [2].
I'm sure you'll find what you need!
[1] http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.9
[2] http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.5
Cheers
Bruno
JRWR
19th February 2008 13:40 UTC
Nope
I'm still lost, how would it be able to detect the right folder?
Red Wine
19th February 2008 14:27 UTC
outfile test.exe
ShowInstDetails show
var name
page directory
page instfiles
Function .onInit
ReadRegStr $name HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer" "Logon User Name"
StrCpy $INSTDIR "$PROGRAMFILES\Steam\Steamapps\$name\garrysmod\garrysmod"
FunctionEnd
Section -
SetOutPath "$INSTDIR"
DetailPrint "$OUTDIR"
SectionEnd
JRWR
19th February 2008 20:56 UTC
You cant find it that way
Steam does not store the username in the registery
JRWR
19th February 2008 20:59 UTC
i think i might of found somthing
found this in the registery
HKEY_CLASSES_ROOT\Valve.Source\shell\open\command
"c:\program files\steam\steamapps\jrwr\garrysmod\hl2.exe" "%1"
JRWR
19th February 2008 21:19 UTC
ok i found where steam holds the login info
C:\Program Files\Steam\config\SteamAppData.vdf
"SteamAppData"
{
"RememberPassword" "1"
"AutoLoginUser" "jrwr"
"jrwr"
{
"User" "jrwr"
"AccountCreated" "1"
"ShowNotifyTrayHintDialog" "0"
}
}
{_trueparuex^}
19th February 2008 22:54 UTC
There's a function in the NSIS wiki to get the steam install path and username.
http://nsis.sourceforge.net/Get_Stea...d_install_path
To make that function better...
Replace this line in GetSteamAccountName function:
IfFileExists "$R0\steamapps\$R2\*.*" done
With this one:
IfFileExists "$R0\steamapps\$R2\garrysmod\garrysmod\*.*" done
After that change the function returns the first user with garrysmod installed.
JRWR
20th February 2008 03:25 UTC
Thank you
Thank you sir (writes name down in installer)
(and Afrow UK)
Also a note: make sure your path is right, spent a hour looking at code to figure this out
old:
StrCpy $INSTDIR "$R1\$R0\SteamApps\garrysmod\garrysmod\addons"
new:
StrCpy $INSTDIR "$R1\SteamApps\$R0\garrysmod\garrysmod\addons"