Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 3rd October 2002, 16:15   #1
Benoni
Junior Member
 
Join Date: Oct 2002
Location: Argyll, Scotland
Posts: 18
Send a message via ICQ to Benoni
Question Finding NSIS really hard to use - Please Help Me

Hello,
I am finding NSIS really hard to use. I have trying to make an install program with runs as follows. It would need to run silently and if there were any errors then it would close.





Set $mainversion to 1.11


If the system directory is c:\windows\system\ set as $installdir (including last \) and set $installdirnum as 1
If the system directory is c:\win95\system\ set as $installdir (including last \) and set $installdirnum as 2
If the system directory is c:\winnt\system\ set as $installdir (including last \) and set $installdirnum as 3
If the system directory is none of the above then exit

If the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\mainversion is > $mainversion Then exit
If there is no such directory or HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\mainversion is less than $mainversion then just continue

Copy files3.exe to $installdir if the file is newer
Copy files4.exe to $installdir if the file is newer
Copy files5.exe to $installdir if the file is newer

If the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\currentstate is “zero” Then run code section 1
If the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\currentstate is “one” Then run code section 2
If there is no such registry key as: HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\currentstate Then run code section 2


--------------- Code Section 1 ---------------

Copy file1.exe to $installdir as file1_1.exe and overwrite if there is a file with the same name
Copy file2.exe to $installdir as file2_1.exe and overwrite if there is a file with the same name
Set HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\currentstate to “one”
Set $currentstate to “one”

------------ End Code Section 1 ------------


--------------- Code Section 2 ---------------

Copy file1.exe to $installdir and overwrite if there is a file with the same name
Copy file2.exe to $installdir and overwrite if there is a file with the same name
Set HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\currentstate to “zero”
Set $currentstate to “zero”

------------ End Code Section 2 ------------


If $installdirnum = 1 AND $currentstate = “zero” Then copy 1.ini
If $installdirnum = 2 AND $currentstate = “zero” Then copy 2.ini
If $installdirnum = 3 AND $currentstate = “zero” Then copy 3.ini
If $installdirnum = 1 AND $currentstate = “one” Then copy 4.ini
If $installdirnum = 2 AND $currentstate = “one” Then copy 5.ini
If $installdirnum = 3 AND $currentstate = “one” Then copy 6.ini

Set HKEY_LOCAL_MACHINE\SOFTWARE\mmsoft\mainversion as $mainversion

If $installdirnum = 1 AND $currentstate = “zero” Then run c:\windows\system\file1.exe
If $installdirnum = 2 AND $currentstate = “zero” Then run c:\win95\system\file1.exe
If $installdirnum = 3 AND $currentstate = “zero” Then run c:\winnt\system\file1.exe
If $installdirnum = 1 AND $currentstate = “one” Then run c:\windows\system\file1_1.exe
If $installdirnum = 2 AND $currentstate = “one” Then run c:\win95\system\file1_1.exe
If $installdirnum = 3 AND $currentstate = “one” Then run c:\winnt\system\file1_1.exe





Any help would be great.
Thanks
Benoni
Benoni is offline   Reply With Quote
Old 3rd October 2002, 20:54   #2
sdbarker
Senior Member
 
Join Date: Mar 2002
Posts: 133
Send a message via AIM to sdbarker Send a message via Yahoo to sdbarker
Read the documentation and go through the sample scripts. That should get you started.

-Scott
sdbarker is offline   Reply With Quote
Old 4th October 2002, 10:16   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
If you still don't understand something after you read the documents and look over the examples don't be afraid to come again and ask as much as you want.

Things to look for in the documents:
ReadRegStr
WriteRegStr
$WINDIR
$SYSDIR
File
StrCmp
StrCpy
Exec
ExecWait
ShellExec

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 5th October 2002, 09:11   #4
Benoni
Junior Member
 
Join Date: Oct 2002
Location: Argyll, Scotland
Posts: 18
Send a message via ICQ to Benoni
reply

Thanks
Will do
Benoni 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