Archive: exclude?


exclude?
Can serve anybody on exclusion of process paint.exe? Best if it discovered him instalator, but when it is including it ask if it wants to exclude?

Equipment and it thanks from mountain ;)


What do you want to exclude paint.exe from?

If you want to give the user an option to not install paint.exe, you can put paint.exe in a section and add the components page. You can also create a custom page using InstallOptions. See Contrib\InstallOptions and Examples\Modern UI for examples.


There was example paint.exe. I want to exclude given program during installation, that install additions for it.


There is no such example include with NSIS. Which example are you talking about? What do you mean by excluding a program during installation? Isn't the solution offered in my previous post what you were looking for?


When I want to install it not give for given program additions sometimes, as given program is included and it is possible to change nothing. It walks about it me, in order to it discovered instalator if program is included, but when there is ask if exclude him. It needs for this exemplary script employ on paint.exe.


I am sorry, I can't understand what you're trying to say. I still think what you're looking for is a section. If it's not what you need, post some code examples explaining what you want.


Anybody has installed given program. It pulls off him new version and it wants to install. But that (in order to) install it must exclude this program correctly, but I want , that (in order to) it asked about exclusion(switch off) this program NSIS and it was possible to exclude (to switch off) it program by NSIS. It needs for this script. It thanks from mountain.


OK, I still understand you want to let the user an option to not extract a certain program. The suggestions in the first reply are what you need. Take a look at the mentioned examples.


Could serve you but? I searched on this theme a lot and unfortunately, I have found nothing (.


You don't need to search the forums, there are examples in Contrib\InstallOptions and Examples\Modern UI\InstallOptions.nsi.


There I has not found example on exclusion of (switching off of) given program during installation NSIS.


Each of the InstallOptions examples show how to perform a certain action according to the selection the user made in the custom page. Simply change that action to the extraction of your program.

If you go with the section option, there is nothing more to do. The section will not be executed if the user doesn't select it.


I do not know english on so many well. Please, about exemplary script very :(.


For an InstsallOptions example, make a copy of Examples\Modern UI\InstallOptions.nsi and change line 84 to:

File paint.exe
For a secon example, open Examples\example2.nsi and add the same code at line 65.

For an InstsallOptions example, make a copy of Examples\Modern UI\InstallOptions.nsi and change line 84 to:
in 83-85 line have:
StrCmp $INI_VALUE "1" "" +2
MessageBox MB_OK "You checked the check box, here is the MessageBox..."

SectionEnd
Examples\example2.nsi
line 62-66 have:
CreateDirectory "$SMPROGRAMS\Example2"
CreateShortCut "$SMPROGRAMS\Example2\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\Example2\Example2 (MakeNSISW).lnk" "$INSTDIR\makensisw.exe" "" "$INSTDIR\makensisw.exe" 0

SectionEnd
I want to check if previous instance of application is active (in memory) and if it is active,
then I want to popup a message : "Installer will now close older version of this application". After
that, I want to shutdown older version automatically.

Ah, so you want to close the old program, not to exclude from extracting it... That depends on your application. If it has a window, you can find that window using FindWindow and close it using a message such as WM_CLOSE. If it doesn't have a window, or won't respond to WM_CLOSE, then you'd have to figure out on your own how to close it. If you know how to close it, but don't know how to do it with a NSIS script, post the details and I'll help you to convert the method into a NSIS script.

Some examples for using WM_CLOSE are:

http://nsis.sourceforge.net/archive/....php?pageid=86
http://nsis.sourceforge.net/archive/...php?pageid=462
http://nsis.sourceforge.net/archive/...php?pageid=455
http://nsis.sourceforge.net/archive/...php?pageid=322

There are also some plug-ins that allow you to terminate process by name, but that's not a good idea. To quote MSDN:

Use it only in extreme circumstances.

So, it walks about it me :). Only how employ for now for example, paint.exe?


As I said, it depends on the application you're trying to quit. If sending it a WM_CLOSE doesn't work, provide more details about this "paint.exe" and then I might be able to help.


Is not possible it to establish program walk from mountain about what or ? But that is wanted it, make in order to? Give what?


It's possible to find a process using on of the following:

http://nsis.sourceforge.net/archive/...php?pageid=483
http://nsis.sourceforge.net/archive/...php?pageid=542

The second one even allows you to kill a process. But as I've said in the previous reply, it's not a good idea.


It thanks very. At last we have been apprehended :). It will try :).


I tested (try) different manners and it does not leave (does not go out) me. Could serve you on paint.exe? If program would be including it with question message (knowledge) wyskakiwa³aby if (or) I want to exclude (to switch off). If it ask program give OK exclude (switch off). I ask very :).


If necessary as make, found it for given folder in order to < self-service store > NSIS? For example, anybody < somebody > has in (to) C:\Program Files\PROGRAM, but in (to) other < somebody > D:\Program Files\PROGRAM either (or) C:\Program Files\xxx\PROGRAM?
Should search out path for < self-service store > *\*\PROGRAM NSIS. It thanks from mountain (top) ).


oh...so what u mean is like some people have their program files in C:\ and others have it in D:\...if u want to locate the users program files use the $PROGRAMFILES variable. At least I think thats what is is...

