Internet Windows Android

How to run files with the .msi extension. Creation of msi-packages and installation of any software using Windows group policies

Good day, Habr! I want to present an interesting, in my opinion, way of creating msi-installers for any software and, as a result, deploying it using GPO tools. Let me emphasize that the described method does not imply the creation of "snapshots" of the system, but uses native software installers, and only free for commercial use products are used to create msi.

Introduction, couple of links and disclaimer

Every normal software installer has the ability to automatically install with certain or default parameters. The essence of my method is simple and consists in packing the native installer into an msi "container" and launching it with the necessary command line parameters. There is a lot of information on the network on the automatic installation of this or that application, and I will not dwell on this. Again, our goal is to install software using Group Policy. By the way, some of you may argue that the installation can be done through ZAW, but, unfortunately, this method is applicable only for installation with the rights of the current user and cannot be used for centralized automatic installation of applications.

An interesting series of articles on installing software via GP. For beginners, I recommend that you read everything, so as not to ask later what is the difference between the type of installation "assigned" from "public".

Necessary software. Exe to MSI Converter freeware and well-known orca The first one is needed in order to create msi from exe, and the second - so that the resulting msi-nickname can be installed through group policies.

The method does not claim to be completely unique and in some places there may be excesses that could have been avoided, but this is due to the lack of desire and need to delve too deeply into the parameters of the msi package tables. The initial goal was to quickly find a free way to create msi, and after several hours spent reading foreign forums and endless reboots of the virtual machine, the method was found. Also, the article is not an overview of the program interface, and you will not see screenshots.

Package creation and preparation

