HOW TO: Creating your MSI installer using Visual Studio 2008

HOW TO: Creating your MSI installer using Visual Studio 2008

So you want to create an MSI installer... As we know from reading the Application Packaging Requirements Guide (http://appdeveloper.intel.com/en-us/article/packaging-requirements), we must provide our entry in a MSI format for Windows entries. I have received numerous requests for assistance in doing this. Here is a simple step by step to create your MSI installer. Step 1 Create a Setup and Deployment Project Let's create our new project. Right click on your solution in the Solution Explorer on the right hand side of your Visual Studio IDE and select Add -> New Project. From the list of project types, choose Other Project Types -> Setup and Deployment -> Setup Project. Step 2 Setup Properties We would like everyone to know who created this installer. Click on your new Setup and Deployment project in the solutions explorer. Now you will see in the Properties windows (Just below the Solutions Explorer usually), settings for Manufacturer, Author, and Title. Fill these in as appropriate. Step 3 Add Project Output & Content We want to include our project .exe and all required content files. Right click on your Setup and Deployment project in the Solution Explorer and choose View -> File System. Right click on the Application Folder node and choose Add -> Project Output. Choose Primary Output, this will include your .exe. Repeat this step and choose Content Files if your project has required content such as images, audio, etc. * Special Note: In your Application project, ensure all required files are marked as Content. This can be done by selecting the file in the Solution Explorer and setting the Content property to True. We need to include our icon to use in our shortcut later. Right click on the Application Folder node and choose Add -> File. Browse to your icon file and click OK. Step 4 Create Shortcuts Another requirement is to include a shortcut to our application. Fortunately this is quite simple. With the Setup and Deployment File System tab still open, right click in the right hand pane to bring up a context menu. Choose Create New Shortcut. From this dialogue, navigate into the Application Folder, and choose Primary Output from "Project name" (Active). This will point the shortcut to your .exe. Click OK to accept this selection. Let's give that shortcut an icon as well. Click on the shortcut you just created in the right hand pane. From the Properties window you may select an icon. Click Browse, and navigate to the Application Folder, and select the icon you added to the File System back in Step 3. If you wish to have a shortcut in the users Start Menu, repeat the steps above, substituting the User's Programs Menu node instead of User's Desktop node. Step 5 C++ Runtime (CRT) This step is critical for validation. The ATOM SDK requires the C++ Runtime to execute. Fortunately our Setup and Deployment project makes this an easy addition. Right click on your Setup and Deployment project in the Solution Explorer and choose Add -> Merge Module. You want to add two merge modules, one for CRT Release, and one for CRT Debug. These are labeled: Microsoft_VC90_CRT_x86.msm Microsoft_VC90_DebugCRT_x86.msm * Special Note: If your application requires additional merge modules or runtime that is not automatically detected, this would be the time to add them Step 6 Build The easiest part of this exercise. Right click on your Setup and Deployment project and choose Build. If all went well, you will have a nicely packaged MSI in your output folder ready to upload to the App Store. IMPORTANT DETAILS ON SILENT INSTALL REQUIREMENT One critical requirement in the validation process is that your MSI installed silently. You can test this by opening a command prompt, and executing your MSI using the /qn switch. Example: c:\MyApp.msi /qn If it installs without displaying any user interface, you have succeeded in this part of the validation * Note: The use of the /qn switch has not been confirmed by Intel yet. If you have any problems please do not hesitate to ask. Best of luck!
56 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Brian,

Thanks for the information. Can I ask how to convert .exe file to .msi format?

Linda

Hi Linda:
It's "Package" .exe to .msi, not "convert".
see this: http://appdeveloper.intel.com/en-us/article/how-creating-your-msi-installer-using-visual-studio-2008

I'm currently using VS2010. I was able to create an MSI installer following the instruction above. Unfortunately, the installer fails when attempting to run in any form of silent mode. MSIExec says the user does not have enough privileges. When run from Explorer, I get the UAC screen. Will the UAC cause validation to fail? I've removed all dialog forms from the installer, so there is no user interaction during installation. But the user has to give the installer the proper privileges in order to run.

So, I found the thread that talks about this issue at http://appdeveloper.intel.com/en-us/node/1035. I'll continue my questions on that thread.

In light of the existing bug I can however offer you two work arounds that will allow you to submit a program that requires administrator access.

1.) Permission check and elevation of primary process

