Archive: ExecShell does not run!


ExecShell does not run!
I want to redistribute environment to run my application. When I use ExecShell, it does not execute.I do not know why,somebody can help me!
My code here:

SetOutPath "$INSTDIR"
SetOverwrite ifnewer
Fle "e:\client\install\vcredist_x86.exe"
ExecShell '"$INSTDIR\vcredist_x86.exe"' 'SW_HIDE'

Thank you,


I think I forgot something and I also add some option

SetOutPath "$INSTDIR"
SetOverwrite ifnewer
Fle "e:\client\install\vcredist_x86.exe"
ExecShell "open" '"$INSTDIR\vcredist_x86.exe"' SW_HIDE

It runs but display an error:
"Command line operation syntax error.Type command /?for help"
But I make right ExecShell in help file, I may make some mistakes in some places.
Can you help me!


ExecShell "open" '"$INSTDIR\vcredist_x86.exe"' '' SW_HIDE

If you want to specify the "showmode" you have to pass [parameters] as well (here: empty list). see
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.3


Thank niteflyer a lot,
I do it the same way you help but It can not run vcredist_x86.exe, only announce an error the same below.I do not know why. Can you tell me another way ?
My code here:
Function .onInit
; check for .NET
!insertmacro MUI_LANGDLL_DISPLAY
Call IsDotNETInstalled
Pop $R3
StrCmp $R3 0 not_found found
found:
goto end
not_found:
MessageBox MB_OKCANCEL "We need to create an environment to run this program" IDOK installNET IDCANCEL 0
installNET:
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "e:\client\install\vcredist_x86.exe"
ExecShell "open" '"$INSTDIR\vcredist_x86.exe"' '' SW_HIDE

end:
FunctionEnd

Please help me!!!!


I am not familiar with vcredist. Does it require parameters ? I have no idea, why my suggestion does not work.
Did you try
ExecShell "open" '"$INSTDIR\vcredist_x86.exe"'
just to figure out if the SW-parameter is the baddie?

And I dont remember if ExecShell waits for completion of vcredist; I guess you want to wait, if you are doing this onInit ?


or try
ExecShell "open" "$INSTDIR\vcredist_x86.exe" "" SW_HIDE


Thank niteflyer,
Now, It run well but I want to SW_HIDE it when I run it. Because users do not know about "redistribute" of Visual Studio 2005. Consequently, I want it run on SW_HIDE. I must use ExecShell to hide it.
Your command can run it but it does not hide the screen redistribute VC++.
ExecShell "open" "$INSTDIR\vcredist_x86.exe" "" SW_HIDE
Can you help me please!!!


Could it be that vcredist unhides itself or spawns another (visible) process ? If so, you should use FindWindow and SendMessage to hide the new window when it gets visible; not nice but I have no more ideas.


Thank you niteflyer for your idea,


Can u help me?
Hi!
Can anybody help me how to integrate VCRedist.exe into my Application setup.
How to integrate it?


Hi ranahimal,

ranahimal said:
Can u help me?
Hi!
Can anybody help me how to integrate VCRedist.exe into my Application setup.
How to integrate it?
I do not understand clearly what you want to say? Can you tell specific your opinion?
At that time, I hope I can help you!
Have a nice day!

If you run VCRedist_x86.exe with a "/?" switch, you'll see the parameter for silent mode is "/Q".

So, instead of using ExecShell, you should be using just Exec like this:


Exec '"$INSTDIR\VCRedist_x86.exe" /Q'


edit:
I changed references of VCRedist.exe to VCRedist_x86.exe to match the original post.

I think that should be ExecWait instead of Exec.

I created a small installer yesterday just to check this out. What I've used is


!include "LogicLib.nsh"
!define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall"
!define APP_KEY "{A49F249F-0C91-497F-86DF-B2585E8E76B7}"
Section -VCRedistributable
ReadRegStr $R0 HKLM "${UNINSTALL_KEY}\${APP_KEY}\" "DisplayName"
${If} ${Errors}
# reg value doesn't exist (ie, needs installed)
InitPluginsDir
SetOutPath "$PLUGINSDIR"
File "WindowsInstaller-KB893803-v2-x86.exe"
File "VCRedist_x86.exe"
ExecWait '"$PLUGINSDIR\WindowsInstaller-KB893803-v2-x86.exe" /quiet /norestart'
ExecWait '"$PLUGINSDIR\VCRedist_x86.exe" /Q'
${EndIf}
SectionEnd

Here's the script you need to do the VC Redist silent install properly:
http://blogs.msdn.com/astebner/archi...-packages.aspx


Lol, what happened to my URL? Anyway, here's the text from that page:

Update regarding silent install of the VC 8.0 runtime (vcredist) packages

A while back, I posted this item on my blog that describes options for silent installation of the Visual C++ 8.0 runtime redistributable setup packages. When I investigated this issue and wrote that blog post, I based the command line parameters on the versions of vcredist_x86.exe, vcredist_x64.exe and vcredist_ia64.exe that are included in the directory %ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper\Packages when installing Visual Studio 2005.

However, a customer recently alerted me to an issue that I wasn't aware of previously. The standalone versions of the VC runtime redistributable packages that are available for download via the web are packaged differently, and so the command lines that I previously documented for silent installation will not work with those versions of the packages. Essentially, the standalone versions are wrapped in a second self-extracting EXE that displays a EULA before allowing extraction and execution of the main setup package, whereas the packages included as part of Visual Studio 2005 directly launch setup and are not doubly wrapped.

Therefore, here are some amended silent install instructions for the VC 8.0 runtime redistributable packages. If you are using the packages included as a part of Visual Studio 2005, you can continue to use the silent install switches from my previous blog post.

However, if you have downloaded the standalone VC 8.0 redistributable packages, you will need to modify the command lines slightly. The following command lines can be used to install the original release of the standalone VC 8.0 redistributable packages:

* For x86: vcredist_x86.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
* For x64: vcredist_x64.exe /q:a /c:"VCREDI~2.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
* For ia64: vcredist_ia64.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "

The following command lines can be used to install the Visual Studio 2005 SP1 release of the standalone VC 8.0 redistributable packages:

* For x86: vcredist_x86.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
* For x64: vcredist_x64.exe /q:a /c:"VCREDI~2.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
* For ia64: vcredist_ia64.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "

If you would like to install the VC runtime packages in unattended mode (which will show a small progress bar but not require any user interaction), you can change the /qn switch above to /qb. If you would like the progress bar to not show a cancel button, then you can change the /qn switch above to /qb!


Your URL is here: http://blogs.msdn.com/astebner/archi...-packages.aspx