Has the NSIS execution level requirements changed for Windows 7? - permissions

I have a .nsi file I use to create my installation exe. I had given my file the follow execution level in the past (and it worked successfully):
RequestExecutionLevel user
This was so that it could be installed as a local user version or by admin on all accounts.
I was recently releasing another file with the same layout (i.e. copy files to install folder/create start menu short cut/HKCU register for install) it now requires RequestExecutionLevel to be set to admin or highest. When I checked with my other installer I found this was the case there as well now.
Why does my installer NOW require a higher execution level?
Has a recent windows update changed the RequestExecutionLevel required?

The RequestExecutionLevel NSIS attribute just sets the RequestedExecutionLevel node in the manifest and should work exactly the same in 7, 8 and 10 so there must be something else going on.
Have you tried watching the installer with Process Monitor to verify that you are writing to the correct location?

Related

AHK-Studio stuck at downloading

Downloaded the AHK-StudioMaster.zip from Github
AHK-Studio directory-- https://ibb.co/r4QK2x2
Stuck at this download screen -- https://ibb.co/M5nLptC
using Win 7 64bit.
AHK version 1.1.33.09
You need to let the main AutoHotkey executable (or AHK-Studio.exe if it's compiled) through your firewall so that it can update and download its dependencies. It does this on every startup, but you can disable it by creating an empty file called NoUpdate.txt in AHK-Studio's directory (where AHK-Studio.ahk is located)—but you'll probably want to let it update at least once after a fresh install, or else the themes and languages won't be set correctly and you might not be able to see/read it.
Try this link: https://github.com/maestrith/AHK-Studio/archive/master.zip
This link works for me, the other one may be down atm
Since this only happens with Windows 7 fresh installs (or without security updates).
Here's how to fix:
Install 2019 security updates
Some other updates provided by ProtonVPN (while installing it will automatically install required updates)
These 5 updates in order.
After installing these three, AHK-Studio can now access internet connection and complete downloading process.
Mission accomplished!

MSI Installer revert the modified installation files if application starts with other user

I have a scenario,
On a particular machine, I am installing my custom software with MSI installer. MSI installer is created with PerMachine tag, so software is available for all the users of that machine.
Now,
I installed the software on C:\MyApp\ directory.
Then I modified a few configuration files present in C:\MyApp\Config folder to make sure the software connects with my other services.
I started the application, it's working fine.
Now, on the same machine, I logged in with another user.
I started the application.
MSI windows popup with some progress bar for installation.
It vanishes and the application starts but fails to load.
But all the files I have modified are reverted now, I need to again modify those.
Few points:
My installation direcotry is C:\MyApp, not any custom user directory. So modified files should be for all the users.
I think MSI is rolling back changes when I logged in with the new user.
How to stop this?
Please help
Self-Repair: Windows Installer self-repair is the cause of the behavior you see. See the link for an explanation of what happens. See more here - several links with information on self-repair from various angles.
Short Explanation: Essentially the launching of an advertised shortcut triggers an integrity check of the installed files and if a file or registry setting is found to be missing a self-repair ensues. It will put in place missing files and settings. During this process it will sometimes overwrite changed settings files - the problem you describe (due to various file overwrite oddities of Windows Installer - a long answer with various hints).
Fix?: My preferred fix for this is to not install the settings files and update them, but to rather have your application generate them on first launch - either one file per user or a shared one for all users. You can also use a read-only copy of the settings file that you install to copy to a new file that you generate and update. I also recommend you put these files in a writable location in the user profile and not in the main folder. Your setup will never interfere with these generated files. You can also try to set the hosting component for the files "permanent" and "never overwrite". Not very neat. Here is a whole rant on the subject. The very best solution - in my opinion - is to keep settings in databases and get them on launch. This allows good control of all settings. Look out for network and firewall issues.
I hope this answers your question. Are you installing IIS files? I find commercial tool Advanced Installer to have the better feature list for IIS installation - though I lack enough data to conclude. Some videos here: https://www.youtube.com/c/advancedinstaller/search?query=IIS - WiX is also very good, but without the nice GUI of Advanced Installer.
Note: you really should not install to the root of C:\ anything at all. Windows Installer actively tries to make it hard, and side-effects are likely. You can, however, target the IIS folders - wherever they are located.
Update: I found this old answer on how to allow selective update of settings files - I had to resurrect the linked forum answers from Wayback.

Installing multiple instances of an Application with Wix Toolset

I simply need to install multiple instances of my application saving them in different folders, with no shortcut on desktop.
In other words, when the App is already installed in a Folder, if I double-click the .msi file once again, the installer shouldn’t ask me if I want repair or remove my App, but it simply should permit to install it in a new folder.
How can I solve this problem?
I used to work with this kind of installations before, and I would agree with #Nikolay - it is rather an exception, than the rule when it comes to Windows Installer based installations. Component rules are often tricky to follow, and multiple instances aspect adds some complexity on top. So, think twice before you go this road.
Being complex, it is still possible. Years ago I published the article of how to start authoring multiple instance installations with WiX 3.6. Note that this version of WiX simplifies it significantly. It's not a short read, so here is a quick digest:
You won't be able to achieve the "install each new instance with double-clicking MSI file" behavior. You have to have a bootstrapper - something that passes correct command line parameters to msiexec.exe.
Don't try to support unlimited number of instances - try sticking with reasonably big number. Do you imagine someone installing your app 10 times on a machine? 50? 100? Make a sane choice - this will be the number of your <Instance/> elements.
Although you only have to decorate non-file data components with MultiInstance attribute, I don't think it will break if you add it to all of your components.
Although I explained the patching of multiple instances in that post, I would only use it in production if I had no other choice.
What you are asking for is not normal in Windows. Normally, each program (product) is installed only once. I.e. each installation package has it's ID (called "ProductID"). If that ID already registered in the system as installed, the system will not allow you to install the second product with the same ProductID, but start change/remove.
What you can do:
Don't use Windows Installer (and WIX), use ZIP for example, or some self-extracting archive, or some other program which does not register installed product in the system.
Use command line to change product id before installing if you want MSI and Windows Installer for whatever reason. Try googling on "use transforms to install the same MSI multiple times". Thus you can have the same MSI per-transformed before installation, so that it looks as a different one to the system.
Install per-user, if that's good enough for you (i.e. don't install to Program Files, install to user folder)
Maybe there are other options...