This is the simplest method, and will require the least amount of development work

a.) Primary binary is executed without a manifest
b.) Upon initialization the application checks whether or not it has administrator access
c.) If administrator access is not detected, the user is presented with a dialogue box alerting them to this fact
d.) The dialogue box allows the user to click a button (with the standard UAC shield per MS best practice) to launch the application with elevated permissions.
e.) The app is launched in a new process which specifies elevated permissions and the user is presented with the built in UAC dialogue.
f.) [Optional] Binary is signed with a certificate, which once accepted by the user will prevent the UAC prompt from re-appearing

2.) No permissions check, separate process (exe) used for actions requiring elevated permissions

This method may require more work however it presents a smoother user experience

a.) Primary binary is executed without a manifest
b.) GUI behaves as usual
c.) As functionality is executed which requires elevated permissions, a new process is started (separate worker .exe or command parameters for primary .exe).
d.) The worker .exe process will display the UAC dialogue as needed
e.) [Optional] Worker .exe is signed with a certificate, which once accepted by the user will prevent the UAC prompt from re-appearing

Please let me know if I can assist you further.

This is a very useful article. Thank you.

My pleasure. If you have any requests for a certain topic, please feel free to post it. Best of luck.

Thanks for this, it really helped me to get my first game onto AppUp (it passed validation today!). I was struggling with free installers before and decided to use VS2008 in the end, not having used VS to make an installer before this was a Godsend!!

Thank You Mr. Brian,

Your tutorial was very helpful.

I would be really grateful to you if you could help me with one minor problem. I have been trying to customize the icon of the application or exe file. Or, in other words, I have been trying to associate an ico file with the .exe file of my project, but I have been unable to do so.

I had quite easily customized the icon of the shortcut of the application by following the steps provided by you. It would be really helpful if you could provide me the steps of customizing the icon for the application(.exe) file.

Thanks,

Sankalpa Ghosh

Sankalpa,

In Visual Studio 2008 (C++ Project) you may change the executable icon using the following instructions:

http://stackoverflow.com/questions/320677/how-do-i-set-the-icon-for-my-application-in-visual-studio-2008

Hello Mr. BrianDevArch,
I read some articles in this forum about MSI deployment application. But I still have problems do use setup and deployment tools on visual studio 2005 professional.
I created a project on visual studio 2005 and my project is MFC application. After I finish my application I try to build a setup program on visual studio 2005. I use instruction like http://appdeveloper.intel.com/en-us/node/733 but I can't have success. When I create my setup project I include x86 runtime library. When I try to install my application on new computer my application doesn't work.
Could you help me with this subject?
Thanks in advance.

Thank you Brian.

You are quite welcome. I hope your project is coming along well.

Update: I posted a quick screencast on creating shortcuts in your Package and Deployment project: http://appdeveloper.intel.com/en-us/node/1207

Intel, may we make this thread sticky? Thank you.

Hi Intel Team,

I have used the steps described by brain and I appreciate his time and efforts involved.

The above information was helpful and worked very well for me without any error, I think this should be considered.

Thanks,
Khan

Khan

Hi BrianDevArch,

Very Nice tutorial steps to build the msi using Visual Studio. We have to select the merge modules for both debug and release mode (x86).

I'm calling the dll of 32 bit using the vb.net/c# code. I have included x86 merge modules as mentioned..As I tried installing in a system(32 bit). It works fine. but when we install in 64 bit, it installs while running the app, it gives error ie in the part of the code when we try to access the dll.

Whether all the net book model comes with Intel ATOM 32 bit mode. Sorry I don't have the Intel ATOM Net book for now. Soon will get for it or if the intel offers any such through the challenge program :-).. Thanks and I like the forum message very much to share and exchange knowledge among people at the Intel Family and around the World.

Thanks,
Vijay

Hello,

normally I'm using Inno Setup for creating my application setups. But because Inno Setup can't create MSI files I had to use the Visual Studio Setup project to create the MSI installer, too.

That's quite straight forward most of the time, but for one product I had to run another installer (to install a driver) at the end of the product installation. That's very easy with Inno Setup, but quite unhandy with a Visual Studio Setup project. Anyway, this can be done with a CustomAction.

So if someone else came across this problem, just reply to my post here and I'll do a short tutorial on that.

Best regards
Andreas

Thank you very much BrianDevArch

Your quite welcome.

