I have been looking for a good answer for my following simple enough question.
I have an interactive Wix installer, which works perfect. The user needs to accept the licence agreement in the interactive setup to carry on the setup. Now, I need to have a silent installer where the user will accept the same licence agreement by entering a command line parameter like ACCEPT-EULA=YES.
Could anyone please guide me how I should manage to implement this in wxs file? I am not using MSVC by the way. I have tried
<util:XmlFile Action="setValue" ...
but got tons of different sort of errors.
I'd greatly appreciate any help.
Thanks.
You want an error custom action scheduled first in the install execute sequence with a condition of UILevel < 5 and Not ACCEPTEULA~="YES"`
The UILevel property is defined here. 5 means full UI so you don't want this CA to run. < 5 means some form of silent installation so you only want this custom action to fire when the property doesn't equal (case insensitive) "yes".
<CustomAction Id="RequireEulaWhenSilent" Error="You must accept the EULA by passing ACCEPTEULA=YES when performing a silent installation."/>
<InstallExecuteSequence>
<Custom Action="RequireEulaWhenSilent" Before="AppSearch"><![CDATA[UILevel<5 and Not ACCEPTEULA~="YES" and Not Installed]]></Custom>
</InstallExecuteSequence>
Of course you now have a problem that if they aren't logging the install they won't know why the installer failed. Personally I think this is an invented requirement by upper management and I always push back when given this problem. Otherwise you get into crazy land like this.
I sort of agree with Chris, reject this requirement and put the license agreement inside the main application EXE file with a flag per user for whether the particular user has seen and accepted the license agreement or not.
This is assuming that this is really important legally, because it is a serious annoyance to every user in my opinion. However, arguably having a system administrator accept the license agreement on every user's behalf is probably not great legally. I am not sure how this is handled by larger companies actually. You can certainly ask your marketing and sales guys what they think of this - it is their issue.
I think the conditions suggested could work, but it all depends on where you put the custom action in the sequence, whether you use major upgrade patches or similar unusual things. Ideally you should condition so tightly that the action can only run when it is really intended.
Test at least these scenarios:
Fresh install, both silent and interactive
Major upgrade, both silent and interactive
Uninstall, both silent and interactive
Modify (start from Add/Remove Programs)
And use the MSI condition cheat sheet to help you.
Related
I wish to know if it's possible to display a message when merging a branch with gitlab if a given file has been modified.
To be clearer, if the configuration file has been modified, I might need to update the configuration file on others environment, which is easy to forget. That's why I would like to display "Have you updated configuration everywhere ?" (or something to that effect) every time I merge a branch where the configuration has been modified.
I did some digging, it seems possible to list modified file but so far I have no idea how to display a warning.
Thanks a lot
There is no particular way to raise a custom user-defined warning/message in the MR UI. However, there may be some solutions that might work for you.
Using codeowners
You can use CODEOWNERS and an approval rule that requires approval for codeowners when owned files are modified. That way, every time the file(s) you define are modified, there will be an approval rule that appears in the MR UI. However, it won't include any kind of user-defined message.
Custom approval rule
Another way may be to define a custom approval rule called something descriptive like "did you update the config?" -- however, this would not be conditional based upon whether the file was modified or not; it would show up on every MR.
A custom pipeline job
You could use a custom pipeline job to determine whether a check is needed. This pipeline job, in principle, could make a comment on your MR when it detects the file has changed. Or maybe even analyze if a config file change is needed and fail the pipeline.
A custom service/webhook
For a similar use-case to what you describe, I created an approval rule and a MR webhook for MR events that would, depending on the contents of the MR, automatically provide approval from a bot user whenever human approval was determined to be not required. Though, this requires creating a service to respond to the webhooks.
In other words: if no action was needed, the bot approved the MR for you (satisfying the custom approval rule). If action was required, the bot would do nothing, meaning a human would have to approve to satisfy the approval rule.
Something like a similar comment from a bot user may also work for your use case.
other ways of surfacing information in MRs
Some other features of GitLab cause messages to appear in the UI, so you could (ab)use those features to surface custom-ish messages, like:
Metrics reports in MRs
SAST scanning results in MRs
Maybe some others?
I am attempting to modify a WIX installer package so that it can detect the presence of a specific Microsoft Knowledge Base patch/update, and then offer the user a chance to download and install it on-the-fly if the patch is not detect. My order of operations would be:
Detect if user is installing on Windows 8.1 or not (trivial, compare against VersionNT).
Detect if KB 2883200 is already installed.
If detected, provide a dialogue box offering the chance to download and install the package.
Steps 2 and 3 aren't 100% obvious to me. I've found a possible solution via another StackOverflow post, but I don't understand why both a hash and the KB number need to be provided. eg:
Sample Function
public static bool IsPatchAlreadyInstalled(string productCode, string patchCode)
{
var patches =
PatchInstallation.GetPatches(null, productCode, null, UserContexts.Machine, PatchStates.Applied);
return patches.Any(patch => patch.DisplayName == patchCode);
}
Use
IsPatchAlreadyInstalled("{F5B09CFD-F0B2-36AF-8DF4-1DF6B63FC7B4}", "KB2468871");// .NET Framework 4 Client Profile 64-bit
IsPatchAlreadyInstalled("{8E34682C-8118-31F1-BC4C-98CD9675E1C2}", "KB2468871");// .NET Framework 4 Extended 64-bit
IsPatchAlreadyInstalled("{3C3901C5-3455-3E0A-A214-0B093A5070A6}", "KB2468871");// .NET Framework 4 Client Profile 32-bit
IsPatchAlreadyInstalled("{0A0CADCF-78DA-33C4-A350-CD51849B9702}", "KB2468871");// .NET Framework 4 Extended 32-bit
So, the first part of my question would be: How can I use the code above to detect if the KB 2883200 patch is installed, and how do I generate the appropriate hash/UUID for the first argument passed to the function?
Next, I am trying to make a modal dialogue box appear, offering the user the chance to install the patch? If the user goes "Back" in the installer, I'd like the dialogue to re-appear when reaching the appropriate step again, in case they accidentally declined the offer to install the driver.
For the second and final part of my question: how do I provide such a dialogue box, and is there any existing method to download and install a MS KB patch through the installer, or do I have to implement my own methods from scratch?
Thank you.
The dialog box will be a dialog that you insert in the MSI UI sequence and show it if the update isn't installed, an publish the dialog with a condition. A potential issue with doing any of this in the UI sequence is that you won't be elevated, so if elevated privileges are required for this you may be in some difficulty.
I think Tom's suggestion is the way to do this - make it a prerequisite for which you build you own executable to check for it, integrate that with Burn.
Either way, to check for and install the update I'd use the Windows Update API. The update is available through Windows Update, and this kind of thing tells you if the update is applicable to a particular system and will also download it:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa387102(v=vs.85).aspx
We need to find the user who has installed msi using powershell.
I was trying to search via HKEY_USERS ,but it is providing sid of the user not the user name of who installed the msi.
Is there any way to find the Installed user ?
(If you have a sid, you can find out the user name, why not?)
But the best way, if the msi is yours, is to save that information during the setup in a registry value, or .ini file you can read out later.
There are two properties, "LogonUser", and "USERNAME", the latter is the user really installing.
If you have no influence on the msi itself, I am not sure, if it is so easy. Interpreting sids seems a good way then.
Nevertheless:
The standard way is to use the API routines MsiGetProductInfo() or MsiGetProductInfoEx(). You can google in MSDN. But I am not sure if they always contain information if these data were not registered during setup dialog. So maybe they are empty after a silent install if there was no registration dialog? I have never used them to find the user who has installed as software. Normally in own setups this is done with explicit dialogs or actions.
One of the way might be by using reg key but there is a function in the windows installer API called MsiEnumProductsEx
you have to specify User SID it querys and checks all installed product for all users
I'm working on a new Cydia tweak, It'll be paid! The problem that I don't want it to be cracked/pirated/redistributed. Are there any scripts I can use in my tweak?
Few examples:
A script that will mail you a log securely to know if the user bought it or he got it cracked.
A script that will check your payment in a database, if it's exist then the tweak will be activated on the device, if not then the tweak will be disabled.
A script with UIAlertView that checks if you bought the package from Cydia Store it will activate the tweak, otherwise it'll open a pop up with UIAlertView to tell you that "You got this package with an illegal way, Blah Blah Blah.." and then when you click the "OK" button it'll take you to safe mode till you uninstall the tweak or till you buy it from safe mode. (Most important one)
You can't really protect software from being cracked. It is always a race between stronger and stronger DRM (and usually more annoying to legit users) and the crackers to see the challenge and do cracking for fun (or fame, or both).
What I would suggest, instead of investing large amount of time in coming up with DRM schemes and then implementing and testing, rather invest that time in the functionality of your product and testing it more thoroughly. If your product is good and priced right, people will buy it. Sure, some will pirate it, that is inevitable, but you will get rewarded for your work.
You could put an MD5 or an SHA1 check within your tweak in various locations in your functions just to make sure that if they modify your tweak it wont match. Also instead of packaging your tweak in a deb file you could get it remotely download after verification of some sort.
EX:
Example.tweak
-/var/root/downloadscript (can be any path) (this can also be used so that they cant just extract the file in question and install it)
-DEBIAN/control (config file for deb)
-PostInstall (Post deb installation script) https://wiki.ubuntu.com/PackagingGuide/Basic#postinst_and_prerm
Download Example.tweak from cydia
Using the 'postinst' execute the /var/root/downloadscript
you can use /usr/bin/deviceinfo -s which will print out serial number and use $POST to your server to send the said serial number and download some kind of licence, inside the licence you can include maybe UDID, mac address some other checks that would be checked out by your tweak.
I am new to WIX. I am using util:PermissionEx for creating ACLs. I can successfully set rights like read, write, read & execute but I am unable to find any information about setting Modify Permission.
I have tried using "Append" attribute to achieve this functionality (this seems to be the only attribute that may do the desired)
But using this, the following compilation error appears:
"error CNDL0004: The util:PermissionEx element contains an unexpected attribute 'Append'."
Could you please help me out in this. Thanks.
My question, and answer-to-self at WiX Permissions, how do I express 'Modify' in terms of DACL flags may assist in some way in terms of mapping the simple right Modify to specific rights.
Looking at the doc, the Append attribute definitely seems to be permitted - what build of Wix [3] are you using? With the latest version, you should be able to remove util: and Ex from your tag as it all seems to be natiuvely supported now. Other examples also show an Extended attribute, which is not accepted by newer versions.