I designed an c# application and made an installer for it using NSIS to perform:
- Check if the required .net framework version is installed on the user machine.
- If not,It installs it.
- Create a directory for the program on program file
- Create an .exe for the program on the desktop
The problem in task 2 where it cannot install it. Here the code
Name "MeetingRegulator"
OutFile "setup.exe"
!define NETVersion "4.0.30319"
!define NETInstaller "dotNetFx40_Full_x86_x64.exe"
Section "MS .NET Framework v${NETVersion}" SecFramework
IfFileExists "$WINDIR\Microsoft.NET\Framework\v${NETVersion}" NETFrameworkInstalled 0
File /oname=$TEMP\${NETInstaller} ${NETInstaller}
DetailPrint "Starting Microsoft .NET Framework v${NETVersion} Setup..."
ExecWait "$TEMP\${NETInstaller}"
Return
NETFrameworkInstalled:
DetailPrint "Microsoft .NET Framework is already installed!"
SectionEnd
InstallDir $PROGRAMFILES\MeetingRegulator
DirText "ãä ÝÖáß Þã ÈÅÎÊíÇÑ ãßÇä ÊËØíÈ ÇáÈÑäÇãÌ"
Section "" ;No components page, name is not important
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File ÇáÅÌÊãÇÚÇÊ.exe
SectionEnd ; end the section
section "creat desktop icon "
SetOutPath $DESKTOP
File ÇáÅÌÊãÇÚÇÊ.exe
sectionend