Is Installshield going to be supported ? Anytime soon ? We don't have the time or inclination to port our application to MSI and per your validation checklist, MSI is a requirement.

Anonymous,

MSI is a deployment standard. Visual studio 2008 is the supported IDE at this time. Installshield can create MSI's quite effectively. As long as it complies to all packaging requirements I see no reason why it would not pass. Best of luck.

Andreas,

I am actually interested in seeing a tutorial on the subject of driver installation. I can see more of this being needed as device specific applications are developed for the AppUp store.

Anonymous,

InstallShield is not currently supported. However using it may not always cause your applications to fail validation as long as you have the correct MSI and there are no issues while installing/uninstalling the application from the AppUp(SM) Client.

Regards
Rooven

Intel® Atom™ Developer Program
Intel® AppUp(SM) Beta Center

Regards, DG Rooven

Vijay,

64-bit is not supported by the Atom SDK at this time to my knowledge. Your solution may be to compile the SDK portion in a seperate DLL, built as 32-bit, and call it fro myour 64-bit application. Please feel free to reply if I can be of further assistance.

Hello Brian,

OK, then I'll make a short tutorial in the next days regarding that.

Best regards
Andreas

My Application is need to install the some other packages also. How can make it msi file including that.
Thks

Thank you all for helping...recently I have submitted one of my application but it got rejected as it was not working on XP. But in Windows 7 its working fine.
In xp it is showing "the procedure entry point xxxx could not be located in dynamic library xxxx.dll"

How can I solve this problem.
I have used QT plugins in VS 2008 to make the app.

Kazafi,

What type of packages are they? Installers? Libraries? Content? Merge modules. Please provide more detail and I will do my best to assist.

Amrit,

Please describe how you are deploying your dependency DLL's and the complete error message (or screen shot).

Praveen Kundurthy of Intel would like us to have the Windows Installer place several text files and our database in Program Data\company name
as opposed to Program Files\company name\app setup name.

He seems to have configured his test machine so that the user that he installs with can write to Program Files but whatever user he later runs the app with has no write authority in Program Files. We will likely add a quick inspection of what access privileges a user has to our apps but we were wondering if there is an indication of how to direct files to ProgramData during Setup. The Microsoft folks said not on a touchless install.

Mark,

If I understand the question correctly, you would like to place certain files in an application data folder in your Visual Studio 2008 Package and Deployment Project (MSI)?

This is a good one to review while retracing my steps to submit to validation after rerun through beta, Thanks

georgeingram

I was getting this error : “The procedure entry point wcscpy_s could not be located in the dynamic link library msvcrt.dll.”
When I made the msi file in XP & run the app in XP & 7. It is working superb. But not in reverse. What could be the reason for that?

@mark,

Where you able to resolve the issue you mentioned?

Congratulations. What is the name of your title? I will have a look.

Hi!
I've developed an application using Visual Studio 2008. I've downloaded some files using this application. I've created an installer for this application using Visual Studio Deployment Project. I've also added an Uninstall option to the Setup using msiexec.exe. This uninstalls only the files which were added to the setup project. The files which were downloaded by me didn't get deleted. What to do to uninstall completely(including the files downloaded by me)?

Hi,

Thank you for sharing an excellent piece of work with us. I really appreciate that.

There is one little thing that i would like to ask. I tried creating an installer using Setup and Deployment -> Setup Project (MS Visual Studio 2008). Here I added two dlls and set their Register property "vsdrfCOMSelfReg". Installer is working perfectly, and I can see the entries in the Registry. However, they do not bind with the installer i guess because when i try uninstalling the componenets, they do not get removed from the registry. Can you please help me with the uninstaller that can unregiser the components?

Thanks in advance

Hello Qirat,

as long as the "Permanent" flag is not set to "True", the file should get removed upon unintallation again.

Best regards
Andreas

The first one to get through was "Search-Lite" but due to an error on my part it's not yet published. Three have gone through since using your advice here "The Last Stand", "Soma" and "Leapfrog". All puzzle games except for TLS which is a 3rd/1st person zombie shooter game.

Excellent feedback, I will have to review them later today. Thanks.

Hello RatKrish,

I'm using customer actions to do some additional clean-up steps at the uninstall stage. Here you could also delete the folder with all files.

Best regards
Andreas

