2

I want to compress multiple files and directories with wix installer and copy to custome fixed location eg. C:/MyAPP it while installing. I have following directory structure which i want to include into wix msi.

Directory structure:

MYAPPBin

  • myapp.exe

  • demo.dll

  • demo.dll2

Mahesh
  • 97
  • 7
  • Though possible with some hacking this is very undesirable to do, are you positive this is necessary? Installing under **`%ProgramFiles%`** should be possible to accept on modern Windows? Please explain why it is necessary (and I didn't down-vote). – Stein Åsmul May 25 '19 at 12:33
  • yes this is necessary i want keep it fixed path while instaling with msi should not prompt to the user.it should not ask to user to change it.Application is designed like this wau i cant't change myself i just need develope like this way. please do up vote – Mahesh May 25 '19 at 12:34
  • I added all that I can think of below (the things that came to mind). Not all of these items are that common - or even quite sane to list perhaps - but they are all listed just to remember them. – Stein Åsmul May 25 '19 at 17:25
  • "Application is designed like this way": applications that are intended to be installed should be designed to be installed, upgraded, uninstall, reinstalled, …. The user experience is a shared responsibility. Both application and installer should follow Windows guidelines. – Tom Blodget May 28 '19 at 17:14

1 Answers1

1

How-To: I am against installing to the root, for many technical and practical reasons, but here is a description of how to do it: https://support.firegiant.com/hc/en-us/articles/230912267-Install-to-the-root-of-system-drive-

"No Speeches": Oh, let's rant :-). Why you should not do it? 1) Standard: It is not standard. 2) Necessity: It is generally not necessary. 3) Corporate: It will often not be accepted onto corporate machines for failing standards. 4) Support: Accordingly you will get support requests asking if this can be fixed by application packagers for corporate deployment - especially if you have lots of customers and user-base. 5) Technical: Typically you see technical deployment problems during repair, patching and upgrades. 6) Permissions: You will face ACL (permission) issues if you want to write to files in there (check for OS-differences, I didn't check lately) - so you need to apply full write permissions as well - a security issue when it is so in people's face on the root. 7) Tools: Modern deployment technologies actively make it hard to break the rules like this, for good reason - in the end: another wind-mill to fight for nothing gained? 8) Longevity: Future changes in Windows could mean your application no longer runs properly from that location? 9) Bloating: If many software do this it really bloats the root of your system drive and that can really annoy a lot of people - triggering unexpected and accidental deletion. 10) Backup: The product could accidentally be picked up for storage by backup systems bloating the backup - very bad if the product is big (unless backup is desired). 11) System Restore: I have honestly seen system restore mess up whole computers, and I wonder what it does to things that live on the system root? I don't know for sure. A section here on system restore and its lunacy (towards bottom). 12) Windows Updates: Not a great item, but let's list it. We have seen Windows Updates to crazy things like delete user's data before, and it is conceivable that it could cause interference for root folders. 13) Security Software: How does anti-virus and malware scanners like root folders? I have never seen any problems, but they keep adding more and more weird features and suddenly you have problems with something unexpected? (I have had anti-virus tools quarantine my freshly built binaries :-) - vernichtete!). 14) Indexing: For deployment of large numbers of data files, there is probably no indexing on the root of your system drive? (if that is desired). There is no indexing in %ProgramFiles% either, but there generally is in user-profile folders (desktop, my documents, etc...) - if the files you deploy are templates and such. And there are further issues. Much better to install in standard ways?

Anecdotally I can add: Diligent system administrators with cleanup-mania (formal diagnosis that) may delete such folders as part of their cleanup scripts and auditing (especially if you make the folder name mysterious), or at least want to throw out the application, or test moving it to %ProgramFiles% to see if it works. They may allow core security software to install like this, for easy access to settings and tools in there, but that is rare. Developers may accept SDKs installed this way - for the same reason: accessibility and ease of use. Some server software may also be deployed like this for "single-purpose-servers", but then it often goes to another drive than the system drive - such as D: - is my experience. For almost any other purpose it is detrimental - in my opinion and I think I share it with many deployment guys.

"Exceptions": I might opt for a "self-extractor" kind of approach defaulting to "My Documents" if the files you are deploying are to be used to change and modify. Or even the desktop for a set of HTML templates. It all depends on what makes sense, what is useful for users and what can be technically supported without "spaghetti incidents".

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
  • how to compress mutiple directories and files ? – Mahesh May 25 '19 at 14:56
  • Self-extraction was easier before with [WinZip](https://www.winzip.com), [WinRAR](https://en.wikipedia.org/wiki/WinRAR) and others. I am not sure how well these tools work these days - I think there were some security incidents. These days I am not sure what is best. [7-Zip](https://en.wikipedia.org/wiki/7-Zip) has some support (unfinished?) as do many other tools. I have [this old, messy answer](https://stackoverflow.com/a/51757384/129130) (kind of crazy answer) which recommends using **`setup.exe`** rather than self-extraction (different purpose). Sorry, all I got for you on that issue. – Stein Åsmul May 25 '19 at 15:08
  • You could put it on github.com? WiX-toolkit-style if the source is open? Sample: https://github.com/wixtoolset/wix3/releases. You offer different packaging formats for download? (**`exe`**, **`zip`**, **`etc...`**) – Stein Åsmul May 25 '19 at 15:22
  • no i just need to create .msi and msi will have binaries inside it. – Mahesh May 25 '19 at 15:43
  • source is not open anyway – Mahesh May 25 '19 at 15:44
  • A little crash course in minimal WiX markup to compile an MSI can be found here: [Transparent aluminum!](https://stackoverflow.com/a/47972615/129130) The markup towards the bottom with inline comments is usually enough for people to get going. See other resources here: [installdude.com](http://www.installdude.com) (my own experimental site - expand help section in left navigation pane). Also check "WiX Samples" in quick search section towards top. – Stein Åsmul May 25 '19 at 16:45