Old 8th March 2003, 18:27   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Wierd

Something has just started to my sections. The first section is never selected, even though I have told it to...

.onInit
code:

StrCpy $R1 ${secBSPnew} ; Gotta remember which section we are at now...
SectionGetFlags ${SecBSPreq} $R0
IntOp $R0 $R0 | ${SF_SELECTED}
SectionSetFlags ${SecBSPreq} $R0

SectionGetFlags ${SecBSPnew} $R0
IntOp $R0 $R0 | ${SF_SELECTED}
SectionSetFlags ${SecBSPnew} $R0

SectionGetFlags ${SecBSPold} $R0
IntOp $R0 $R0 & ${SECTION_OFF}
SectionSetFlags ${SecBSPold} $R0

StrCpy $3 ${secVISfull} ; Gotta remember which section we are at now...
SectionGetFlags ${SecVISreq} $2
IntOp $2 $2 | ${SF_SELECTED}
SectionSetFlags ${SecVISreq} $2

SectionGetFlags ${SecVISfull} $2
IntOp $2 $2 | ${SF_SELECTED}
SectionSetFlags ${SecVISfull} $2

SectionGetFlags ${SecVISfast} $2
IntOp $2 $2 & ${SECTION_OFF}
SectionSetFlags ${SecVISfast} $2

StrCpy $5 ${secRADextra} ; Gotta remember which section we are at now...
SectionGetFlags ${SecRADreq} $4
IntOp $4 $4 | ${SF_SELECTED}
SectionSetFlags ${SecRADreq} $4

SectionGetFlags ${SecRADextra} $4
IntOp $4 $4 | ${SF_SELECTED}
SectionSetFlags ${SecRADextra} $4

SectionGetFlags ${SecRADnormal} $4
IntOp $4 $4 | ${SF_SELECTED}
SectionSetFlags ${SecRADnormal} $4

SectionGetFlags ${SecRADfast} $4
IntOp $4 $4 & ${SECTION_OFF}
SectionSetFlags ${SecRADfast} $4



.onSecChange
code:

StrCpy $1 ${SF_SELECTED}
SectionGetFlags ${secVISreq} $0
IntOp $1 $1 & $0
SectionGetFlags ${secVISfull} $0
IntOp $1 $1 & $0
SectionGetFlags ${secVISfast} $0
IntOp $1 $1 & $0
StrCmp $1 0 skip2
SectionSetFlags ${secVISreq} 0
SectionSetFlags ${secVISfull} 0
SectionSetFlags ${secVISfast} 0
skip2:

StrCpy $1 ${SF_SELECTED}
SectionGetFlags ${secRADreq} $0
IntOp $1 $1 & $0
SectionGetFlags ${secRADextra} $0
IntOp $1 $1 & $0
SectionGetFlags ${secRADnormal} $0
IntOp $1 $1 & $0
SectionGetFlags ${secRADfast} $0
IntOp $1 $1 & $0
StrCmp $1 0 skip3
SectionSetFlags ${secRADreq} 0
SectionSetFlags ${secRADextra} 0
SectionSetFlags ${secRADnormal} 0
SectionSetFlags ${secRADfast} 0
skip3:

; Turn off old selected section
SectionGetFlags $R1 $R0
IntOp $R0 $R0 & ${SECTION_OFF}
SectionSetFlags $R1 $R0

SectionGetFlags ${SecBSPnew} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} 0 +2 +2
StrCpy $R1 ${SecBSPnew}

SectionGetFlags ${SecBSPold} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} 0 +2 +2
StrCpy $R1 ${SecBSPold}

StrCmp $R1 $R1 0 +2 ; selection hasn't changed
SectionGetFlags $R1 $R0
IntOp $R0 $R0 | ${SF_SELECTED}
SectionSetFlags $R1 $R0


; Turn off old selected section
SectionGetFlags $2 $3
IntOp $3 $3 & ${SECTION_OFF}
SectionSetFlags $2 $3

SectionGetFlags ${SecVISreq} $3
IntOp $3 $3 & ${SF_SELECTED}
IntCmp $3 ${SF_SELECTED} 0 +2 +2
StrCpy $2 ${SecVISreq}

SectionGetFlags ${SecVISfull} $3
IntOp $3 $3 & ${SF_SELECTED}
IntCmp $3 ${SF_SELECTED} 0 +2 +2
StrCpy $2 ${SecVISfull}

SectionGetFlags ${SecVISfast} $3
IntOp $3 $3 & ${SF_SELECTED}
IntCmp $3 ${SF_SELECTED} 0 +2 +2
StrCpy $2 ${SecVISfast}