Installer created with Wix fails to be installed as system

I have a quite simple installer created with Wix Toolset. My users complaints that they can't deploy this installer as system user. They have to do it as user. However, I have learned that installers can be deployed as system user. Could anyone tell me what I need to do in my wxs file so that they can deploy it as system user?
We typically deploy our MSIs using Microsoft SCCM as SYSTEM. We use PSEXEC to invoke a CMD prompt as SYSTEM to do our dev testing before sending it to SCCM. There are two reasons an installer would fail as SYSTEM:
1) User error: I can't tell you how many times I've seen packages put into SCCM with invalid command line arguments. One of my favorite is quotation marks get turned into Unicode quotation marks via email transmission. Another is logging to a directory that doesn't exist. Another is forgetting to tell the MSI to run silently. It just sits there and hangs. Another awesome one is typing the MSI name wrong. It's especially awesome because they almost give me an SCCM log when I ask for an MSI log. No MSI log means it's not the MSI's fault.
2) Installer design error: Have you tested your silent installs? Do you have any custom actions that make assumptions about the user context / environment? One of my old favorites (not) was InstallShield InstallScript custom actions that would fail due to a poorly designed DCOM interface for talking to the MSI session handle. It's been almost 10 years since that was fixed but I still come across installers now and then. Another example is assuming that the user will have rights to another machine or the internet (SYSTEM typically has neither in a corp environment.)
I'd start with testing as SYSTEM using PSEXEC. Log the install and see what the error is. Otherwise you haven't really given us any details to give a specific answer for.
You should get them to do a verbose log of what happens when they do the install. There are issues sometimes related to user specific locations, for example a file going to the user's personal folder, what does that mean for the system account? Or the install or a custom action may assume that a drive letter mapped for a user is system wide (they're not - they are per user) and that can cause errors. That's what Chris is saying too - the context matters. The system account does not have access to the interactive user's desktop, the network, profile locations that make no sense for a non-interactive account and so on.
I also am a SCCM user and regularly deploy apps through SCCM... This WIX installer also drived me crazy. But Christopher's reaction helped me...
1) If Wix installers get tested using PSexec, they probably work, SCCM, I don't know what it is, but installs keep failing without apparent reason. (but it fails installing as System is true)
Solution: incorporate psexec in your script in SCCM...
add your setup.exe & psexec.exe in your source folder. Use following syntax in your setup script:
copy psexec.exe to your software source location.
%~dp0PsExec.exe -accepteula \127.0.0.1 "%~dp0setup.exe" --quiet
2) #WIX dev team: also try to test with SCCM!
3) if above fails, you can also extend the suggestion with:
add following syntax in your setup script:
c:\windows\system32\net.exe user /add WixHelpInstaller PaSSW0rd
c:\windows\system32\net.exe localgroup administrators WixHelpInstaller /add
%~dp0PsExec.exe -accepteula -u .\WixHelpInstaller -p PaSSW0rd \\127.0.0.1 "%~dp0setup.exe" --quiet
c:\windows\system32\net.exe user WixHelpInstaller /delete

Adding software setup to installer

I'm writing an installer for an application. Most of the installer is done and working, but I have on more step outstanding. I need some way to add a setup window to the installer, that will take user input like server address and port, etc. and write these to the relevant files for system start-up. This preferably done through a GUI of sorts inside the installer.
I've tried creating an executable file that runs after installation, but this does not always execute on different systems.
Is there a way to add a GUI to the installer itself that executes after the directory structures and files have been put into place?
Thanks in advance.
In general you should seriously consider doing this as a standalone app that runs when the app first runs and needs configuring. Then it's a program that runs in a user context and can be tested and debugged in the normal way. At least consider what the user is going to do if they want to change the server address or the port - will they need to uninstall your app and reinstall it just to change the server details or the port?
The GUI may not run correctly when started from the install for a number of reasons. It may be initiated with the system account if it's a deferred CA. It wasn't started from the interactive user shell, so it probably won't have any idea of a working directory. It's being run from an msiexec.exe process running in the system directory and maybe with a system account - that's not really the place to be doing your GUI configuration.
I assume you're using WiX, it doesn't say so in your question but it's tagged with WiX.
I would have a read of http://wix.tramontana.co.hu/tutorial/user-interface-revisited (or http://www.dizzymonkeydesign.com/blog/misc/adding-and-customizing-dlgs-in-wix-3/ has a relatively easy to read example), you can add or edit any of the dialogue boxes in the installer, you'll need to download the source to get at the built in dialog, and it does require some "play" to get everything quite right but worth it to get a professional looking installer.