aj kwak
8th March 2005 10:47 UTC
3problems...desktop/finsh/startmenu
Hello,
I have some question/problems :
1)In my installer i have a desktop-icon, but i want that the user can choose for a desktop icon or not.
2)After the installation (so after the MUI_PAGE_FINISH) i have make a messagebox with the option to reboot or not. But i want on the finish page the option reboot or reboot later.
I have set these defines (above !insertmacro MUI_PAGE_FINISH)
;!define MUI_FINISHPAGE_TEXT_REBOOT "U kunt momenteel... "
;!define MUI_FINISHPAGE_TEXT_REBOOTNOW "HETSTARTEN"
;!define MUI_FINISHPAGE_TEXT_REBOOTLATER "LATER HERSTARTEN"
but i doesn't work.
3)last problem. The user can choose another name for the name in the startmenu, but after the installation the default is used.
this is my code i made/used
Var STARTMENU_FOLDER
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateShortCut "$STARTMENU.lnk" "$ANOTHER_DIR\:mad: application:mad: \readme.txt"
CreateDirectory "$SMPROGRAMS\Application"
!insertmacro MUI_STARTMENU_WRITE_END
:mad: I know there is the fould, but i couldn't find to make it dynamic... :-(
Afrow UK
8th March 2005 14:18 UTC
1. Either use a Section to create the Shortcut, or add a check-box on finish page...
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Create desktop shortcut?"
!define MUI_FINISHPAGE_RUN_FUNCTION "createShortcut"
2. You're using the $STARTMENU variable in your CreateShortcut call, but it should be $STARTMENU_FOLDER.
3. I think you need to set the reboot flag to display the reboot message. Use SetRebootFlag true
-Stu
Joel
8th March 2005 14:19 UTC
1) How about making a special section, just for this.
2) Wow! Those are the string texts, not actually the instructions, read the docs about the instructions 4.9.11.1 Reboot
3) Ah! see here:
CreateShortCut "$STARTMENU.lnk" "$ANOTHER_DIR\ application \readme.txt"
CreateDirectory "$SMPROGRAMS\Application"
Did you use your Var
$STARTMENU_FOLDER
aj kwak
9th March 2005 14:41 UTC
if i do this :
Hello,
I wouldn't work to change the name in the start-menu with the installer...
this is my code en the way of thinking...
var STARTMENU_FOLDER
!insertmacro MUI_PAGE_STARTMENU Application
$STARTMENU_FOLDER
So, i think i must use ${STARTMENU_FOLDER} and then
${STARTMENU_FOLDER} comes brown(=variabele)
(on the net i find maney examples withoud {} with i user version 2.05)
but then i get this fould :
warning: unknown variable/constant "{STARTMENU_FOLDER}" detected, ignoring (macro:MUI_FUNCTION_STARTMENUPAGE:8)
Usage: StrCpy $(user_var: output) str [maxlen] [startoffset]
Error in macro MUI_FUNCTION_STARTMENUPAGE on macroline 12
Error in macro MUI_PAGE_STARTMENU on macroline 34
Error in script "D:\stage\deel1\installers\installer8\installer8.nsi" on line 107 -- aborting creation process
:confused: Someone???
Afrow UK
9th March 2005 15:37 UTC
No curley braces...
!define MyDefine "blah" => ${MyDefine}
Var MyVar => $MyVar
-Stu
Poulpos
10th March 2005 16:19 UTC
Hi !
Concerning the StartMenu Folder, I'm using this :
;Define ---------------
!define PRODUCT_NAME "Your Program"
!define PRODUCT_UNINST_ROOT_KEY HKCU
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
; Items from StartUp Menu ---------------
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${PRODUCT_NAME}"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
; Installer Pages ---------------
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
!insertmacro MUI_PAGE_INSTFILES
; MUI end of defines ---------------
InstallDirRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" ""
; Sections with Stuff to install ---------------
Section "Just name it" Blah
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Your Prog.lnk" "$INSTDIR\Your Prog.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\Uninstall ${PRODUCT_NAME}.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\Your Prog.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall ${PRODUCT_NAME}.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}" "$ICONS_GROUP"
SectionEnd
; Uninstaller Section ---------------
Section "un.Uninstall Your Prog" un.Blah
ReadRegStr $ICONS_GROUP ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}"
Delete "$INSTDIR\Your prog.exe
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall Your Prog.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP\"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}"
DeleteRegKey /ifempty ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_ROOT_REGKEY}"
SectionEnd
It gives the advantage to always work, and to use variables, so you just have to change the defines to have it work with any of your applications...
See you.
Poulpos
poulpos@caramail.com