Archive: Help!


Help!
Ok, I need NSIS to help me.

I made some reg file that do different thing to tweak windows.
But now i need NSIS to active them easy-er.

The files i use are .reg files.

Windows
1. I need a Message window, you know saying
damage to computer etc.
2. Then it how active reg
3. Then the last window saying Complete.


I didn't understand you very clearly... but here are some answers:

1) add:
MessageBox MB_OK "We are going to damage your computer, ok?"

2) use this to enter .reg to registry:
ExecWait "REGEDIT.EXE /S file.REG"

3) I don't understand at all. When the install is complete nsis always says "Complete". If you want another 'complete' in the window, do this:
DetailPrint "Complete"


(the last sentence in every answer is the command you have to add in the .nsi file)


Would it not be better to convert the .reg files into an NSIS script. Since NSIS can work with the registry it should make the installer easier to manage and might even make it faster.

Vytautas


This new utility converts .reg files or registry keys to NSIS commands:

http://nsis.sourceforge.net/archive/...php?pageid=296


sure?

Originally posted by Vytautas
and might even make it faster.
Are you sure it can be faster? I am not a pragmatic programmer, but make nsis add one value to registry, and then another, and then another..., seems slower than adding a .reg file directly (which will add one value and then another...)

'.reg' files also have to enter values one by one, this is done by the regedit program. So the value entry speed should be about the same. NSIS however does not need to extract a file and open an external program so it should make it quicker. Although on most fast machines you will probably not notice a lot of difference. Well, that' the theory anyway;)

Vytautas


Indeed you shouldn't notice any difference. But NSIS should be faster because it doesn't read and parse a text file but its own format which is designed to run fast, doens't need too much error checking and simply has to read less.


Question i try the file thats converts reg file into nsis command.

Ok, i did Reg2Nsis doc.reg then it type out some text.

Now what do i do?


I suppose that text that typed out is the text you have to write inside a section in the .nsi file.

Doesn't that program come with instrucionts?


kichik and Vytautas: ok, you explanantions sound reasonable, so nsis can be faster ;)


Ok heres the script:

;Perform A Silent Install
SilentInstall silent
BrandingText " "

!include doc.reg

----------------------------------
Here's the error
----------------------------------
Processing script file: "C:\WINDOWS\Desktop\aa.nsi"
SilentInstall: silent
BrandingText: " "
!include: "doc.reg"
Invalid command: REGEDIT4
!include: error in script: "doc.reg" on line 1
Error in script "C:\WINDOWS\Desktop\aa.nsi" on line 5 -- aborting creation process

Can someone help me pls.


You're not supposed to include the .reg file, you're supposed to include the output of the program. And you're supposed to include it in a section as it contains insturctions.


Ok here is the file:

############################### reg2nsis begin #################################
# This NSIS-script is generated by the reg2nsis utility #
# Author : Artem Zankovich #
# URL : http://aarrtteemm.nm.ru #
# You can freely inserts it into your setup script as inline text or via #
# !include directive. Please don't remove this header. #
################################################################################

WriteRegBin HKEY_CURRENT_USER "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "NoDriveTypeAutoRun" 95000000

############################### reg2nsis end #################################

---------------------------------------------------------------
When i enter it in MakeNSIS-Complie and got an error:
---------------------------------------------------------------
Processing script file: "C:\WINDOWS\Desktop\Reg2Nsis002\test.nsi"
WriteRegBin: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun=95000000
Error: Can't add entry, no section or function is open!
Error in script "C:\WINDOWS\Desktop\Reg2Nsis002\test.nsi" on line 9 -- aborting creation process

HELP PLS


You're supposed to use !include "filename.nsh" inside the section/function you wish to write those registry entries. For example:

Section "Install stuff"
File bla.exe
File foo.txt
!include "RegEntries.nsh"
SectionEnd