|
|
#1 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
Hi,
I have a question about the ReadRegStr code! section "ntf" ReadRegStr $0 HKLM "SOFTWARE\Lotusnotes\Domino\1" "DataPath" setOutPath $0 file /r NeoDashboard43_ntf\*.* sectionEnd This code works just fine, but i need to go down one more directory then the path in the directory specify. Like this, the path that i get from the Registry file is different depending on where the path is installed on the target computer, but lets say is something like: "....\Domino\Data" that path is from the ReadRegStr code. But i need to get one directory further down, "\Domino\Data\html", how can i get my installer to take the html directory in with that code? I hope you can understand my question.. -Aaskilde |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
setOutPath $0\html
is the answer to my problems
|
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
SetOutPath $0\html
? Edit: Ah you got it. Also you're not checking that value exists. If it doesn't you will end up extracting to C:\html. Stu |
|
|
|
|
|
#4 | |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
Quote:
Oh!, I have just been asked by my boss, if i can find a way to make a code that do like you said, checking if it is there, and if continue, if not pop up with a page where you can browse the path? -Aaskilde |
|
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
To do that you should add a MUI_PAGE_DIRECTORY and read the value in the page pre function (define MUI_PAGE_CUSTOMFUNCTION_PRE). If the value is valid then call Abort to skip the page:
Stucode: |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
Okay i am very new to this and i do not think that the manual is beginner friendly so i am sorry for all the questions!
I have made this code now: !define MUI_PAGE_CUSTOMFUNCTION_Html_PRE Function Html_Pre ClearErrors ReadRegStr $0 HKLM SOFTWARE\Lotusnotes\Domino\1 DataPath ${IfNot} ${Errors} ${AndIf} $0 != setOutPath $DESKTOP ${AndIf} ${FileExists} $0\html\*.* Abort ${EndIf} FunctionEnd Should this work? I get this error if i try run it; !define: "MUI_PAGE_CUSTOMFUNCTION_Html_PRE"="" Function: "Html_Pre" ClearErrors ReadRegStr $0 HKLM\SOFTWARE\Lotusnotes\Domino\1\DataPath Invalid command: ${IfNot} I think i get that if there is an error it's running the code i place here: ${AndIf} $0 != `` But if i need a browser to show up, so they can give that path themselves, is that something u might know? |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Are you using Modern UI?
Stu |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
Hey mate, thanks for the help!
I did not use the Modern UI, but have now rewritting my code and are using it now, and damn that is just a lot easier and much more stylish! I been looking at finding some way so slow down the installation, maybe some disc space check and sleeptimer, but i have not been able to find the code to the Modern UI, i do not now if there maybe is a site with more different codes then on the Modern UI page? Aaskilde |
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
OK now that you are using Modern UI 2 (MUI2.nsh yes?) then you can use my code with:
(Replace $0 with $DataPath in my code).code: Stu |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
Okay perfect i will give it try!
And yes i am using MUI2.nsh, and i must say its quit interesting to make installers, live the result you get
|
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
Var DataPath
!define MUI_PAGE_CUSTOMFUNCTION_PRE Directory_Pre !define MUI_DIRECTORYPAGE_VARIABLE $DataPath !insertmacro MUI_PAGE_DIRECTORY Function Directory_Pre ClearErrors ReadRegStr $0 HKLM "SOFTWARE\Lotusnotes\Domino\1" "DataPath" ${IfNot} ${Errors} ${AndIf} $0\domino\html != ${AndIf} ${FileExists} $0\domino\html Abort ${EndIf} FunctionEnd ______________________________________________________________________ Okay then this is my code now. But i don't think it work like it maybe should! The main thing is that at the $0\domino\html, the html dir can in some of my cases have been moved it happens rarely but i need an error, or if it is possible a way to extract that specific "html" folder on a browsed location, and only that folder(Its a installer for some of our users and they should be able to do it by themselves) ! But when i try and test it, and move the html dir so it is not in that path, it just creates the folder and move the files in there, i hope you can follow me! -Aaskilde |
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
As I said in my post you need to replace the 3 instances of $0 with $DataPath. $DataPath is what will be displayed on the directory page but you are reading into $0.
Stu |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
Function Directory_Pre
ClearErrors ReadRegStr $Datapath HKLM "SOFTWARE\Lotusnotes\Domino\1" "DataPath" ${IfNot} ${Errors} ${AndIf} $Datapath != '' ${AndIf} ${FileExists} $Datapath\domino\html\*.* Abort ${EndIf} FunctionEnd ___________________________ Likes this right? If i remove the html folder the .exe just creates the folder at the location from the registry, and that is what is should not do, i need an error or and browser were you can manually place the files. Is that possible? |
|
|
|
|
|
#14 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
The only thing wrong with that code is you probably want to add StrCpy $DataPath $DataPath\domino\html just before the Abort. You keep saying you need a 'browser' for manual directory selection which is exactly what the Directory page is for. Do you never see the directory page? Also make sure you use $DataPath in your install sections. If you're reading from the registry key again on install then that is defeating the purpose of having $DataPath store the result of the directory page.
Stu |
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
I know that i can get a directory page to show, but the main thing with this installer is that the users i am creating this installer to, are in hopefully all cases having the directories in the path i am getting from the registry, but it is possible to move the "html" dir, as said before in that case i need the html dir to be manually installed, but i have talked with some from my work and they say that it is most rarely and some have never seen it being moved, so that is not a priority anymore.
Now my boss has asked if it is possible to get a page that shows the directory in which the installer gets from the registry, in this case C:\Lotus\Domino\Data for example. I have tried to add the directory page, and get the ReadRegStr $0 HKLM "SOFTWARE\Lotus\Domino\1" "DataPath" - to be shown and grayed out in best case so they cant change it, and i need it to be the path from the directory because it can be placed on different drives depending on the user, but i can't get it to work. Then i tough a customized page, but that seems pretty difficult to make, .ini file, and so on. I don't know if you got something that could help me here. I am really great full for all the help i have gotten from you at this point! -Aaskilde |
|
|
|
|
|
#16 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
|
|
|
|
|
|
#17 |
|
Junior Member
Join Date: Jan 2011
Posts: 35
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|