Results 1 to 3 of 3

Thread: INNO Scripting doubt

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Cochin, India
    Posts
    350

    Question INNO Scripting doubt

    I am a new user of INNO Setup creation application.
    I tried to add fw 2.0 to my setup and here is the code
    Code:
    [Run]
    ;INSTALL THE FRAMEWORK IF IT WAS INCLUDED
    ;THIS LINE RUNS THE FRAMEWORK INSTALL
    Filename: {tmp}\dotnetfx.exe;                                 Parameters: "/q:a /c:""install /l /q""";                                                      WorkingDir: {tmp};    Flags: skipifdoesntexist; StatusMsg: "Checking for and installing .NET Framework if needed, This can take several minutes..."
    ;THESE LINES ARE TO GIVE THE PATH TO YOUR EXE FULL TRUST ON THE MACHINE
    ;THIS IS DONE BECAUSE IF THE USER INSTALLS THE SOFTWARE TO A NETWORK SHARE
    ;IT WILL HAVE LIMITED TRUST BY DEFAULT. INSTEAD OF MAKING THE USER HAVE TO MANAGE THIS MANUALLY
    ;IN THE .NET FRAMEWORK MANAGEMENT, WE GIVE THE APP DIR FULL TRUST USING CASPOL
    ;THE FIRST LINE DELETES ANY EXISTING REFERENCE TO THIS APP (INCASE THIS IS A REINSTALL)
    ;THE SECOND LINE GIVE THE FULL TRUST BACK
    ;IF YOU DONT INCLUDE THE FIRST LINE, AND USER IS REINSTALLING, THEN YOU WILL END UP WITH 2 ENTRIES
    Filename: {win}\Microsoft.NET\Framework\v2.0.50727.42\CasPol.exe; Parameters: "-q -machine -remgroup ""ImagePro""";                                               WorkingDir: {tmp};    Flags: skipifdoesntexist; StatusMsg: "Setting Program Access Permissions..."
    Filename: {win}\Microsoft.NET\Framework\v2.0.50727.42\CasPol.exe; Parameters: "-q -machine -addgroup 1.2 -url ""file://{app}/*"" FullTrust -name ""ImagePro""";   WorkingDir: {tmp};    Flags: skipifdoesntexist; StatusMsg: "Setting Program Access Permissions..."
    
    [UninstallRun]
    ;ON UNINSTALL, REMOVE CASPOL ENTRY FOR FULL TRUST
    Filename: {win}\Microsoft.NET\Framework\v2.0.50727.42\CasPol.exe; Parameters: "-q -machine -remgroup ""TestMtx""";
    My problem is that the framework gets reinstalled everytime I run the setup. that is, evenif the computer has fw 2.0 installed in it, the setup reinstalls the fw.

    Also this code is to run the fw setup in background (hidden). How can I unhide the fw installation so that user can interact with it?
    DOK OCK : "The power of .net in the palm of my hand, nothing will stand in my way. Nothing."

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: INNO Scripting doubt

    Why not just use the Setup Project of VS? It handles the framework and can create shortcuts.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Lively Member
    Join Date
    Dec 2005
    Location
    Ontario, Canada
    Posts
    67

    Re: INNO Scripting doubt

    The problem is that you force the fw installer to run everytime.

    Consider this:

    In the Run Section of the script:
    Code:
    FileName: {tmp}\dotnetfx.exe; Check: InstallNetFramework(ExpandConstant('{tmp}\dotnetfx.exe'))
    In the code section of the script:
    Code:
    function DotNet2Installed(): boolean;
    //This routine will return false if the framework is already installed
    var
        success: boolean;
        install: cardinal;
    begin
        //test for v1.1 of the frame work
        //success := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322', 'Install', install);
    
        //test for v2 of the frame work
        success := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727', 'Install', install);
        Result := success and (install = 1);
    end;
    
    
    function InstallNetFramework(installer: String): Boolean;
    //this routine will check to see if the installer exists and the correct version of .Net exists.
    //if the installer doesn't exist, the routine returns false as there is nothing to install
    //if the correct version of the .Net framework exists, then the routine returns false as well
    //indicating that it is not necessary to install the framework
    var
      netInstallerExists: boolean;
      netFrameworkInstalled: boolean;
    begin
      netInstallerExists := FileExists(installer);
      netFrameworkInstalled  := DotNet2Installed;
      
      Result := netInstallerExists and not netFrameworkInstalled
    end;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width