Archive: start menu alignment


start menu alignment
Hi,
I'm using the Modern UI Language files everything looks align in the right way (RTL) except for the alignment to right text in hebrew in the start menu, when I'm using mixed text (hebrew and english) it's show's in the wrong order (not align to the right), is there a way to fix that?


It works just fine for me. What OS are you using? Can you attach an example script?


the script is:
strcpy $TM_UNINSTALLER_LINK "úåñó outlook ùì çáøä"
!insertmacro MUI_STARTMENU_WRITE_BEGIN "Application"
SetShellVarContext All
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\$TM_UNINSTALLER_LINK.lnk" "$INSTDIR\uninst-tmOutlookPlugin.exe"
SetShellVarContext Current
!insertmacro MUI_STARTMENU_WRITE_END


but when I open the start menu (after installation) it's not aligned, I'm using winXP (english)


Ah, the start menu... I thought you were talking about the start menu page in the installer itself.

You can insert an RLE (Right-to-Left Embedding) sign at the beginning of the name. However, NSIS doesn't support Unicode natively, so the System plug-in would have to be used. Attached is an example that creates a shortcut with the RLE mark.


can you please explain to me what each line of the "System::Call" do?
I'm trying to merge it to my code, but I don't seem to get the desire result.

Thanks,
Tali


I've added some comments to the example. Basically, the example creates a temporary shortcut and renames it to the desired name with the RLE mark. To rename, it creates a Unicode buffer, appends $SMPROGRAMS, the RLE mark and the desired shortcut name. It then passes this buffer to MoveFileW in order to rename the temporary shortcut to the desired name.


can you please tell me what's wrong with this script?
instead of CreateShortcut I wrote CreateDirectory
(because I need to align the startMenu folderName
!insertmacro MUI_PAGE_STARTMENU "Application" $STARTMENU_FOLDER)


Oish, what a stupid mistake. The RLE wasn't written when I added the comments because the comment of the line above ends with a backslash. That causes the line that appends the RLE to be appended to the line above and be considered as a comment. Simply remove the backslash from the end of the of line or add another character after it and it will work.

I really must do something about this extended comment... :(


HI,

first of all - Thanks for the quick answers...
I manage doing the shortcuts, but now I have a problem with the directory ubder the SMPROGRAMS...
I think I need to append the RLE to the $STARTMENU_FOLDER variable, because every time I'm adding a link under $SMPROGRAMS\$STARTMENU_FOLDER\ its not added to the RLE FolderName, so I'm having two folders under StartMenu - 1 - RLE (and empty) and the other is not RLE (with shortcuts).
this is exapmle of the shortcut created under the wrong folder:

CreateShortcut "$SMPROGRAMS\$STARTMENU_FOLDER\temp.lnk" "$INSTDIR\uninst-tmOutlookPlugin.exe"
System::Call "*(&w2048 '$SMPROGRAMS\$STARTMENU_FOLDER\') i .r0"
System::Call "kernel32::lstrcatW(i r0, *i 0x202b)"
System::Call "kernel32::lstrcatW(i r0, w '$TM_UNINSTALLER_LINK.lnk')"
System::Call "kernel32::DeleteFileW(i r0)"
System::Call "kernel32::MoveFileW(w '$SMPROGRAMS\$STARTMENU_FOLDER\temp.lnk', i r0)"
System::Free $0


You can't use the RLE mark in $STARTMENU_FOLDER because NSIS doesn't support Unicode. It'd be simpler to first create everything and then adding the RLE mark. Instead of creating temp.lnk, create the correct structure, including all the folders and the links, and only then add the RLE mark where needed.


after making the RLE link I have new problem:
when deleting the startMenu folder (uninstall section) there are leftovers of the link that was changed to be RLE, but all other links were remove.

this is the code (it worked before):
SetShellVarContext All
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $R0
RMDir /r "$SMPROGRAMS\$R0"
SetShellVarContext Current


The name is different now, it contains the RLE mark. You'd need to a similar method to delete the files. The code that I've posted deletes the link before it renames the temporary one. You can use the exact same code, removing just the MoveFileW call.


Thank you very much - it helped...
have happy holidays.