Domanda

I want to distribute an application (simple one exe file) so that a user installs it once and it'll be installed for all user accounts on that computer. And it should be done without Wix / InstallShield / Setup-project. (Clickonce doesn’t even support multi-user installations.)

How is it done? Registry edit (Which one?), Manually create an msi file (How? Is there a reference guide for that?)?

Edit

My question is not how to have some command execute at installation time. The question is about how does Windows know which applications are installed.

È stato utile?

Soluzione

There are basically two ways to install an application in Windows. Let me call them the old way and the new way.

The old way

You need to manually perform the following steps:

  • Copy all required files to a location accessible by all users, such as C:\Program Files\YourApplication (or \Program Files (x86), if it's a 32-bit application on 64-bit Windows).

  • Install and register all prerequisites (such a the .NET Framework).

  • Create start menu and/or desktop icons for all users by placing them in the appropriate location. For example, for Windows 7 this would be C:\ProgramData\Microsoft\Windows\Start Menu\Programs and C:\Users\Public\Desktop.

  • (Optional) Create an executable that reverses all the above steps (e.g. uninstall.exe), copy it to your program files subdirectory and create an entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall that points to this unstallation exe. This will allow users to uninstall your application.

This is how it has been done for ages. Windows does not know which applications are installed, it just knows which applications can be uninstalled.

The new way

You provide an MSI file, which is basically a database containing information about your software and how it should be installed and let Windows Installer do all the work. Windows 2000 was the first operating system to include Windows Installer out-of-the-box.

Windows Installer does keep track of installed programs, which allows it to do useful stuff such as

  • determining whether a patch fits the installed version,
  • re-install missing files that have accidentally been removed,
  • etc.

Note that the Windows Installer configuration data is not easily accessible, so you cannot just add a few registry entries to "register" your application with Windows Installer. If you want Windows Installer, you need an MSI file.

The MSI format is quite complex, however, which is why tools such as InstallShield, WiX, etc. have been developed. WiX, for example, is basically a XML -> MSI conversion tool. It's still very close to the MSI structure but simplifies a lot of things. (Yes, WiX is complex, but MSI even more so.)

Altri suggerimenti

There is a really powerful open source script-based application to build installer projects. it is called NSIS. you can find it here http://nsis.sourceforge.net/Main_Page

You can simply specify your exe file , from where to take it and where to install it. A comprehensive documentation is also provided within the above link.

I'm not sure it'll be helpful in your case but you can create a logon script. This script will run once the user login to domain.

Please follow this link for details: logon script

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top