Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Autorun for msi file

Posted on 2004-04-23
11
Medium Priority
?
1,561 Views
Last Modified: 2008-01-16
I have a visual basic 6 application for which I created an msi install package using visual studio. The install works fine but I need to set it up to run automatically when the cd is put in the drive. I do not know how to use an autorun file for an msi file (as opposed to an exe). Can this be done? If so, how? If not, what is the best alternative? Thanks.
0
Comment
Question by:SSC2004
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 300 total points
ID: 10902951
0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10903002
look this may be a help :)

in a Autorun.INF :

[autorun]
open=File.MSI
Name=Name of CD

--------------------------
if this doesnt work ,, then the best way is to write a very small application with VB
it will have this code:

Private Sub Form_Load()
On Error Resume Next
Dim x As Long
x = Shell(App.Path & "\FILE.MSI", vbsetfocus)
Unload Me
End Sub

then save this file as Autorun.exe or any other name and call that file from the Autorun.INF like :

[autorun]
open=File.MSI
Name=Name of CD


0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10903028
sorry replace vbsetfocus with "vbNormalFocus"
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:SSC2004
ID: 10903185
Couple questions: 1) how do I know the name of my cd? I am using roxio cd creator 2) would the solution using the little vb application work if I am loading to pc's which do not already have vb runtime on them? This will be distributed widely to who knows what. I have tried just the open = before and it did nothing, want to try adding the name of cd.
0
 
LVL 14

Expert Comment

by:Tommy Kinard
ID: 10903190
Hi SSC2004,

This is how I distribute my apps on cd. It works under Win98, ME, 2K, XP homw and Pro.

The setup.exe is the one that is used with the Package and Deployment  Wizard
Contents of Autorun.inf
[autorun]
open=setup.exe


Contents of setup.ini
[MSILoader]
MSIFileName=File.msi

You will need to include InstMsiA.exe & InstMsiW.exe.

HTH
dragontooth

0
 

Author Comment

by:SSC2004
ID: 10903339
Is setup an exe or ini? Where do I include InstMSIA.exe and InstMsiW.exe? in the .msi?
0
 
LVL 14

Expert Comment

by:Tommy Kinard
ID: 10903467
There is a setup.exe and setup.ini
setup.exe is in C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard
<Where do I include InstMSIA.exe and InstMsiW.exe?>    In the root directory of the CD, this is incase the target system has not had the msi runtimes installed

dragontooth

0
 

Author Comment

by:SSC2004
ID: 10903640
Not working, does it need a setup.lst or something?
0
 
LVL 14

Assisted Solution

by:Tommy Kinard
Tommy Kinard earned 600 total points
ID: 10903821
Go to this link. The setup file is there along with the setup.ini InstMSIA.exe and InstMsiW.exe the setup.exe I told you about before was the incorrect one. This ones will automatically install the InstMSIA.exe or InstMsiW.exe as required otherwise it will install your program.

http://www.gbodnar.com/download.htm

dragontooth

0
 
LVL 7

Assisted Solution

by:OHDev2004
OHDev2004 earned 600 total points
ID: 10904273
did u try the way i told you ?
Name=Name of CD ' This is an optional it will be the label or title of the cd which will be displayed ,, you can ignore this line if you want to use the label of the cd.
0
 

Author Comment

by:SSC2004
ID: 11062670
Other problems intervened and I did not have time to confirm these answers, but I believe they will work. Thank you.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question