|
-
Jan 1st, 2006, 12:35 PM
#1
Thread Starter
Hyperactive Member
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." 
-
Jan 1st, 2006, 02:16 PM
#2
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Jan 4th, 2006, 08:11 AM
#3
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|