Sorry, been a bit busy... I will post it today
Printable View
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?