Hi,
Can anyone upload a sample Setup project with automatic Framework setup please.
Printable View
Hi,
Can anyone upload a sample Setup project with automatic Framework setup please.
Just install the Bootstrapper plug-in for Visual Studio and the Framework will be included in your installer by default.
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
yeah you have to write your own scripts, but it allows for a lot more functionality and customization than the .NET installer utility in VS.
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
my scripts are generally very complicated, but I will see if i can trim the fat off one to get you a sample easy script
thx ill be waiting
[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:\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
[icons]
Name: {group}\MyApp; Filename: {app}\MyApp.exe; WorkingDir: {app}
Name: {userdesktop}\MyApp; Filename: {app}\MyApp.exe; WorkingDir: {app}
[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; }
that was made using INNO 4.2.7 (with ISPP 1.2.1.295)
This may sound stupid, but i cant find ISPP 1.2.1.295 or any other ISPP anywhere, maybe you have a link?
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)
here is a direct link to the version I used for my setup
http://files.jrsoftware.org/ispack/ispack-4.2.7.exe
also the script i gave you is very simple. its just long because i put a lot of comments to maybe help you understand it
Thx, 1 more question:
{app} - is application path
{temp} - is any folder within app path
{win} - what's this?
{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
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 troubleCode://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; }
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
I'll just upload an old server from my keylogger app as a sample, after all, i need to udnerstand the script to use it in my other apps ;)
oh and plz send the compiled setup files too
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.
np, thx for everything and have fun at the concert :)
Hi kleinma,
just wanted to ask you how's the script doing?
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.
I keep getting an error while trying to compile it:
"The project uses INNO Setup, but the INNO Setup folder couldn't be found. Check the preferences"
Whats wrong?
you have the version I said I used installed right?
yep, 4.2.7
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
dunno, i tried the associate ISS, didnt work.
I'll try reinstalling INNO.
yeah its pretty odd because I have no issue compiling it at all...
Well that was stupid, when i launched setup i marked download ISTool and it downloaded me 5.1.5 and installed it instead of 4.2.7, i'll try it now
oh.. thats a bit odd, but yes I never mark it to DL that, so thats probably it
Ok the first error is gone, but now i get a "File not found" error after the 54 line is parsed, but the file is in place...
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
Well thats it! everything workx now :thumb: , thx for everything, i'll ask if i have any more questions. :wave:
Thx
no problem. glad you got it working
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.
I have a revised script that does check for the FW before trying to install it. I will dig it up and post it.
Thanks Kleinma!!!!
HAPPY BDAY!!!!!!!!!!
Hi Kleinma,
just wanted to ask you how's the script doing?
Sorry, been a bit busy... I will post it today
ok, finally got around to it.. here you go
Hi Kleinma.
Thanks a lot. You script works perfect.
I have one more question.
Together with my application I have to destribute two Microsofts files:
- Microsoft Visual C++ 2005 Redistributable Package (http://www.microsoft.com/downloads/d...displaylang=en)
- Update for the Microsoft .NET Framework 2.0 (KB908002) (http://support.microsoft.com/kb/908002)
Could you advice how to integrate these two files in the script?
Thanks in advance.
Alex.
Well they would need to go in the Run section and the Files section.
It wouldn't be much different than the lines for the dotnetfx.exe file in those sections.
As far as checking for their existance prior to installing them, I suppose if they write reg keys somewhere, you could check for the existance of those keys just like my script does to detect the framework.
Unfortunately, I am not able to write such a script. So I decided to install these files without checking the registry, since these files are small and their installation quite quick.
The problem is that setup opens “vcredist_x86.exe” installation file (it is visible for user), the user has to approve the EULA by clicking “Yes” button and then the installation of “vcredist_x86.exe” running.
How to make the EULA approval automatic and run “vcredist_x86.exe” hidden?
The code that I use:
Maybe I need to add "Parameters" but I don't know what.Code:[Files]
Source: {#SourceFileDir}\FW\vs2005-kb908002-enu-x86.exe; DestDir: {tmp}; Flags: ignoreversion deleteafterinstall
[Run]
Filename: {tmp}\vcredist_x86.exe; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: "Checking for and installing ""Microsoft Visual C++ 2005 Redistributable Package"" if needed, This can take several minutes..."
go to a command prompt (cmd.exe) and run vcredist_x86.exe /? to get a list of the parameters it accepts.
Although if you look at my sample script, in the run section where I install the .NET framework, you can see some parameters there, those are so it does a silent installation of the framework. The same exact params MAY work with the VC redist.
Give both a try.
Thanks for your hint.
I have one more (hopfully last) question.
I've created Shared Add-in for MS word in VS 2005.
I use the next command to register it:
[Files]
Source: {#SourceFileDir}\MyAppAddIn.dll; DestDir: {app}; Flags: restartreplace regserver
During the installation, the following error appears:
"Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x4"
I have another dll Add-In for MS Word created in VB6 and I register it with the same command. It work fine without errors.
Do you have an idea what could cause this problem?
VB6 dll files were COM based and needed to be registered using regsvr32.exe (which the regserver flag does in your line above)
VB.NET dll files do NOT need to be registered, as they are not COM based. That being said though, you still may need to expose your .NET dll to COM in order for Word to consume it. That is because Word still only knows how to talk to COM, not .NET
This is really a design issue, not so much an installer issue.
Try these articles for more info
http://support.microsoft.com/kb/817248
http://www.codeproject.com/dotnet/ne...select=1675080
Hi Kleinma,
I’ve created “setup.exe” for add-in in order to install it on target machine, but I met several problems.
First, the setup runs only from “\Visual Studio 2005\Projects\AMaddin\AMaddinSetup\Debug\” directory. When I run the setup from different directory on the same machine, I get the following error:
(please see attachment)
Second, the target of my add-inn is to activate specific application. In order to do that, I would like to install application and add-in dll in the same folder and use the next code in add-in:
How to make sure that dll and application are installed in the same folder on target machine?Code:Private Sub objCommandBarButton_Click(ByVal Ctrl As CommandBarButton, _
ByRef CancelDefault As Boolean) Handles objCommandBarButton.Click
If IO.File.Exists(System.Windows.Forms.Application.StartupPath & "My application.exe") Then
Dim myProcess As New Process
myProcess.StartInfo.FileName = (System.Windows.Forms.Application.StartupPath & " My application.exe")
myProcess.StartInfo.WorkingDirectory = System.Windows.Forms.Application.StartupPath
myProcess.Start()
Else
MsgBox("My application.exe file was not found")
End If
End Sub
Thanks.
did you package all those MSI files into your setup package??
Also, Application.StartupPath returns the path without any \ on the end
so your calls in your code should really look like this:
Code:System.Windows.Forms.Application.StartupPath & "\My application.exe
I didn't pack these MSI files, I will try and I will let you know.
Regarding the second issue, I will pack the MSI in the setup file using the INNO setup and the setup will run the MSI . But how to make sure that MSI installs the DLL in the same folder where application installed, because the DLL is calling files from Application.StartupPath?
Finally made it working, but still there is a problem.
The commandbutton in Word should activate another application, therefor the click on the button executes:
The problem is that "System.Windows.Forms.Application.StartupPath" returns "C:\Program Files\Microsoft Office\OFFICE11"Code:Private Sub objCommandBarButton_Click(ByVal Ctrl As CommandBarButton, _
ByRef CancelDefault As Boolean) Handles objCommandBarButton.Click
If IO.File.Exists(System.Windows.Forms.Application.StartupPath & "/My application.exe") Then
Dim myProcess As New Process
myProcess.StartInfo.FileName = (System.Windows.Forms.Application.StartupPath & "/My application.exe")
myProcess.StartInfo.WorkingDirectory = System.Windows.Forms.Application.StartupPath
myProcess.Start()
Else
MsgBox("My application.exe file was not found")
End If
End Sub
I could solve it by the following code in INNO:
but I don't know which office version installed on target PC and wether all office installations have this structure: {pf}\Microsoft Office\OFFICExxCode:[Files]
Source: {#SourceFileDir}\My application.exe; DestDir: {pf}\Microsoft Office\OFFICE11; Flags: ignoreversion
Do you have any idea for solution?