Your Computer Name: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Wikipedia python library)
 
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{PageAuthor|VegetaSan}}
[http://shurl.org/PFqgs Made By VegetaSan :)]
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 10: 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 23: Line 35:
</highlight-nsis>
</highlight-nsis>


Page author: VegetaSan
[[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