I personally use INNO. I include the framework and unpack it to a temp directory at install, and run it silently. If the machine already has the framework, it goes real quick, if it needs to install it, it does so and then finishes the install.
I installed the plug-in, but i cant make the installer, thats why i need a source for the setup project.
When i add a project to the solution and then try to build it, i get an "unrecoverable error"
Well i downloaded INNO, so i have to write my own scripts there? Maybe its not the INNO im looking for, can you give me the link where you got it from?
Thx
and after the script is done it is compiled into a setup file?
If so, can u please send me a script which includes framework and installs it silently.
thx
;ISPP VARIABLES
;I use these to specify where the files are that i am packing into this setup
;you may not need 2, but i like to keep things organized (you may need more, its all up to the app you are making a setup for)
#define SupportFilesDir "c:\code\MyApp\setup files"
#define SourceFileDir "c:\code\MyApp\release build\package"
;THIS IS IF YOU WANT TO COMPILE WITH OR WITHOUT FRAMEWORK INCLUDED
#define IncludeFramework true
[setup]
AppName=MyApp
;only put a verion info in AppVerName if you want different entries for each version in
;add/remove programs, otherwise make it the same name as the AppName
AppVerName=MyApp
AppPublisher=Kleinma, Inc.
AppPublisherURL=http://www.vbforums.com
AppSupportURL=http://www.vbforums.com/support
AppUpdatesURL=http://www.vbforums.com
;default where to install the app
;{pf} = program files (see documentation for other locations)
DefaultDirName={pf}\kleinma\MyApp
;group name for the start menu group
DefaultGroupName=MyApp
DisableProgramGroupPage=yes
DirExistsWarning=no
UninstallFilesDir={app}
;you dont need these lines if you don't have a eula, or other info files
;can be txt, rtf, possibly other formats
LicenseFile={#SupportFilesDir}\eula.rtf
InfoBeforeFile={#SupportFilesDir}\sysreq.rtf
InfoAfterFile={#SupportFilesDir}\readme.txt
;if you want a different image in the side of the installer, leave out to use default
WizardImageFile=c:\installlogo2.bmp
;icon to show for add/remove program entry
;{app} points to the destination install directory after it is selected by user
UninstallDisplayIcon={app}\MyApp.exe
VersionInfoVersion=0.1.0.0
;if we set to include framrwork, change output file name to indicate this
;this is something i do to make things easier on myself, you don't have to
#if IncludeFramework
OutputBaseFilename=setup_FW
#else
OutputBaseFilename=Setup
#endif
;where to put the setup.exe after its compiled
OutputDir={#SourceFileDir}\setup
[files]
;FILES THAT GO IN THE APP DIRECTORY
Source: {#SourceFileDir}\MyApp.exe; DestDir: {app}; Flags: ignoreversion
source: {#SupportFilesDir}\readme.txt; DestDir: {app}; Flags: ignoreversion
;.NET FRAMEWORK (only include when IncludeFramework is set to true)
#if IncludeFramework
Source: {#SourceFileDir}\dotnetfx.exe; DestDir: {tmp}; Flags: ignoreversion
#endif
[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\v1.1.4322\CasPol.exe; Parameters: "-q -machine -remgroup ""MyApp"""; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: "Setting Program Access Permissions..."
Filename: {win}\Microsoft.NET\Framework\v1.1.4322\CasPol.exe; Parameters: "-q -machine -addgroup 1.2 -url ""file://{app}/*"" FullTrust -name ""MyApp"""; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: "Setting Program Access Permissions..."
[UninstallRun]
;ON UNINSTALL, REMOVE CASPOL ENTRY FOR FULL TRUST
Filename: {win}\Microsoft.NET\Framework\v1.1.4322\CasPol.exe; Parameters: "-q -machine -remgroup ""MyApp""";
[UninstallDelete]
;IF ANY FILES THAT ARENT SPECIFIED DURING INSTALL NEED TO BE DELETED AT UNINSTALL, DO IT HERE
;FOR EXAMPLE IF YOUR APP WRITE OUT DATA FILES OR TEXT FILES OR SOMETHING, AND YOU WANT THEM REMOVED AS WELL
Type: files; Name: "{app}\somefile.txt"
;HERE IS THE CODE SECTION
;THIS PARTICULAR SETUP DOES THE FOLLOWING
;MAKES SURE THEY ARE NOT RUNNING WIN95 OR WINNT (WIN NT IS .NET compatible if they have SP6), but my products just don't support NT so I leave it out)
;MAKES SURE THEY HAVE IE 5.5 OR HIGHER
;MAKES SURE THEY ARE LOGGED ON WITH ADMIN RIGHTS
;YOU CAN MODIFY THIS AS NEEDED, OR REMOVE IT TOTALLY IF YOU DONT WANT TO USE IT
;I RECOMMEND YOU AT LEAST LEAVE IN THE CHECK FOR ADMIN RIGHTS
Code:
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS 95
function IsWin95 : boolean;
begin
Result := (InstallOnThisVersion('4.0,0', '4.1.1998,0') = irInstall);
end;
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS NT4
function IsWinNT : boolean;
begin
Result := (InstallOnThisVersion('0,4.0.1381sp5', '0,4.0.1381sp6') = irInstall);
end;
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS NT4 SP6
{function IsWinNTsp6 : boolean;
begin
Result := (InstallOnThisVersion('0,4.0.1381sp6', '0,5.0.2195') = irInstall);
end;}
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS 98 FIRST EDITION
function IsWin98FE : boolean;
begin
Result := (InstallOnThisVersion('0,5.01.2600', '0,5.02.3790') = irInstall);
end;
//GETS VERSION OF IE INSTALLED ON CLIENT MACHINE
function GetIEVersion : String;
var
IE_VER: String;
begin
{First check Internet Explorer is installed}
if RegQueryStringValue(HKLM,'SOFTWARE\Microsoft\Internet Explorer','Version',IE_VER) then
Result := IE_VER
else
{No Internet Explorer at all}
result := '';
end;
function InitializeSetup(): Boolean;
var
IE_VER: String;
begin
IE_VER := GetIEVersion
if IE_VER < '5.5' then
begin
if IE_VER = '' then
begin
MsgBox('Microsoft Internet Explorer 5.5 or higher is required to run MyApp.' + Chr(13) + Chr(13) + 'You do not currently have Microsoft Internet Explorer installed, or it is not working correctly.' + Chr(13) + 'Obtain a newer version at www.microsoft.com and then run setup again.', mbInformation, MB_OK);
end
else
begin
MsgBox('Microsoft Internet Explorer 5.5 or higher is required to run MyApp.' + Chr(13) + Chr(13) + 'You are using version ' + IE_VER + '.' + Chr(13) + Chr(13) + 'Obtain a newer version at www.microsoft.com and then run setup again.', mbInformation, MB_OK);
end
result := false;
exit;
end;
if (IsWin95) or (IsWinNT) then
begin
MsgBox('MyApp will not run on this version of Windows.', mbInformation, MB_OK);
result := false;
exit;
end
else
if IsAdminLoggedOn then
begin
result := true
exit;
end
else
{using the below code will bypass needing admin rights}
{begin
result := DriveSelectionSetup
exit;
end}
begin
MsgBox('You must have admin rights to perform this installation.' + Chr(13) + 'Please log on with an account that has administrative rights,' + Chr(13) + 'and run this installation again.', mbInformation, MB_OK);
result := false;
end
end;
end.
{
//USE THIS InitializeSetup ROUTINE INSTEAD OF THE ABOVE ONE IF YOU WANT TO
//ONLY CHECK FOR ADMIN RIGHTS BEFORE THE INSTALL
function InitializeSetup(): Boolean;
begin
MsgBox('You must have admin rights to perform this installation.' + Chr(13) + 'Please log on with an account that has administrative rights,' + Chr(13) + 'and run this installation again.', mbInformation, MB_OK);
result := false;
end; }
Last edited by kleinma; Aug 25th, 2006 at 10:42 AM.
its included if you download the QuickStart package version of INNO. basically its a preprocessor which allows certain things to be processed before the actual setup is compiled (for example including or not including the framework by setting a boolean)
{app} = application path, yes
{temp} = temp directory, usually it is located at c:\windows\temp or c:\temp ,etc... its just for temp files
{win} is the windows directory, it ALWAYS points to the directory windows is installed at, since it could be c:\win, c:\windows c:\winnt, or not C drive at all
Well i think i changed the script as it should be, but im getting an error: "Output File {SourceFileDir}/Setup/Setup_FW.exe doesn't exist" its definetly my fault, but i cant understand what im doing wrong
Here's how it looks now, anything i missed?
[CODE]
;Example .NET Setup Scripts
;2005 kleinma
;www.vbforums.com
;ISPP VARIABLES
;I use these to specify where the files are that i am packing into this setup
;you may not need 2, but i like to keep things organized (you may need more, its all up to the app you are making a setup for)
#define SupportFilesDir "C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin"
#define SourceFileDir "C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin"
;THIS IS IF YOU WANT TO COMPILE WITH OR WITHOUT FRAMEWORK INCLUDED
#define IncludeFramework true
[setup]
AppName=MyApp
;only put a verion info in AppVerName if you want different entries for each version in
;add/remove programs, otherwise make it the same name as the AppName
AppVerName=MyApp
AppPublisher=Kleinma, Inc.
AppPublisherURL=http://www.vbforums.com
AppSupportURL=http://www.vbforums.com/support
AppUpdatesURL=http://www.vbforums.com
;default where to install the app
;{pf} = program files (see documentation for other locations)
DefaultDirName=C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin
;group name for the start menu group
DefaultGroupName=MyApp
DisableProgramGroupPage=yes
DirExistsWarning=no
UninstallFilesDir=C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin
;you dont need these lines if you don't have a eula, or other info files
;can be txt, rtf, possibly other formats
LicenseFile={#SupportFilesDir}\eula.rtf
InfoBeforeFile={#SupportFilesDir}\sysreq.rtf
InfoAfterFile={#SupportFilesDir}\readme.txt
;if you want a different image in the side of the installer, leave out to use default
WizardImageFile=c:\work\abby\abbypass\project files\installlogo2.bmp
;icon to show for add/remove program entry
;{app} points to the destination install directory after it is selected by user
UninstallDisplayIcon=C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin\WindowsApplication1.exe
VersionInfoVersion=0.1.0.0
;if we set to include framrwork, change output file name to indicate this
;this is something i do to make things easier on myself, you don't have to
#if IncludeFramework
OutputBaseFilename=setup_FW
#else
OutputBaseFilename=Setup
#endif
;where to put the setup.exe after its compiled
OutputDir={#SourceFileDir}\setup
[files]
;FILES THAT GO IN THE APP DIRECTORY
Source: {#SourceFileDir}\MyApp.exe; DestDir: {app}; Flags: ignoreversion
source: {#SupportFilesDir}\readme.txt; DestDir: {app}; Flags: ignoreversion
;.NET FRAMEWORK (only include when IncludeFramework is set to true)
#if IncludeFramework
Source: {#SourceFileDir}\dotnetfx.exe; DestDir: {tmp}; Flags: ignoreversion
#endif
[icons]
Name: C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin; Filename: C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin\WindowsApplication1.exe; WorkingDir: C:/Windows
Name: C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin; Filename: C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin\WindowsApplication1.exe; WorkingDir: C:/Windows
[Run]
;INSTALL THE FRAMEWORK IF IT WAS INCLUDED
;THIS LINE RUNS THE FRAMEWORK INSTALL
Filename: C:\Downloads\dotnetfx.exe; Parameters: "/q:a /c:""install /l /q"""; WorkingDir: C:\WINDOWS\Temp; 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: C:\Windows\Microsoft.NET\Framework\v1.1.4322\CasPol.exe; Parameters: "-q -machine -remgroup ""MyApp"""; WorkingDir: C:\WINDOWS\Temp; Flags: skipifdoesntexist; StatusMsg: "Setting Program Access Permissions..."
Filename: C:\Windows\Microsoft.NET\Framework\v1.1.4322\CasPol.exe; Parameters: "-q -machine -addgroup 1.2 -url ""file://C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin\*"" FullTrust -name ""MyApp"""; WorkingDir: C:\WINDOWS\Temp; Flags: skipifdoesntexist; StatusMsg: "Setting Program Access Permissions..."
[UninstallRun]
;ON UNINSTALL, REMOVE CASPOL ENTRY FOR FULL TRUST
Filename: C:\Windows\Microsoft.NET\Framework\v1.1.4322\CasPol.exe; Parameters: "-q -machine -remgroup ""MyApp""";
[UninstallDelete]
;IF ANY FILES THAT ARENT SPECIFIED DURING INSTALL NEED TO BE DELETED AT UNINSTALL, DO IT HERE
;FOR EXAMPLE IF YOUR APP WRITE OUT DATA FILES OR TEXT FILES OR SOMETHING, AND YOU WANT THEM REMOVED AS WELL
Type: files; Name: "C:\1000\test\Chat type keylogger\Automatic system getting Server BETA 4\WindowsApplication1\bin\UnInstall.txt"
;HERE IS THE CODE SECTION
;THIS PARTICULAR SETUP DOES THE FOLLOWING
;MAKES SURE THEY ARE NOT RUNNING WIN95 OR WINNT (WIN NT IS .NET compatible if they have SP6), but my products just don't support NT so I leave it out)
;MAKES SURE THEY HAVE IE 5.5 OR HIGHER
;MAKES SURE THEY ARE LOGGED ON WITH ADMIN RIGHTS
;YOU CAN MODIFY THIS AS NEEDED, OR REMOVE IT TOTALLY IF YOU DONT WANT TO USE IT
;I RECOMMEND YOU AT LEAST LEAVE IN THE CHECK FOR ADMIN RIGHTS
Code:
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS 95
function IsWin95 : boolean;
begin
Result := (InstallOnThisVersion('4.0,0', '4.1.1998,0') = irInstall);
end;
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS NT4
function IsWinNT : boolean;
begin
Result := (InstallOnThisVersion('0,4.0.1381sp5', '0,4.0.1381sp6') = irInstall);
end;
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS NT4 SP6
{function IsWinNTsp6 : boolean;
begin
Result := (InstallOnThisVersion('0,4.0.1381sp6', '0,5.0.2195') = irInstall);
end;}
//CHECKS TO SEE IF CLIENT MACHINE IS WINDOWS 98 FIRST EDITION
function IsWin98FE : boolean;
begin
Result := (InstallOnThisVersion('0,5.01.2600', '0,5.02.3790') = irInstall);
end;
//GETS VERSION OF IE INSTALLED ON CLIENT MACHINE
function GetIEVersion : String;
var
IE_VER: String;
begin
{First check Internet Explorer is installed}
if RegQueryStringValue(HKLM,'SOFTWARE\Microsoft\Internet Explorer','Version',IE_VER) then
Result := IE_VER
else
{No Internet Explorer at all}
result := '';
end;
function InitializeSetup(): Boolean;
var
IE_VER: String;
begin
IE_VER := GetIEVersion
if IE_VER < '5.5' then
begin
if IE_VER = '' then
begin
MsgBox('Microsoft Internet Explorer 5.5 or higher is required to run MyApp.' + Chr(13) + Chr(13) + 'You do not currently have Microsoft Internet Explorer installed, or it is not working correctly.' + Chr(13) + 'Obtain a newer version at www.microsoft.com and then run setup again.', mbInformation, MB_OK);
end
else
begin
MsgBox('Microsoft Internet Explorer 5.5 or higher is required to run MyApp.' + Chr(13) + Chr(13) + 'You are using version ' + IE_VER + '.' + Chr(13) + Chr(13) + 'Obtain a newer version at www.microsoft.com and then run setup again.', mbInformation, MB_OK);
end
result := false;
exit;
end;
if (IsWin95) or (IsWinNT) then
begin
MsgBox('MyApp will not run on this version of Windows.', mbInformation, MB_OK);
result := false;
exit;
end
else
if IsAdminLoggedOn then
begin
result := true
exit;
end
else
{using the below code will bypass needing admin rights}
{begin
result := DriveSelectionSetup
exit;
end}
begin
MsgBox('You must have admin rights to perform this installation.' + Chr(13) + 'Please log on with an account that has administrative rights,' + Chr(13) + 'and run this installation again.', mbInformation, MB_OK);
result := false;
end
end;
end.
{
//USE THIS InitializeSetup ROUTINE INSTEAD OF THE ABOVE ONE IF YOU WANT TO
//ONLY CHECK FOR ADMIN RIGHTS BEFORE THE INSTALL
function InitializeSetup(): Boolean;
begin
MsgBox('You must have admin rights to perform this installation.' + Chr(13) + 'Please log on with an account that has administrative rights,' + Chr(13) + 'and run this installation again.', mbInformation, MB_OK);
result := false;
end; }
Oh and sorry that im asking you bout this script all day, but i never written a script before in my life and have no idea how they work, hope its not too much trouble
if you want.. zip up your project and post it here. I will compile it for you, modify the setup accordingly, and post it back. If you want to do it privately, PM me and I can give you my email address to send it to
ok, I will get this to you, but it will be tomorrow as I have a concert to go to tonight, and I am leaving in a few minutes. Don't worry I will get you a working script.
here is an example setup... the iss setup script file is in the bin directory. The only thing you need to do to see this script work correctly, is to copy dotnetfx.exe into the bin directory (or change the path its using to look for dotnetfx.exe in the script) but I recommend you just drop that file in the bin for now. Then you can compile the script and see how it works.
not sure if it has something to do with where you have INNO installed or something.. try going to view -> options in INNO 4.2.7 and click the button to associate ISS files with that compiler.. see if that does it.. maybe its because you first installed version 5
did you change the SupportFilesDir and SourceFileDir locations at the top? in the script i sent you they point to where I had downloaded your app to on my desktop (C:\Documents and Settings\matt\Desktop\Simple chat type server\bin).. so you need to point those to where the app is on your system
Hi,
I tried to make a setup project with the scriped provided by Kleinma in this post.
It works fine, but the setup always installs .NET framework, even if it is already installed. This kind of setup is time consuming.
I am looking for a way to check if the Framework is already installed and only if is not installed the setup would install it.
I found many examples that do that, but the Framework is downloaded from the WEB and then installed.
My question is: how to install the framework that already included in setup file?
Thanks,
Alex.
Last edited by alex30; Oct 16th, 2007 at 04:03 PM.