Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 18th June 2004, 20:06   #1
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
Help woth InstallDirRegKey

I am reading this value, c:\valve\steam\steamapps\dygear@aol.com\half-life, from HKCU "Software\Valve\Steam" "ModInstallPath"

but i want to get, c:\valve\steam\steamapps\dygear@aol.com, is there a way to do that?

-- Mark 'Dygear' Tomlin
Dygear is offline   Reply With Quote
Old 18th June 2004, 20:25   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
Search the forum for *steam*. This question has been asked and answered several times already.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 18th June 2004, 22:27   #3
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
I searched for InstallDirRegKey before I posted but did not find it, my bad.

-- Mark 'Dygear' Tomlin
Dygear is offline   Reply With Quote
Old 18th June 2004, 22:36   #4
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
Ok searched for Steam, and this is the most approte thread i could find. [link]
What i want to do is take the value from ModInstallPath and get the parent forlder. then set that to the Insall path.
I am going to try and make up some code later, but in that time if you could help with this then that would be great, I will no doubt have some qustions on how to do this later.

-- Mark 'Dygear' Tomlin
Dygear is offline   Reply With Quote
Old 18th June 2004, 22:40   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
What's wrong with GetParent from that thread and from the documentation?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 20th June 2004, 01:53   #6
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
That code seems over kill.
This is what i want to do.
  1. That whats in the ModInstallPath and put in in to a variable.
  2. Take that var and GetParent.
  3. Set that as the INSTALL DIR.

I want to do back to the email address, not to [Drive:]/[DIR]/steam.

-- Mark 'Dygear' Tomlin

Last edited by Dygear; 20th June 2004 at 03:53.
Dygear is offline   Reply With Quote
Old 20th June 2004, 11:59   #7
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 569
code:
; Read registry value into $1
; for example, $1 = "c:\valve\steam\steamapps\dygear@aol.com\half-life"

Push $1
Call GetParent
Pop $0

; $0 = "c:\valve\steam\steamapps\dygear@aol.com"

pengyou is offline   Reply With Quote
Old 22nd June 2004, 08:39   #8
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
code:
; Start of Setting Install Dir
Function GetParent
Exch $0 ; old $0 is on top of stack
Push $1
Push $2
StrCpy $1 -1
loop:
StrCpy $2 $0 1 $1
StrCmp $2 "" exit
StrCmp $2 "\" exit
IntOp $1 $1 - 1
Goto loop
exit:
StrCpy $0 $0 $1
Pop $2
Pop $1
Exch $0 ; put $0 on top of stack, restore $0 to original value
FunctionEnd

Var InstallDir ;Declare the variable

Section InstallDir
StrCpy $InstallDir ReadRegStr HKCU Software\Valve\Steam ModInstallPath
Push $9
Call getParent
Pop $9
SectionEnd
; End of Setting Install Dir


Can some one tell me why this is not working?

-- Mark 'Dygear' Tomlin
Dygear is offline   Reply With Quote
Old 22nd June 2004, 12:12   #9
zimsms
Senior Member
 
zimsms's Avatar
 
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
change:

Quote:
StrCpy $InstallDir ReadRegStr HKCU Software\Valve\Steam ModInstallPath
to:
PHP Code:
ReadRegStr $0 HKCU "Software\\Valve\\Steam" "ModInstallPath"
StrCpy $INSTDIR "$0"

; or

Var 
$InstallDir
ReadRegStr $InstallDir HKCU 
"Software\\Valve\\Steam" "ModInstallPath" 
zimsms is offline   Reply With Quote
Old 26th June 2004, 11:50   #10
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
code:
;Hope this works !
Function GetParent
Exch $0 ; old $0 is on top of stack
Push $1
Push $2
StrCpy $1 -1
loop:
StrCpy $2 $0 1 $1
StrCmp $2 "" exit
StrCmp $2 "\" exit
IntOp $1 $1 - 1
Goto loop
exit:
StrCpy $0 $0 $1
Pop $2
Pop $1
Exch $0 ; put $0 on top of stack, restore $0 to original value
FunctionEnd

Var InstallDir
Section InstallDir
ReadRegStr $InstallDir HKCU "Software\Valve\Steam" "ModInstallPath"
Push $InstallDir
Call GetParent
Pop $0
SectionEnd

InstallDir "$0"



This should work :fingerscrossed:
Nope ... god this sucks.

-- Mark 'Dygear' Tomlin
Dygear is offline   Reply With Quote
Old 26th June 2004, 12:08   #11
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
Heres my code ...
Attached Files
File Type: nsi amxmodx-0.16-steam.nsi (9.2 KB, 78 views)

-- Mark 'Dygear' Tomlin
Dygear is offline   Reply With Quote
Old 26th June 2004, 12:13   #12
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
http://forums.winamp.com/showthread....=installdir%2A

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 28th June 2004, 19:20   #13
Dygear
Junior Member
 
Join Date: May 2004
Location: Levittown, NY
Posts: 29
Send a message via AIM to Dygear
Thanks.

-- Mark 'Dygear' Tomlin
Dygear is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump