03-13-2015 05:51 PM - edited 03-13-2015 05:54 PM
Our app requires that .Net 4.0 be installed and some users don't have it.
OurApp.exe also needs to be run immediately after installation while still running with Admin privelages.
I tried running executables at end of installation option under Advanced Installer Properties using Batch file including the command line arguments:
"[INSTALLDIR]dotNetFx40_Full_x86_x64.exe" "/passive /norestart" "[INSTALLDIR]OurApp.exe"
This does not work because the installer does not wait until .Net is installed before running OurApp.exe.
I have seen certain commercial install packages can check for installed components such as .Net prior to installation. But, is there a way of using LV tools to do it?
OurApp has startup VI which dynamically calls Main VI but if no .Net is installed then Main VI will be broken causing LV error upon startup.
I know I can detect .Net as follows but how to produce a proper installer package??? Ay ideas??
The above dialog is similar to what I require from here.
Detecting the .NET Framework 4
The .NET Framework 4 installer writes registry keys when installation is successful. You can test whether the .NET Framework 4 is installed by checking the registry keys listed in the following table.
|
Profile |
Registry key name |
Value |
|---|---|---|
|
Full |
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full |
Name: Install Type: DWORD Data: 1 |
|
Client |
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client |
Name: Install Type: DWORD Data: 1 |
03-14-2015 12:46 PM
hi battler,
Regarding the sequencing the installers in your batch file, have you tried using the "start" command. as in:
start /wait notepad.exe
start wordpad.exe
I have an app that checks whether (any) NET is installed by checking for the existence of folders under "C:\Program Files (x86)\Microsoft.NET". I'm not sure whether the same strategy could identify whether a specific version was installed.
Cheers.
03-14-2015 04:29 PM
@550nm wrote:
hi battler,
Regarding the sequencing the installers in your batch file, have you tried using the "start" command. as in:
start /wait notepad.exe
start wordpad.exe
Currently I am using a batch file solution but it is not ideal. I believe I need to start using a 3rd party install developer such as the expensive InstallShield or alternative; I will open separate thread for discussion.
The /wait command suggested does not work because it doesn't wait for the .Net to be installed.
@Echo off
start "<AppName>" %1 %2
echo <AppName> requires Microsoft .Net Framework
echo.
echo WAIT until installation is finished THEN
echo.
pause
start "<AppName>" %3
The %1, %2 and %3 command line items are parsed from the LV installation builder as:
%1 = [INSTALLDIR]<.Net install file.exe>
%2 = <.Net commands such as /q or /passive>
%3 = [INSTALLDIR]<AppName.exe>
Again, this is less than ideal and requires user interaction. Any better suggestions are appreciated.
03-15-2015 01:47 AM - edited 03-15-2015 01:52 AM
Hi battler,
Do you agree that this batch command should wait for installer to complete before continuing?
start /wait "[INSTALLDIR]dotNetFx40_Full_x86_x64.exe /passive /norestart"
NOTE: It should work as documented here - and does..
If so, then why not
start /wait <some_app> dotNetFx40_Full_x86_x64.exe /passive /norestart
If <some_app> is a batch file then use "start /wait" in there too.
If <some_app> is not a batch, yet takes the follwing cmd-line params: dotNetFx40_Full_x86_x64.exe /passive /norestart
then that's what's been confusing!
Cheers.