- NSIS Discussion
- Suggestions for makensis.nsi
Archive: Suggestions for makensis.nsi
deguix
8th June 2003 11:32 UTC
Suggestions for makensis.nsi
1)
!define VER_MAJOR 2
!define VER_MINOR 0b4
...
!define VERSION "2.0b4 (CVS)"
Is not better to put this below, because when you change the version, only need to change in the VER_MAJOR and VER_MINOR defines:
!define VERSION "${VER_MAJOR}.${VER_MINOR} (CVS)"
2) Adding the effect, to show a custom text next to the progress bar when installing some type of files, or creating shortcuts... Example:
Section "NSIS Development System (required)" SecCore
SetDetailsPrint textonly
DetailPrint "Installing files..." ; (or "Installing NSIS Development System (required) files"
SetDetailsPrint listonly
SectionIn 1 2 3 RO
SetOutPath $INSTDIR
RMDir /r $SMPROGRAMS\NSIS
...
!ifndef NO_STARTMENUSHORTCUTS
IfFileExists $SMPROGRAMS\NSIS "" nofunshit
SetDetailsPrint textonly
DetailPrint "Creating shortcuts..."
SetDetailsPrint listonly
IfFileExists $INSTDIR\Examples 0 +2
CreateShortCut "$SMPROGRAMS\NSIS\NSIS Examples Directory.lnk" "$INSTDIR\Examples"
kichik
9th June 2003 00:27 UTC
If you have the code ready can you please submit a patch?
deguix
10th June 2003 09:52 UTC
I will submit wednesday or thursday, because the time give to me is little, thanks for the chance!
Joel
10th June 2003 18:53 UTC
Maybe it's me...
but with the current CVS, makensis.nsi
doesn't compile the VersionInfo.nsi...
Joost Verburg
10th June 2003 20:30 UTC
Lobo Lunar: fixed
deguix
12th June 2003 09:39 UTC
I have more suggestions:
For StartMenu.nsi:
If you create a shortcut folder like "$SMPROGRAMS\Company\Games\My Game\" using the StartMenu dll, you will work only on the My Game folder, and remove it, but the Company and the Games folder, will be not deleted after the uninstallation (if not exist shortcuts)?
This code in red is a solution for this:
...
RMDir "$SMPROGRAMS\${TEMP}" ;Only if empty, so it won't delete other shortcuts
StartMenuLoop:
Push ${TEMP}
Call un.GetParent
Pop ${TEMP}
StrCmp $R9 "" +3 0
RMDir "$SMPROGRAMS\${TEMP}"
Goto StartMenuLoop
!insertmacro MUI_STARTMENU_DELETE_END
...
(${TEMP}= a the var that you use for the Start Menu Folder)
It will remove the My Game, Games and the Company folders (if not exist any shortcuts), and any parent folder that exists, (except the SMPrograms)! But it requires the GetParent Function.
For MakeLangID.exe:
- Add these "SubLang"s to the program:
SubLang_Kashmiri
SubLang_Nepali
SubLang_Serbian
Because the "Lang"s don't have a "sublang" default compared to other languages that have the default. I.e.:
Lang_Spanish - have
SubLang_Spanish (that is the default sublang)
- Remove these "SubLang"s from the program:
SubLang_Korean
SubLang_Lithuanian
Because these languages don't have more than one sublang. I.e.:
Lang_Korean
SubLang_Korean (is the default one, don't have more sublangs)
For Everyone:
I made a list with all available languages to use with NSIS (based on MakeLangID.exe), that I attached here. It detects the real system language. If is the English from UK, Australia, US... Is Spanish from Argentina, Uruguay, Costa Rica, Spain... This is not dependent of Modern UI Language Files, so you can use it normaly with any UI.
Use $(LangName) to you use the result.
kichik
12th June 2003 16:19 UTC
The start menu code is a nice idea. I'll add it.
As for MakeLangID, the list is an exact copy of what Microsoft has defined in their .h files. I have not changed anything to maintain full compatibility.
virtlink
13th June 2003 11:57 UTC
Maybe a little bit offtopic, but:
What always bothers me, is the very long 'Creating shortcut' line.
Example (something like):
"Creating shortcut: C:\Documents and Settings\Daniel\Start Menu\Programs\NSIS\Shortcut.lnk"
It doesn't fit in the window, and it looks awfull. In Microsof programs, this is solved my removing the midsection of the url:
"Creating shortcut: C:\Documents and Settings\...\NSIS\Shortcut.lnk"
Sunjammer
13th June 2003 12:19 UTC
This MSDN page details how to create such ellipsis shortened text.
deguix
15th June 2003 16:38 UTC
For System.nsh (System Plugin):
; Is it DRIVE_FIXED?
System::Call '${sysGetDriveType} (i r1) .r3'
IntCmp $3 ${DRIVE_FIXED} 0 enumnext
The comment question says that this code will detect the drives that are fixed (Hard Disk), but it detects the fixed, remote, cdrom, or ram disk drives. So replacing the IntCmp by StrCmp will detect ONLY the hard disks, that is the objective here.
kichik
15th June 2003 18:25 UTC
Done, thanks.