StrCmp $2 $2 0 +2 ; selection hasn't changed
SectionGetFlags $2 $3
IntOp $3 $3 | ${SF_SELECTED}
SectionSetFlags $2 $3


; Turn off old selected section
SectionGetFlags $4 $5
IntOp $5 $5 & ${SECTION_OFF}
SectionSetFlags $4 $5

SectionGetFlags ${SecRADreq} $5
IntOp $5 $5 & ${SF_SELECTED}
IntCmp $5 ${SF_SELECTED} 0 +2 +2
StrCpy $4 ${SecRADreq}

SectionGetFlags ${SecRADextra} $5
IntOp $5 $5 & ${SF_SELECTED}
IntCmp $5 ${SF_SELECTED} 0 +2 +2
StrCpy $4 ${SecRADextra}

SectionGetFlags ${SecRADnormal} $5
IntOp $5 $5 & ${SF_SELECTED}
IntCmp $5 ${SF_SELECTED} 0 +2 +2
StrCpy $4 ${SecRADnormal}

SectionGetFlags ${SecRADfast} $5
IntOp $5 $5 & ${SF_SELECTED}
IntCmp $5 ${SF_SELECTED} 0 +2 +2
StrCpy $4 ${SecRADfast}

StrCmp $4 $4 0 +2 ; selection hasn't changed
SectionGetFlags $4 $5
IntOp $5 $5 | ${SF_SELECTED}
SectionSetFlags $4 $5



The SecBSPnew should start selected but never does. I then have to click on it twice to select it.
It just started happening, and I have no idea why.

I just had 2 sections above it that I removed, but they were nothing to do with it.

-Stuart
Afrow UK is offline   Reply With Quote
Old 8th March 2003, 18:50   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
did you include:

code:

!Include "Sections.nsh"



At the top of your script?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 8th March 2003, 18:55   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Also, is it possible to rename directories

I'd like to rename $7\textures to $7\texturesx


-Stuart
Afrow UK is offline   Reply With Quote
Old 8th March 2003, 18:58   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Quote:
Originally posted by dark_boy
did you include:

code:

!Include "Sections.nsh"



At the top of your script?
I don't have NSIS 2.0b3 yet.
That just has the different section defines
I've got them in my script instead...

!define SF_SELECTED 1
!define SF_RO 16
!define TEMP_SET 16+1
!define SECTION_OFF 0xFFFFFFFE

It wouldn't make any difference anyway.

-Stuart
Afrow UK is offline   Reply With Quote
Old 8th March 2003, 19:25   #5
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
Quote:
Originally posted by Afrow UK
Also, is it possible to rename directories

I'd like to rename $7\textures to $7\texturesx
Here is the answer:

[/quote]Quote from documentation

3.8.1.6 Rename

Rename source_file to dest_file. Functions just like the Win32 API MoveFile, which means you can move a file from anywhere on the system to anywhere else, and you can move a directory to somewhere else on the same drive. If /REBOOTOK is specified, and the file cannot be overwritten, then the file is moved when the system reboots -- if the file will be moved on a reboot, the reboot flag will be set. The error flag is set if the file cannot be renamed (and /REBOOTOK is not used) or if the source file does not exist.

Example:
PHP Code:
;Here, $7 is "C:\\Path\\"

Rename "$7\\textures" "$7\\texturesx" 

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 8th March 2003, 19:59   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ok thanks, I used that but it never seemed to work.

Anyhow...
Here is a small script to change the font of the Log Window Text, but it doesn't seem to work...

code:

!include "${NSISDIR}\Include\WinMessages.nsh"

Function .onGUIInit
FindWindow $1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $HWNDPARENT 1016
CreateFont $2 "Fixedsys" "8" "700"
SendMessage $1 ${WM_SETFONT} $2 0
FunctionEnd


What have a done wrong?

-Stuart
Afrow UK is offline   Reply With Quote
Old 8th March 2003, 20:26   #7
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Hey! I fixed it:

code:

!include "MUI.nsh"
!include "WinMessages.nsh"
!define MUI_WELCOMEPAGE
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_CUSTOMFUNCTION_INSTFILES_SHOW "LogFont"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE

Function "LogFont"
FindWindow $1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $1 1016
CreateFont $2 "Comic Sans Ms" "8" "700"
SendMessage $1 ${WM_SETFONT} $2 0
FunctionEnd




I'm using the modern UI...
If not, use

code:

Page instfiles "" "LogFont" ""



helps?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 8th March 2003, 20:31   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Thanx dude

