Setup Factory and VS 2005

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • vazir786
    Forum Member
    • Oct 2005
    • 3

    Setup Factory and VS 2005

    We have upgraded our exisiting Vb6 based projects to Vb.Net 2005.

    Can any one knows how to detect and install .net framework 2.0 using setup factory, and any other modules needed for this .

    please include any addational links, information for this


    Thanks in ADVANCE


    With Regards


    (DRD) Amit Parse
  • bnkrazy
    Forum Member
    • Oct 2003
    • 143

    #2
    I just implemented this script last night as a matter of fact. Works great :yes :



    You will have to do the installation of the runtime yourself, though that is trivial.

    Comment

    • Eagle
      Indigo Rose Customer
      • Mar 2005
      • 944

      #3
      hey Chris, could you see where any tweaks could be done or
      care to post your dload\install script..upload it to the related post
      if ya happy too. will help a few out no doubt
      ps glad to see worked for you..

      Anyone know if 'Vista' is going to ship with V1.1 sp1 or V2.0.xxxx ?

      I would imagine installed with the OS.. btw Vista's OS major\minor ver is: 6.0
      Last edited by Eagle; 01-11-2006, 10:10 AM.

      Comment

      • cristianlazar
        Forum Member
        • Jan 2006
        • 1

        #4
        .NET Framework 2.0

        Please take a look at the XML needed to create .NET 2.0 dependency.

        1. copy the following into a dotnet2_0.xml file
        2. copy this file to "Program Files\Setup Factory 7.0\Dependencies" disectory
        3. create directory "Program Files\Setup Factory 7.0 \Dependencies\dotnet2_0" and copy in here the dotnetfx.exe file needed to install .NET 2.0
        4. Enjoy it
        ------------------------------------------------------

        <DependencyTemplate>
        <Dependency>
        <Name>Microsoft .NET Framework 2.0</Name>
        <RuntimeTempFolder>dotnet2_0</RuntimeTempFolder>
        <RevisionDate>Wednesday, October 13, 2004</RevisionDate>
        <Description>
        Type: Setup Factory 7.0 Dependency Module
        Created By: Cristian Lazar (13/01/2006)
        Last Revision: January 13, 2006 (001)

        Installs all the version 2.0 Microsoft .NET framework onto the user’s system.

        Applications and controls written for the .NET Framework version 2.0 require the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs. The .NET Framework redistributable package is available as a stand-alone executable file, Dotnetfx.exe. When this dependency module is included in your setup, it detects and installs the .NET Framework redistributable.

        Please note that if your application requires database support then MDAC2.6 or greater is also required. If you require this you can download our dependency module from the Setup Factory 7.0 Addons, Modules &amp; More forum.


        Instructions:
        In order for the .NET module to be available and function correctly, Setup Factory expects the following:

        1) A newly created folder in the "Dependencies" folder (where you unzipped "dotnet2_0.xml") called "dotnet2_0".
        2) A copy of the Microsoft .NET Framework redistributable file (dotnetfx.exe) located in the "dotnet2_0" directory mentioned above. The .NET installation file can be downloaded from the following URL: http://www.microsoft.com/downloads/d...displaylang=en


        For more information about .NET 2.0, please see:

        Full Version 2.0:
        32Bit


        64 Bit:

        (64bit above has both 64 bit and 32bit redists in one package.)

        <DetectScript>function isDotNet_Installed()

        -- Output to the log that the .NET detection has started.
        SetupData.WriteToLogFile("Success\t.NET 2.0 Module: Detection script started.\r\n", true);

        -- Get the operating system name.
        strOSName = System.GetOSName();
        -- Check to make sure the operating system is not Windows 95.
        if (strOSName ~= "Windows 95") then

        --Check to see if the registry key exists
        DotNet_Registry = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\.NETFramework");

        if (DotNet_Registry == nil) then
        -- The registry key does not exist
        -- Run the .NET Installation script
        -- Output to the log file that .NET could not be found, so it will be installed.
        SetupData.WriteToLogFile("Info\t.NET 2.0 Module: No version of .NET 2.0 was found. .NET 2.0 will be installed.\r\n", true);
        return false;
        else -- The key does exist

        -- Get the .NET install location from the registry
        DotNet_Install_Location = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\.NETFramework", "InstallRoot", true);
        -- Look for the file mscorcfg.dll
        Does_File_Exist = File.Find(DotNet_Install_Location.."\\v2.0.50727\\ ", "aspnet_rc.dll", true, false, nil);

        if (Does_File_Exist == nil) then
        -- The file does not exist
        -- Run the .NET Installation script
        -- Output to the log file that .NET could not be found, so it will be installed.
        SetupData.WriteToLogFile("Info\t.NET 2.0 Module: No version of .NET 2.0 was found. .NET 2.0 will be installed.\r\n", true);
        return false;

        else -- The file does exist

        -- Get the version of mscorcfg.dll
        msc_ver = File.GetVersionInfo(Does_File_Exist[1]);

        -- Compare the returned value against the needed value
        Compare = String.CompareFileVersions(msc_ver.FileVersion, "2.0.50727.42");


        if (Compare == 0 or Compare == 1) then
        -- .net version 2.0 is installed already
        return true;
        else
        -- a version less than version 2.0 is installed
        -- Output to the log file that a lesser version of .NET was found on the system
        SetupData.WriteToLogFile("Info\t.NET 2.0 Module: A lesser version of .NET 2.0 was found on the users system.\r\n", true);
        return false;
        end
        end
        end
        else
        --.NET 2.0 isn't supported on the OS that was detected.
        -- Output to the log that .NET 2.0 isn't supported on the current OS.
        SetupData.WriteToLogFile("Info\t.NET Module: .NET 2.0 is not supported on "..strOSName.." and will not be installed.\r\n", true);
        -- .NET 2.0 should not be installed.
        return true;
        end
        end</DetectScript>

        <DetectFunction>isDotNet_Installed</DetectFunction>
        <InstallScript>-- Variables used in the installation actions:
        local strMessage =
        [[Setup has detected that your Microsoft .NET run-time files are out of date.
        Click OK to install this technology now or Cancel to abort the setup.]];
        local strDialogTitle = "Technology Required";
        local bShowUserPrompt = true;
        local bRunInstallFile = true; -- The default of whether or not to run the setup
        local bRequirementFail = false;
        local tbRequirementFailStrings = {};
        local strAbortQuestion = "\r\n\r\nDue to this requirement failure, it is recommended that you abort the install. \r\n\r\nClick OK to abort the setup, or Cancel to continue with the application install.";
        local strRequirementString = ".NET 2.0 cannot be installed due to the following requirements:\r\n";
        local strRuntimeSupportFolder = SessionVar.Expand("%TempLaunchFolder%\\dotnet2_0") ;
        local strFileToRun = strRuntimeSupportFolder.."\\dotnetfx.exe";
        local strMessageFail = "";

        -- Output to the log that the .NET installation script has started.
        SetupData.WriteToLogFile("Success\t.NET 2.0 Module: Installation script started.\r\n", true);


        -- Read the version of Internet Explorer (if installed).
        strIEVersion = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", "Version", false);

        -- If Internet Explorer Version is less than 5.01 , or cannot be found,
        -- set the failure variable and failure string table.
        if ((String.CompareFileVersions(strIEVersion, "5.01")== -1) or (strIEVersion == "")) then
        bRequirementFail = true;
        strTemp = "- .NET 2.0 requires Internet Explorer version 5.01 or greater.";
        Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp);
        end


        -- Check if the user is logged in with administrative permissions.
        -- If the user doesn't have admin permissions, set the failure variable
        -- and failure string table.
        tbUserInfo = System.GetUserInfo();
        if (tbUserInfo ~= nil) then
        if (not tbUserInfo.IsAdmin) then
        bRequirementFail = true;
        strTemp = "- You do not have the required administrative permissions to install .NET 2.0.";
        Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp);
        end
        end


        -- Check if the dialog should be displayed asking whether or not they want to install the module.
        if(bShowUserPrompt)then
        local nDialogResult = Dialog.Message(strDialogTitle,strMessage,MB_OKCANC EL,MB_ICONEXCLAMATION);
        if(nDialogResult == IDOK)then
        -- The user chose to install the module.
        bRunInstallFile = true;
        else
        -- The user chose not to install the module.
        bRunInstallFile = false;
        end
        end

        if (not bRequirementFail) then
        -- Check if the user wants to install the runtime.
        if(bRunInstallFile)then
        -- The following are command line options that can be used when launching the install file.
        --/l Creates the setup log, netfx.log, in the %temp% directory. Error codes returned from Dotnetfx.exe are written to this log.
        --/q Specifies quiet install mode. Suppresses the display of the setup user interface. For a quiet install, you must also specify the Dotnetfx.exe /q:a option to suppress the extraction user interface.
        -- Output to the log that the .NET installation is being launched.
        SetupData.WriteToLogFile("Info\t.NET 2.0 Module: .NET 2.0 installation file "..strFileToRun.." is being launched.\r\n");
        local nResult = File.Run(strFileToRun, "", "", SW_SHOWNORMAL, true);
        if (nResult == 8192) then
        -- .NET install indicated that it needs reboot to be complete
        -- Set Setup Factory's reboot variable so that the reboot is just
        -- performed at the end of the install.
        _NeedsReboot = true;
        elseif (nResult == 2147943623) then
        -- The user choose not to install the file
        strMessageFail = "You have chosen not to install the .NET 2.0 runtime module.\r\n\r\nClick OK to abort the setup, or Cancel to continue with the application install.";
        elseif (nResult == 2147943467) then
        -- The user canceled the setup program.
        strMessageFail = "You have cancelled the installation for .NET 2.0. It is not recommended that you continue with the setup.\r\n\r\nClick OK to abort the setup, or Cancel to continue with the application install.";
        elseif (nResult == 4099) then
        -- There is not sufficient disk space to complete the .NET setup.
        strMessageFail = "Due to the improper installation of Windows Installer, the installation of Dotnetfx.exe cannot proceed.";
        elseif (nResult == 0) then
        -- The .NET setup was successful, so do nothing.
        else
        -- The .NET setup program was not completed successfully.
        strMessageFail = "An unknown error occurred during the installation of the .NET 2.0 runtime. It is not recommended that you continue with the setup.\r\n\r\nClick OK to abort the setup, or Cancel to continue with the application install.";
        end

        -- Check to see if an error message was generated.
        if (strMessageFail ~= "") then
        -- Display the error notification dialog.

        -- Output to the log MDAC error message.
        SetupData.WriteToLogFile("Error\t.NET 2.0 Module: Dialog error shown- "..strMessageFail..".\r\n");

        nDialogResult = Dialog.Message(".NET 2.0 Installation",strMessageFail,MB_OKCANCEL,MB_ICONEX CLAMATION);
        if (nDialogResult == IDOK) then
        bAbortInstall = true;
        end
        end

        -- Delete the run time installer file and remove the temp folder
        File.Delete(strFileToRun);
        Folder.Delete(strRuntimeSupportFolder);

        -- If the user chose to abort the install after the failure of .NET install, exit the setup.
        if (bAbortInstall) then
        -- Output to the log that the user chose to abort the setup after .NET failure.
        SetupData.WriteToLogFile("Error\t.NET 2.0 Module: User chose to abort setup after .NET failure. Exiting setup.\r\n");
        Application.Exit();
        end



        else
        -- The user chose not to install the runtime so delete the run time installer file,
        -- remove the temp folder and then exit the setup.

        -- Output to the log that the user chose to abort the setup.
        SetupData.WriteToLogFile("Error\t.NET 2.0 Module: User chose to abort setup. Exiting setup.\r\n");

        File.Delete(strFileToRun);
        Folder.Delete(strRuntimeSupportFolder);
        Application.Exit();
        end
        else
        -- A requirement failed

        -- If the user didn't cancel...
        if (bRunInstallFile) then
        -- One or more of the requirements failed. Notify the user and ask if they wish
        -- to abort the installation.
        strFullErrorString = Table.Concat(tbRequirementFailStrings, "\r\n", 1, TABLE_ALL);
        nDialogResult = Dialog.Message("Notice", strRequirementString..strFullErrorString..strAbort Question, MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1);

        -- Output the requirement failure string to the log.
        SetupData.WriteToLogFile("Error\t.NET 2.0 Module: Requirement failure dialog: "..strFullErrorString.."\r\n");

        -- Delete the runtime installer file and remove the temp folder
        File.Delete(strFileToRun);
        Folder.Delete(strRuntimeSupportFolder);

        -- The user chose to abort the install due to the requirement failure of .NET.
        if (nDialogResult == IDOK) then

        -- Output to the log that the user chose to abort the install due to requirement failure.
        SetupData.WriteToLogFile("Error\t.NET 2.0 Module: User aborted setup due to requirement failure. Exiting setup.\r\n");

        -- Abort the install.
        Application.Exit();
        end
        else
        -- The user chose not to install the runtime so delete the run time installer file,
        -- remove the temp folder and then exit the setup.

        -- Output to the log that the user chose to abort the setup.
        SetupData.WriteToLogFile("Error\t.NET 2.0 Module: User chose to abort setup. Exiting setup.\r\n");

        File.Delete(strFileToRun);
        Folder.Delete(strRuntimeSupportFolder);
        Application.Exit();

        end
        end

        -- If a reboot was needed by .NET, notify the user that they must reboot
        -- before continuing with the install

        -- NOTE: If you would always like to force the user to reboot, comment out the "if (_NeedsReboot) then" condition below.

        local strRebootMessage = "A reboot is required to continue with the installation. After rebooting, re-run the installation.\r\n\r\nClick OK to reboot now, or Cancel to reboot later.";
        if (_NeedsReboot) then
        nDialogResult = Dialog.Message("Notice", strRebootMessage, MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1);

        -- Output to the log that a reboot is required by the MDAC setup.
        SetupData.WriteToLogFile("Info\t.NET 2.0 Module: .NET 2.0 detected that a reboot is required.\r\n");
        -- Check if the uer wanted to reboot now.
        if (nDialogResult == IDOK) then

        -- NOTE: If you would like the install to relaunch itself after the reboot,
        -- uncomment the following block of code.
        -- Re-run the installation after the reboot.

        -- File.RunOnReboot(_SourceFolder.."\\".._SourceFilen ame, "");

        -- Output to the log that a reboot will be performed.
        SetupData.WriteToLogFile("Info\t.NET 2.0 Module: A reboot will be performed.\r\n");
        -- Reboot the user's system.
        System.Reboot();
        else
        -- Output to the log that the user chose to reboot later and abort the setup.
        SetupData.WriteToLogFile("Info\t.NET 2.0 Module: User chose to reboot later. Exiting setup.\r\n");
        -- Abort the install.
        Application.Exit();
        end
        end
        -- Output to the log that the installation script has finished.
        SetupData.WriteToLogFile("Success\t.NET 2.0 Module: Installation script finished.\r\n");


        </InstallScript>
        <SupportFiles>
        <File>#SUFDIR#\Dependencies\dotnet2_0\dotnetfx.exe </File>
        </SupportFiles>
        </Dependency>
        </DependencyTemplate>

        Comment

        • bnkrazy
          Forum Member
          • Oct 2003
          • 143

          #5
          Well now, isn't that all fancy.

          :yes

          Comment

          Working...
          X