Archive: need some help


need some help
hi all ,

I'm using nsis latest csv version(2.04b) and i have a few general problems.

1. In some of my installers i'm using ini file (that use the INSTALLOPTIONS plugin) , the first thing is : how can i verify the install dir ? now i know how to use the leave function on the custom page , and i've wrote function that can go over all the directories in the ini , but the verify is not complete .
first using MUI_PAGE_DIRECTORY (for example) verify the directory in a callback (what causes the 'next' button to be enabled on verify) , can i use a callback ?
second the i can't seem to be able to write somthing to verify 'blabla' for example as a folder , how can i do it ? where can i found the source code (i have the source but can't find the function) ?

b.t.w i think there is a bug with the original verify function , try using as a directory for the install a file without ext.

2. nice work with 2.04b about RTL , but what about the DirRequest RTL , i've been able to RTL them but only on xp :

strcpy $1 0
strcpy $4 0

StartAlign:
intop $1 $1 + 1
!insertmacro MUI_INSTALLOPTIONS_READ $2 "$R0" "Field $1" "Type"
strcmp $2 "" EndAlign
strcmp $2 "DirRequest" 0 StartAlign
intop $3 1200 + $1
intop $3 $3 - 1
intop $3 $3 + $4
GetDlgItem $2 $0 $3
strcmp $2 0 EndAlign
!insertmacro SetWindowAlignment $2 3 ; aligns the control
intop $4 $4 + 1
goto StartAlign
EndAlign:

Any ideas ?

b.t.w , i have a similer problem using kernel32::CreateMutexA - don't work on xp .

3. writing to ini file (using WriteINIStr) fails if the ini is on the network , is it a bug ?


thx ,
sharon oknin


Are you sure that you are using the Mutex Function correctly cos I used it in several of my installers and it works fine in ALL versions of windows including XP. Check out my archive page for an example.

Vytautas :D


  1. You can not disable or enable the next button on custom pages dynamically, yet. The best solution would be using multiple directory pages, at least in your case.
    b.t.w i think there is a bug with the original verify function , try using as a directory for the install a file without ext.
    Please provide an example script. I do not understand what you mean.
  2. You don't need that script in the latest CVS version. All you need is RTL=1 in Settings in the INI. The MUI adds that automatically if you extract the INI using its macros.
  3. Writing to INI files on network drives work fine for me. Please provide more details.

Hi ,

thx for your reaplays .
first , my bad on the Mutex function , works fine .

1. ok , can you direct me to the location of the verify function in the source code ?

"Please provide an example script. I do not understand what you mean."
Here is an example , lets say you want to install to c:\sharon and on c:\ you got a file name sharon(with no extansion!) , the installer will let you install , but it can't be done , i used :
strcpy $1 "Good"
IfFileExists "$0\*.*" Good 0
IfFileExists "$0" 0 Good
strcpy $1 "Bad"
Good:
to correct this .
2. That's true for all controls but not for DirRequest , the text in the DirRequest aligns to the left , it should be to the right (i think).

3. I'm using Novell network , here an example :
clearerrors
WriteINIStr "$INSTDIR\network.ini" "install" "Instver" "123"
* the error flag is set and it did'nt write to the ini
for now i'm using writing to $TEMP and copying the ini to the net .

sharon oknin


2. Directories are still English. Does Windows align them to the right?


  1. OK, I see what you mean now. Will be fixed, thanks.
    The code is in Source\exehead\Ui.c line 807 in the latest CVS version.
  2. According to MSDN, the only system it's not supposed to work in is Windows 95/NT4.0. Even then, as Joost said, paths are still English so it should be left anyway.
  3. Must be a Novell issue then, it works fine for me. All NSIS does it call Windows' WritePrivateProfileString. MSDN says nothing about problems with network writing, so it must be something about Novell.

Hi Joost Verburg ,
Thx for replaying , Yep , windows align them to the right .
It can happen only if you make a custom page with a DirRequest(in the MUI the align is correct) and using RTL . all other controls are O.K . it's looks like all the controls change directions , but DirRequest should stay aligned to the left .


Can you post a screenshot of Windows aligning paths?


Latest CVS version will not let you choose a file as an installation directory. There is no compiled version yet.


kichik , thx for the fix , is it possible to create a callback .onVerifyInstDir for ini files ?
if not how about :

Function VerifyIniDirs

Exch $R0
push $0
push $1
push $2
push $3


strcpy $0 0
strcpy $3 "Pass"

StartTesting:
intop $0 $0 + 1
!insertmacro MUI_INSTALLOPTIONS_READ $1 "$R0" "Field $0" "Type"
strcmp $1 "" EndTesting 0
strcmp $1 "DirRequest" 0 StartTesting
!insertmacro MUI_INSTALLOPTIONS_READ $1 "$R0" "Field $0" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $2 "$R0" "Field $0" "ValidateText"
push $1
push $2
call VerifyDir
pop $3
strcmp $3 "Fail" EndTesting StartTesting
EndTesting:

strcpy $R0 $3

pop $3
pop $2
pop $1
pop $0
Exch $R0

FunctionEnd


Joost Verburg , i'll post a screen next replay showing the aligment

sharon oknin


alignment
attached file contains requested aligment information

sharon oknin


You can't create .onVerifyInstDir for an InstsallOptions page. The best you can do is show a message box in the leave function and call Abort to force the user to stay on the current page.

As for the alignment, I have tested it on XP and both DirRequest and the built-in directory selection page show on the right, as should. Are you sure you are using the latest CVS version? Try RC1.

BTW, you can use two directory pages instead of adding another custom InstallOptions page. In that page you can use .onVerifyInstDir.