An example installation will be made for Mozilla Firefox, since this is a well-known product that does not have an msi installer from the developers.
  1. Run exe to msi and specify the path to the exe-installer of firefox in it. According to the information previously found on the network, it becomes clear that it is possible to quietly install firelis with parameters -ms -ira... We specify them in the second field exe to msi and click "Build MSI".
  2. It would seem that the msi package is ready. Indeed, by running the resulting result, we will get the firefox installed in the system and it would be possible to put a full stop in the article. Unfortunately, not everything is so simple. The current installation package is not suitable for deployment via GPO, and when you boot your computer, you will receive absolutely nothing explaining errors in the logs "an unrecoverable error has occurred ..." msi "not by the rules".
  3. Well, let's take an orc and open our MC in it.
  4. First of all, we find the table in the left list Property and pay attention to two fields - ProductCode and UpgradeCode... These two fields must be unique for each product, and our exe to msi always generates the same. Well, it doesn't matter, click on the top menu View -> Summary Information, we find the field PackageCode and click New GUID... Copy the resulting result to the clipboard and paste it into ProductCode... Repeat for UpgradeCode and finally for himself PackageCode... Right there in Summary Information rule the field Title on Mozilla Firefox, the rest is optional. This, in fact, does not affect anything.
  5. Again in the table Property me ProductName on Mozilla Firefox (I change the ARPCONTACT and Manufacturer). You can also put the correct value for ProductVersion.
  6. It seems that the GUID and other "IDs" have changed, but as practice shows, this is not enough. Click on orca Tools -> Validate, take off the bird Show INFO Messages and press Go.
  7. As you can see, a bunch of errors have come out for the presence / absence of some tables and values. I didn't bother and just took the first small msi that came across (7zip x64 9.20) and copied 4 missing tables from there (via Export-Import, of course): _Validation, AdminExecuteSequence, AdminUISequence and AdvtExecuteSequence... In fact, I'm sure that you can create a "correct" msi installer, without unnecessary garbage, but do not forget, our goal is just to run the native setup of the application in quiet.
  8. After adding tables, go through again Tools -> Validate(by the way, the first time you don't need to check at all and just import tables). If you also took the msi from 7zip as a basis, then the result will be six errors that need to be eliminated. Click Close, remove unnecessary fields marked in red.
  9. At the end, you can check the validation again and make sure that there are only non-interfering warnings left. Save msi.
  10. That's basically all, it remains to add msi to the GPU and assign the necessary properties.

Nuances

  1. When installing using the method described above, you will have two copies of the software, as it were. The first is the actual application you need, and the second is the original msi-nickname, because we kind of installed it. In principle, this does not affect anything, except for the display in the "Add or Remove Programs", and then, only in Windows XP (if you have not changed anything other than what I have specified). The downside may be the appearance of unnecessary programs during automatic software inventory, if you use it.
  2. You cannot automatically uninstall the application using the same deployment tools. More precisely, it will work, but only the already unnecessary msi container will be removed. Well, you can tinker with the msi properties when creating it, so that it grabs the previously installed application with it, just as quietly. I did not set such a task.
  3. When installing software updates, it is necessary to indicate in the properties of the GP application so that it replaces the previous one, that is, it must first delete the old one. This ensures that you will not have those same left-hand duplicate applications in the "installation and removal of programs" that did not give up to anyone.
  4. To install an application that has a distribution of several files, you will first have to pack it into an exe, which, when launched, will unpack itself and give a command for a silent installation. I recommend creating sfx archives using the same 7-zip.
  5. Nothing prevents you from installing software through startup scripts. Moreover, this method is more flexible, and I have been using it for a long time through my scripts. However, using the native GPU tools is much faster, since a simple creation of an msi from an exe takes a couple of minutes.
  6. Windows 7 for some reason does not write "Installing a managed application ...", but simply says "please wait". At the first deployment of the entire heap of software at once or when installing a heavy application, this can prompt the user to call the admin or press the reset button.
This seems to be all, I hope it was interesting, share your experience.

A fairly common problem among users of the Windows operating system of any version is an msi error when installing programs from a file with the .msi extension. In this article, I will describe common problems with the Windows 7/10 / XP installer and options for solving them, as well as make a video on the current issue.

Files with the .msi extension are the usual installation packages (distributions) from which the program is installed. Unlike the usual "setup.exe", the system uses the Windows Installer service (msiexec.exe process) to run the msi file. In simple terms, Windows Installer will unzip and run files from the distribution. When Windows Installer doesn't work, various errors appear.

In general, it pisses me off terribly, tk. after a stupid error message, it is completely unclear what to do next. Microsoft specifically designed the Windows Installer to enhance the installation of programs (mainly for system administrators), but did not properly take care of the smooth operation of this service or even adequate reporting of problems. And now we have to rake it 🙂

Problems may be with the operation of the service itself or may arise during the installation of programs, when everything is configured, in principle, correctly. In the first case, you need to pick the installer service, and in the second, solve the problem with a specific file. Let's consider both options, but first the second.

Msi file errors

Very often errors appear due to insufficient system rights to files or folders. This is not to say that Windows Installer does not work, in this case, you just need to add the necessary rights and everything will work. Just yesterday I was faced with the fact that the downloaded .msi distribution did not want to be installed, while the installation wizard starts successfully, the parameters are selected, but then the system thinks for a few seconds and gives an error:

"Error reading from file" filename "verify that the file exists and that you can access it" (Error 1305). Translated "Error reading from file ... check if the file exists and if you have access to it." Well, isn't he stupid? Naturally, the "Retry" button does not help, and canceling terminates the entire installation. The message also does not carry a special semantic load, since the file definitely exists and I have access to it, otherwise I would simply not be able to run it and receive this message, besides, for some reason, in English 🙂

And the error is that it is not I who should have access to the file, but the Windows installer, or rather the System itself. The solution is very simple:

Now the installer error will not appear! You can add access to the entire folder from which you usually install programs, for example, to the Downloads folder, like mine. We watch a video on solving problems with access rights:

In Windows XP, the Security tab will not appear if Simple File Sharing is enabled. To turn it off, you need to go to "Start -> Control Panel -> Folder Options -> View" and turn off the "Use simple file sharing" option. In the stripped-down versions of Windows 7/10 and XP, the Security tab does not exist at all. To see it, you need to log into it as an administrator.

More ways to solve the problem


The described method will help with different messages, with different numbers. For example, you can see errors like these in msi files:

  • Error 1723
  • Internal Error 2203
  • System error 2147287035
  • Error "This installation package cannot be opened"
  • Error 1603: A fatal error occurred during installation

In all these cases, setting the rights to the file and / or to some system folders should help. Check if the "system" has access to the temporary files folder (you may receive the error "The system cannot open the specified device or file"). For this:

After pressing "Enter" the path will be converted to "normal" and you will move to the real temporary folder. The rights to it should be checked. I also recommend that you clear the temporary folders from everything that has accumulated there, or even better, delete them and create new ones with the same names. If you can't delete a folder, read it, but it's not necessary.

If the Windows Installer service still does not want to work, then check the rights to the folder "C: \ Config.Msi", here the "system" must also have full access. In this case, you might have seen the "Error 1310" error. Just in case, make sure that you also have all rights to the folder WHERE you install the software.

Registry settings and services

The next way to fix the error is to restore the operating parameters in the Windows Installer registry.

To do this, download the archive and run two reg-files from there, corresponding to your version of Windows. Agree to import settings.

Important! It is advisable before the last action! If the method doesn't work or gets worse, you can recover to your previous state.

On Windows XP or Windows Server 2000, install the latest Installer 4.5.

If it doesn't help, then do another re-registration of the components:

  1. Press "Win + R" and enter " cmd ". Then, in a black window, enter the following commands in sequence:
    MSIExec / unregister
    MSIExec / regserver
  2. In response, there should be emptiness, no mistakes. If the problem persists, enter another command
    regsvr32 msi.dll
  3. Close the black window

If he writes that there are not enough rights, then you need to run.

If the commands were executed, but did not help, then run msi_error.bat from the archive, check the result.

The last option is to download Kerish Doctor, which has a function to fix the installer service and many other common Windows problems.

Also, many programs use the .NET Framework, so it won't be superfluous to install the latest version of this package. And, finally, one more tip: if the path to the distribution file contains at least one folder with a space at the beginning of the name, then remove the space. Such a simple trick will solve your problem 🙂

Summarizing

Errors with the Windows Installer are very unpleasant, there are a lot of them and it is not immediately clear where to dig. One thing is clear - the system has failed and you need to restore it to a working state. Sometimes nothing helps and you have to. However, take your time to do this, try asking for help on this forum. Describe your problem exactly, tell us what you have already done, what messages you received, and, perhaps, they will help you! After all, the world is not without kind people 🙂

Errors when installing applications from files with the .msi extension are one of the manifestations of problems with the Windows Installer service (in the Russian version, Windows Installer). Users of all versions of this OS, with the exception of the earliest, are faced with a similar phenomenon. Until now, the problem with the installer is one of the common reasons why users decide to reinstall the system. Let's try to figure out how to avoid this. The reason why Windows Installer is not working may be the following:

  • viral infection, and removing the virus does not always solve the problem;
  • incorrect installation of Windows updates;
  • malfunction of security software, when instead of blocking one suspicious msi file, the installation service is blocked entirely;
  • changes in security policies on the computer;
  • Damage to system files or the registry for reasons not related to viruses (removal of installer components, unskilled editing of the registry, "crooked" software, hard drive failure, etc.).

Checking the integrity of the Windows Installer structure

Windows Installer is represented by the following components:
  • file C: \ Windows \ System32 \ Msiexec.exe - directly by the installer application itself;
  • the file C: \ Windows \ System32 \ msi.dll - the Windows Installer library;
  • by the Msiserver service, whose settings are stored in a registry key.
Before diagnostics, it is important to make sure that both of these files are present in the system, that the above section is in the registry and its parameters have normal values ​​(the values ​​can be viewed in the registry of a similar, workable system). Also open the list of services (press Windows + R and enter the command services.msc in the "Open" line of the "Run" application). Search for "Windows Installer" and make sure it starts. If there are no files, copy them from another system of the same version or from the installation disc. If the registry key is missing or damaged, transfer it from the production system as well. To do this, on a working computer, start the registry editor (C: \ Windows \ Regedt.exe) and find the above-named section. Expand the context menu of the msiserver folder by right-clicking and click the "Export" item. Save the file in .reg format and transfer it to the problem machine. Double-click this file and confirm your consent to add data to the registry. Reboot your computer. If the Msiserver service still won't start, check if the RPC (Remote Procedure Call) service it depends on is running. You can re-register the installer files and restart the service using a set of special commands in the command line. For convenience, you can create a batch file: paste the set of actions into notepad and save as with the .bat extension. To run the file, just double click on it. To make the changes take effect, click on the desktop and press F5.

Checking security settings and access rights

Windows Installer may not work either due to the fact that it is blocked by security software or the operating system does not have the necessary rights. First, let's figure out the software. If you have an antivirus installed, temporarily disable it. Each product has its own disabling methods, but most often this is done through the context menu of the antivirus icon in the system tray. Now let's get into the rights. Open the context menu of Msiexec.exe and expand its properties. Look at the list of groups and users on the Security tab. Among them must be "System" and the service "Trustedinstaller", and the latter must have full access to the file and be its owner. The system must have "read" and "read and execute" permissions. The Trustedinstaller service first appeared in Windows Vista, so in Windows XP, you must give the system full access. Everything written below applies to versions released after XP. To check who the owner of Msiexec.exe is, click the Advanced button on the same tab. In the next window, expand the "Owner" tab. Take ownership of the Trustedinstaller service if specified otherwise. If it's not in the Change Owner To list, click the Change button followed by Other Users and Groups. Enter Trustedinstaller in the "Enter names ..." field, click "Check Names" and OK. Return to the previous window. On the Effective Permissions tab, assign the required rights to the Trustedinstaller and the system. The msi.dll library should have exactly the same security settings. Now let's check if there are any restrictions for the "System" user to access the following:
  • system drive (usually drive C);
  • temporary folders (these are C: \ Windows \ Temp and C: \ Users \ Current_user \ AppData \ Temp);
  • folder C: \ Config.Msi;
  • the folder where the msi file from which you are trying to install the program is located.
The system must be given full access to all these objects. This is done in the same way as we discussed above. After these operations, in most cases, the problem with the installer is successfully resolved. If our advice did not help you, the cause of the failure lies in something else and specialists should already deal with it.

The most common problem that users cannot open this file is an incorrectly assigned program. To fix this in Windows, you need to right-click on the file, in the context menu, point to the "Open with" item, and select the "Select program ..." item in the drop-down menu. As a result, you will see a list of installed programs on your computer, and you will be able to choose the appropriate one. We also recommend that you check the box next to "Use this application for all MSI files".

Another problem that our users also encounter quite often is that the MSI file is corrupted. This situation can arise in many cases. For example: the file was downloaded incompletely as a result of a server error, the file was damaged initially, etc. To fix this problem, use one of the recommendations:

  • Try to find the desired file in another source on the Internet. You may be lucky enough to find a more suitable version. Google search example: "File filetype: MSI". Just replace the word "file" with the name you want;
  • Ask to send you the original file again, it may have been damaged in transit;

The windows installer error is one of the most common pop-up problems encountered by users of the Windows operating system.

The error can appear regardless of your OS version.

Reasons for the error

You can scan the OS using the Sfc / scannow command. You need to enter it in the command prompt window.

You can also start the command line in two other ways:

  • Start -> All Programs -> Accessories -> Command Prompt.
  • Start -> Run and enter the program name cmd.exe

In a few minutes, you will be provided with detailed information about OS disks, corrupted files, problems with services and other system programs.

The command line will not only find damaged and damaged files, but also replace them with workable ones.

After scanning, close Command Prompt and restart your personal computer or laptop. Try running the installation process of any executable file.

Also, Microsoft offers users an automatic utility that can solve the problem of the installer.

Go to the official website of the company https://support.microsoft.com/en-us/mats/program_install_and_uninstall

In the window that opens, click on the "Run now" button. The utility will restore the correct configuration of the installer.

It should be noted that the utility does not work with the eighth version of the operating system.

Configuring installer access to msi files

An installation problem may be caused by the installer not having access to the .msi files. The user can solve this problem on his own.

Follow the instructions below:

  • Find your installation file and right-click on it;
  • Select the properties window;
  • Go to the security settings tab;
  • In the group or user text box, check if there is a user named "system". If it is not there, you need to add the user manually;

  • To add a new user, click on the Edit button and then on the Add button;
  • In the text box for the name of the object to select, write the word "system" (without the quotes). If you are using an English version of the operating system, enter the word System;
  • The entered word should instantly become underlined, as shown in the figure below;

  • Check the box for full access and now click on the OK button;

The installer will now be able to access the executable file. The installation should complete without problems.

Note that in some cases antivirus software can block access to the installation file.

To solve this variant of the problem, you need to log into the operating system under an administrator account, turn off the antivirus and enable compatibility with other OS versions in the antivirus properties settings, as shown in the figure below.

Windows Installer Error - Solutions