Brian - has anyone tackled using VS2010 to build an MSI? For one thing, the merge modules are disappeared. It appears they are not needed (need not be explicitly included in the MSI) according to Microsoft. Would they still be needed by the Intel interface? It turns out building an MSI on a 64 bit machine when you have bit-specific dlls (SQLite and other DBMS interfaces, for example, come in 32-bit and 64-bit flavors) takes some care: you have to test with the 64-bit dll then build the MSI with the 32-bit dll.

Has anyone attempted to build an MSI with VS2010?

Microsoft_VC90_CRT_x86.msm
Microsoft_VC90_DebugCRT_x86.msm

have been replaced in C:\Program Files (x86)\Common Files\Merge Modules with
[note that the x(86) fork is necessary]

Microsoft_VC100_CRT_x86.msm
Microsoft_VC100_DebugCRT_x86.msm

For fans of VS2010 it appears that Merge Modules are not needed. We'll see how validation goes, but beta results are positive. If developing
on a 64-bit machine you'll want to get into Configuration Manager and set the Target to x86. This influences the dlls used both during
development and during the build of the MSI.

I've created the MSI using the Visual Studio 2008. It works and installs in my development computer. I've uploaded the msi several times to the intel atom store. This time also the validation status failed. As they say ILU01 Application Launch error "Install is not silent on win 7-user authorization pop up is occurring, also getting error message during install."

I tried the command line

Example : c:\MyApp.msi /qn . nothing happens to me.

I don't have a Intel Atom Netbook now.

Thanks,
Vijay

Vijay,

Ensure you have included an application manifest if required. Below is part of a blog post explaining the silent install requirement a bit more:

At last you are ready to submit your ATOM entry. You have created your MSI installer, and you are reviewing the Packaging Requirements document to ensure your hard work will pass validation the first time. As you are reading you see "Silent Install..", and either wonder what this requirement means or think you have it covered. Read on as I explain this requirement and how to address it in a Visual Studio 2008 Package and Deployment project.

Why do we have this requirement?

The AppUp platform Intel has provided (Formerly referred to as the App Store), functions as an interface for end users to download our apps. As such it also has the duty of launching our MSI installers once the user has download our application. A seamless flow from searching, downloading all the way to running your application is expected by the user. The UI through this process remains consistent in both style and functionality. The reasons for a silent install requirement include:

1.) A consistent user experience. Users are presented with the same installation experience whether they are installing a game from XYZ company or a utility from 123 Corp.

2.) Tight integration with the App Store. The MSI standard allows for parameters including installation path, culture and more. The App Store handles these things for us, and removes the burden of clicking through the installer wizard for the user.

How can I test my MSI to determine if it will pass this validation requirement?

This is quite simple. Execute your MSI, then answer this question.

"Was I required to click anything during the installation process?"

If you answered NO, congratulations your MSI will pass this requirement. However, if you answered YES then you may want to read on for a relatively easy fix.

* The following screen shot depicts an MSI which would pass this validation requirement. Note that no user input is required for the validation to complete.

How do I implement this "Silent Installation" in Visual Studio?

Fortunately this is quite simple and should not cause most installers implementation problems (See below if you find yourself in this situation)

1.) Open your Visual Studio Package and Deployment project.

2.) Right click on your project in the Solution Explorer and select View -> User Interface

3.) Remove all dialogues

4.) Recompile and test for validation compliance (* See above)

Implementation Problems

Some MSI installers prompt for additional information from the user during the installation process. This will cause validation to fail. What can be done? Simply move this data collection logic into your program so that it is executed the first time your app is ran. Although slightly inconvenient, it is a viable solution adopted by several ATOM developers to date.

Brian - I had an app rejected because it tries load version 4.0 of the dot net framework. This seemed a bit odd as I had checked the project references and none were for version 4.0. After some rooting about it turns out that different versions of VS2010 handle things slightly differently. For your other Windows code-slammers

1. In the code (not Setup) project (of course) click Properties and click references

2. Next, in the SetUp Project click Properties

3. Down to the right click Prerequisites

4. there are two separate checkboxes for Framework 4.0 that should be unchecked

5. if changing, then rebuild and re-do the code signing

What I would like to be able to do is distribute my setup.exe created in the deployment project and have it point to the msi file on my website. I would have thought that was what Installation URL was for, but it doesn't seem to work for me.

Is there a way to do this?

Dan

For Intel AppUp, you need to submit .msi file.

页面

登陆并发表评论。