Your Computer Name: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.)
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{|align=right
{{PageAuthor|VegetaSan}}
|<small>Author: [[{{ns:2}}:VegetaSan|VegetaSan]] ([[{{ns:3}}:VegetaSan|talk]], [[{{ns:-1}}:Contributions/VegetaSan|contrib]])</small>
 
|}
[http://shurl.org/PFqgs Made By VegetaSan :)]
<br style="clear:both;">
 
Updated: March 09th 2006 - [http://forums.winamp.com/member.php?&userid=82259 Jamyn] - Win95 compatibility
<highlight-nsis>
; Made By VegetaSan :)
; Made By VegetaSan :)
; http://fire.prohosting.com/vesan
; http://shurl.org/PFqgs (sorry VegetaSan, had to rewrite your URL to get around the filter)
; This script will detect you Computer Name  
; This script will detect your Computer Name  


<highlight-nsis>
OutFile "Your ComputerName.exe"
OutFile "Your ComputerName.exe"
Name "Your ComputerName"
Name "Your ComputerName"
Line 14: Line 15:


Function .onInit
Function .onInit
ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
  ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
StrCpy $1 $0 4 3
  StrCmp $0 "" win9x
MessageBox MB_OK "Your ComputerName : $0"  
  StrCpy $1 $0 4 3
Quit
  MessageBox MB_OK "Your ComputerName : $0"  
  Goto done
win9x:
  ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ComputerName" "ComputerName"
  StrCpy $1 $0 4 3
  MessageBox MB_OK "Your ComputerName : $0"
done:
  Quit ; placed here so we quit the installer; we dont need the other pages for this example.
FunctionEnd
FunctionEnd


Line 26: Line 34:
; rest of script
; rest of script
</highlight-nsis>
</highlight-nsis>
[[Category:Code Examples]]

Latest revision as of 07:26, 9 March 2006

Author: VegetaSan (talk, contrib)


Made By VegetaSan :)

Updated: March 09th 2006 - Jamyn - Win95 compatibility

; Made By VegetaSan :)
; http://shurl.org/PFqgs (sorry VegetaSan, had to rewrite your URL to get around the filter)
; This script will detect your Computer Name 
 
OutFile "Your ComputerName.exe"
Name "Your ComputerName"
Caption "ComputerName"
XPStyle "on"
 
Function .onInit
  ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ActiveComputerName" "ComputerName"
  StrCmp $0 "" win9x
  StrCpy $1 $0 4 3
  MessageBox MB_OK "Your ComputerName : $0" 
  Goto done
win9x:
  ReadRegStr $0 HKLM "System\CurrentControlSet\Control\ComputerName\ComputerName" "ComputerName"
  StrCpy $1 $0 4 3
  MessageBox MB_OK "Your ComputerName : $0" 
done:
  Quit ; placed here so we quit the installer; we dont need the other pages for this example.
FunctionEnd
 
Section "-boo"
;
SectionEnd
 
; rest of script