Arfy


But so, I have forgotten about it, but make mum (beguile, have) so P. But as for example, there is in (to) C:\PROGRAM is necessary it to inscribe it in (to) what either (or) D:\PROGRAM?

Please, about answer on question with this exclusion of (switching off of) process too ;).


As increase place where go components to hold-down? Best when it place give widen, or change width (latitude) :).


How change in (to) instalatorze? For example, it at greeting. Some is in file * .nlf, but not all.


To kill paint.exe with this one, use:

Processes::FindProcess "paint"
Pop $R0

StrCmp $R0 "0" skip

MessageBox MB_YESNO "paint.exe is still running, kill?" IDNO skip

Processes::KillProcess "paint"
Pop $R0

skip:
To get more space for the components in a MUI components page with description, use MUI_COMPONENTSPAGE_SMALLDESC. See the MUI readme for more information about this define.

To find out how to change MUI strings, take a look under Page Settings in the MUI readme.html (Contrib\Modern UI\Readme.html).

I couldn't understand what you need with C:\Program Files and D:\Program Files. $PROGRAMFILES will contain the right folder. If the user changed his program files folder to D:\Program Files, that's what $PROGRAMFILES will contain.

Unfortunately, it are not wanted to compile. Probably, I will not make it, because I do not know (do not be able) :P.

You could serve example on it me how increase with choice of (election of) component on this example? Either (or) how give on bottom?

; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "aaa"
!define PRODUCT_VERSION "1.0"
!define PRODUCT_PUBLISHER "a"
!define PRODUCT_WEB_SITE "http://www.aaa"

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "ins\test.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

; Language files
!insertmacro MUI_LANGUAGE "English"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Setup.exe"
InstallDir "$PROGRAMFILES\test"
ShowInstDetails show

Section "GrupaGlowna" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "ins\test"
SectionEnd

Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
SectionEnd

Section -Post
SectionEnd

; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "test"
!insertmacro MUI_FUNCTION_DESCRIPTION_END

As change these texts, is checked off (noted) what on redly?
http://img203.exs.cx/my.php?loc=img203&image=a7rm.png
http://img207.exs.cx/my.php?loc=img207&image=as7yp.png
http://img220.exs.cx/my.php?loc=img220&image=ds2zr.png
?

Quote:

I couldn't understand what you need with C:\Program Files and D:\Program Files. $PROGRAMFILES will contain the right folder. If the user changed his program files folder to D:\Program Files, that's what $PROGRAMFILES will contain. But how will be there make in (to) mums C:\PROGRAM?


But how give at start logo instalator?

I can't help you solve the error unless I know what it is. What error does the compiler give you?

You can change all of the texts in the images. The Modern UI readme contains all the information you need for this.

If by start logo you mean a splash screen, take a look at Contrib\Splash and Contrib\AdvSplash. If you mean the image on the left in the welcome and finish page, take a look at the MUI readme, it tells you how to do that.

But how will be there make in (to) mums C:\PROGRAM?
What's mums?

1.

Invalid command: Processes::FindProcess
Error in script "C:\Documents and Settings\xxx\wtykpak.nsi" on line 35 -- aborting creation process
2. Something from it try (taste) extract, but damage, that you do not want to give example :P.
3. Ok, due to :). Then it will try.
4. Never it isn't known where anybody has installed given program :P.

  1. You probably forgot to copy Processes.dll into the Plugins directory.
  2. It's all in the MUI readme.
  3. Finding out where a program is installed depends on your program. If your program writes the installation directory to the registry, read it from there. If it writes into some INI in the Windows directory, read it from there. If it doesn't write anything, give the user an option to locate it using the directory page.

1. That and where copy mums?
2. I do not know english on so many well :(. Anybody could say me as change it:
a) http://img203.exs.cx/my.php?loc=img203&image=a7rm.png
b) http://img207.exs.cx/my.php?loc=img207&image=as7yp.png
c) http://img220.exs.cx/my.php?loc=img220&image=ds2zr.png
d) http://img232.exs.cx/img232/1526/a5tj.png

Very please :).

3. Sound does not act at me it :(. And this original and personal.

4. OK.

Please, about assistance very :).


  1. I still don't understand what mums is. Simply put the DLL in the Plugins directory. For example: C:\Program Files\NSIS\Plugins
  2. Sorry, not me.
  3. Post a code example showing the problem.

1. Now have:

Error: Can't add entry, no section or function is open!
Error in script "C:\Documents and Settings\AMD 64 3400\Pulpit\ins\Wtyczki\wtykpak.nsi" on line 45 -- aborting creation process
2. Ok, but I would ask other somebody it :).
3. Sound does not act in this example:
Name "Splash.dll test"

OutFile "Splash Test.exe"

XPStyle on

Function .onInit
# the plugins dir is automatically deleted when the installer exits
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Makensisw\logo.bmp"
#optional
#File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav"

splash::show 1000 $PLUGINSDIR\splash

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normal, and '-1' if some error occured.
FunctionEnd

Section
SectionEnd
Certainly it serves paths good.

  1. You must put that code in a section or a function. You can't execute anything out of a section or a function.
  2. You didn't remove the comment from the extracting of the wave file. Remove the comments and put a valid path and it should work.