I'll put it up on the Archive (written by you of course )

-Stuart
Afrow UK is offline   Reply With Quote
Old 8th March 2003, 20:35   #9
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
I'm going to write the code for the uninstaller log window, too.
Shouldn't be a problem (I hope )


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 8th March 2003, 20:42   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I still can't get the Components problem fixed...

Just doesn't make sense why it isn't working.


-Stuart
Afrow UK is offline   Reply With Quote
Old 8th March 2003, 20:50   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Since I removed 2 old sections before it started playing up, I added 2 fake ones back:

code:

Section -2
SectionEnd

Section -1
SectionEnd



It has fixed it completely.

Very strange!


-Stuart
Afrow UK is offline   Reply With Quote
Old 8th March 2003, 21:21   #12
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
About the LogFont in the uninstaller, done

code:

Function "un.LogFont"
FindWindow $3 "#32770" "" $HWNDPARENT
GetDlgItem $3 $3 1016
CreateFont $4 "Comic Sans Ms" "8" "700"
SendMessage $3 ${WM_SETFONT} $4 0
FunctionEnd

Section "Uninstall"
Call un.LogFont
...
SectionEnd



yupi


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 8th March 2003, 23:00   #13
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
I discovered a bug in System.nsh (in folder Modern UI):

These !defines aren't working:

!define MUI_UNCUSTOMFUNCTION_INSTFILES_PRE
!define MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW
!define MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE

The "{MUI_UNCUSTOMFUNCTION_INSTFILES_PRE}", "{MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW}" and "{MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE}" are laking a $ before these, here is the code that have this bug (quote from System.nsh):

PHP Code:
!macro MUI_UNFUNCTION_INSTFILESPAGE PRE SHOW LEAVE

  
!ifndef MUI_NOVERBOSE
    
!ifndef MUI_MANUALVERBOSE
      
!verbose 3
    
!endif
  !endif

  Function ${
PRE}
    !
insertmacro MUI_HEADER_TEXT $(un.MUI_UNTEXT_UNINSTALLING_TITLE) $(un.MUI_UNTEXT_UNINSTALLING_SUBTITLE)
    !
ifdef MUI_UNCUSTOMFUNCTION_INSTFILES_PRE
      Call 
"[b]{MUI_UNCUSTOMFUNCTION_INSTFILES_PRE}[/b]"
    
!endif
  
FunctionEnd

  
Function "${SHOW}"
    
!ifdef MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW
      Call 
"[b]{MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW}[/b]"
    
!endif
  
FunctionEnd
  
  
Function "${LEAVE}"
    
!ifdef MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE
      Call 
"[b]{MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE}[/b]"
    
!endif
  
FunctionEnd
  
  
!ifndef MUI_NOVERBOSE
    
!ifndef MUI_MANUALVERBOSE
      
!verbose 4
    
!endif
  !endif
  
!
macroend 
This is the code to fix that:

PHP Code:
!macro MUI_UNFUNCTION_INSTFILESPAGE PRE SHOW LEAVE

  
!ifndef MUI_NOVERBOSE
    
!ifndef MUI_MANUALVERBOSE
      
!verbose 3
    
!endif
  !endif

  Function ${
PRE}
    !
insertmacro MUI_HEADER_TEXT $(un.MUI_UNTEXT_UNINSTALLING_TITLE) $(un.MUI_UNTEXT_UNINSTALLING_SUBTITLE)
    !
ifdef MUI_UNCUSTOMFUNCTION_INSTFILES_PRE
      Call 
"${MUI_UNCUSTOMFUNCTION_INSTFILES_PRE}"
    
!endif
  
FunctionEnd

  
Function "${SHOW}"
    
!ifdef MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW
      Call 
"${MUI_UNCUSTOMFUNCTION_INSTFILES_SHOW}"
    
!endif
  
FunctionEnd
  
  
Function "${LEAVE}"
    
!ifdef MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE
      Call 
"${MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE}"
    
!endif
  
FunctionEnd
  
  
!ifndef MUI_NOVERBOSE
    
!ifndef MUI_MANUALVERBOSE
      
!verbose 4
    
!endif
  !endif
  
!
macroend 

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 8th March 2003, 23:34   #14
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Thanks. Fixed
Joost Verburg is offline   Reply With Quote
Old 9th March 2003, 00:52   #15
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
no wonder...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 9th March 2003, 16:08   #16
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Afrow and deguix, please attach huge scripts or edit them to show only the relative contents. It's impossible to read forum threads when they are filled with dozens of lines of code.

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
Reply
Go Back   Winamp & Shoutcast 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