Msi: Can't set a property from command line - command-line

I want to change property of msi from command line but it fail. in the log of the msi i can see that my property update with my value but after this it override by action that modified this property.
to be more specific i write: INSTALLFOLDER="*".
but in the msi database has action call SetINSTALLFOLDER that override this value.
i ask how can i skip on this action or disable it from command line.
the msi product not produced by me.
the log:
MSI (s) (F4:1C) [15:38:41:973]: Command Line: INSTALLDIR=C:\\Users\user\AppData\Local\Temp\ugi21xcf.3lp
*
*
MSI (s) (F4:1C) [15:38:42:017]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\\Users\user\AppData\Local\Temp\ugi21xcf.3lp'.
*
*
MSI (s) (F4:1C) [15:38:42:050]: Doing action: SetINSTALLFOLDER
MSI (s) (F4:1C) [15:38:42:050]: Note: 1: 2205 2: 3: ActionText
Action ended 15:38:42: CostInitialize. Return value 1.
MSI (s) (F4:1C) [15:38:42:050]: PROPERTY CHANGE: Adding INSTALLFOLDER property. Its value is 'C:\Tools'.

You can set false condition to CustomAction which overrides your property but i wouldn't recommend it unless you're 100% confident in what it does (like that all it do is just set INSTALLOCATION). To make it more safe you can create your own CustomAction which will use different property passed from commandline and will override INSTALLOCATION right after SetINSTALLFOLDER CA.

Related

Azure devops custom extension output variables

I am trying to create an extension using node api which publishes a path variable on completion.
I did set outputVariables in task.json and tried to use both
tl.setVariable('outVar1', 'outVal1'))
tl.setTaskVariable('outVar1', 'outVal1'))
task.json (only outvariable section):
"OutputVariables": [
{
"name": "outVar1",
"description": "This publish a output variable."
}
],
I tried printing it in the subsequent steps in the same job using all the recomended constructs
$(taskName.outVar1)
$taskName.outVar1
$outVar1
$(outVar1)
But the variable is not visible. I also printed all the environment variables and the variable is not present there.
Is someone able to create an extension which outputs a variable successfully?
You don't need to declare an output variable fro this purpose.
Just set the variable:
tl.setVariable("varNamr","varValue", false);
The fasle indicate that is not a secret variable.
In the enxt steps you can use the variable wirh $(varName).

is it possible to override uvm test that is specified via +UVM_TESTNAME=test1 by also having +uvm_set_type_override=test1,test2?

I am wondering if it is possible to override test specified in command line via +UVM_TESTNAME by +uvm_set_type_override.
I have tried it and this is what i see in prints in log.
UVM_INFO # 0: reporter [RNTST] Running test Test1...
UVM_INFO # 0: reporter [UVM_CMDLINE_PROC] Applying type override from the command line: +uvm_set_type_override=Test1,Test2
So it seems to me that test component is created first and then factory overrides are applied?
I see in uvm_root.svh following pieces of code
// if test now defined, create it using common factory
if (test_name != "") begin
if(m_children.exists("uvm_test_top")) begin
uvm_report_fatal("TTINST",
"An uvm_test_top already exists via a previous call to run_test", UVM_NONE);
#0; // forces shutdown because $finish is forked
end
$cast(uvm_test_top, factory.create_component_by_name(test_name,
"", "uvm_test_top", null));
It is using the factory, but i don't know if actully overrides are put in. I also see code in following.
begin
if(test_name=="")
uvm_report_info("RNTST", "Running test ...", UVM_LOW);
else if (test_name == uvm_test_top.get_type_name())
uvm_report_info("RNTST", {"Running test ",test_name,"..."}, UVM_LOW);
else
uvm_report_info("RNTST", {"Running test ",uvm_test_top.get_type_name()," (via factory override for test \"",test_name,"\")..."}, UVM_LOW);
end
I am wondering if the "else" part in above is ever executed? or under what condition is it executed?
It seems that there is an issue with command line processing ordering in the UVM—UVM_TESTNAME gets processed separate before all the other options.
It is possible to set an override before calling run_test() in the initial block.
But what is the point of setting up the test name, and then overriding it on the same command line? Why not use the overridden test name as the test?
In general, anything registered with the UVM Factory can be overridden at runtime with a runtime command line switch.
In the case of test names, there is a command line switch called +UVM_TESTNAME=selected_test_name_here.
Typically,
We may have the base test name as the default in the run(your_base_test_name) in the top module,
And then we can select various tests at runtime, without compiling as we run each test (as long as each test has been included in the compile
And the +UVM_TESTNAME=selected_test_at_runtime as we typically cycle through test names when running regressions or switching tests as we debug our design with each different test.

Mercurial pretag hook called even with --remove option

I am a newbie to Mercurial and I am writing a pretag hook to check policy on tag names.
I have the below code.
version_re = r'(ver-\d+\.\d+\.\d+|tip)$'
def invalidtag(ui, repo, hooktype, node, tag, **kwargs):
assert(hooktype == 'pretag')
....
if not re_.match(tag):
ui.warn('Invalid tag name "%s".\n' % tag)
return True
return False
This hooks works perfect when I am tagging. But this hook is also executed when I want to remove invalid tags with --remove options.
So, is there any way to avoid his situation?
When a tag is marked for removal the node passed to the hook is the nullid from mercurial.node.
So you should be able to check this the node against the nullid from mercurial.node.
You should convert the node to the hexadecimal representation with the "hex" function from mercurial.node. This hex function has a different behavior than the built-in one from python.

How do I use the nunit task's skip_test_fail parameter in Albacore?

The Albacore release notes say the xunit task supports a skip_test_fail parameter that
"prevents rake from aborting the build when an xunit test fails. This is useful in continuous integration scenarios, such as running with TeamCity."
No example was shown and my attempt to use it (below) was not successful. How is it supposed to work?
desc "XUnit Test Runner Example"
xunit :xunit do |xunit|
xunit.command = "../xunit-1.8/xunit.console.clr4.exe"
xunit.assembly = "Islambox.Web.Test/bin/Debug/Islambox.Web.Test.dll"
xunit.skip_test_fail
end
I looked through the xunit task source and see that the parameter does exist. It's a regular "property" that can be set to some value.
attr_accessor :html_output, :skip_test_fail
It's used in a postfix if condition, which will return false if the value of the property is false or nil. Any other value will return true.
if !result && (!#skip_test_fail || $?.exitstatus > 1)
So, just set it with any value! I recommend true so that it's more clear what's going on. I've updated the wiki with this information.
xunit.skip_test_fail = true

install4j: how can i pass command line arguments to windows service

I've created a windows service using install4j and everything works but now I need to pass it command line arguments to the service. I know I can configure them at service creation time in the new service wizard but i was hoping to either pass the arguments to the register service command ie:
myservice.exe --install --arg arg1=val1 --arg arg1=val2 "My Service Name1"
or by putting them in the .vmoptions file like:
-Xmx256m
arg1=val1
arg2=val2
It seems like the only way to do this is to modify my code to pick up the service name via exe4j.launchName and then load some other file or environment variables that has the necessary configuration for that particular service. I've used other service creation tools for java in the past and they all had straightforward support for command line arguments registered by the user.
I know you asked this back in January, but did you ever figure this out?
I don't know where you're sourcing val1, val2 etc from. Are they entered by the user into fields in a form in the installation process? Assuming they are, then this is a similar problem to one I faced a while back.
My approach for this was to have a Configurable Form with the necessary fields (as Text Field objects), and obviously have variables assigned to the values of the text fields (under the 'User Input/Variable Name' category of the text field).
Later in the installation process I had a Display Progress screen with a Run Script action attached to it with some java to achieve what I wanted to do.
There are two 'gotchas' when optionally setting variables in install4j this way. Firstly, the variable HAS to be set no matter what, even if it's just to the empty string. So, if the user leaves a field blank (ie they don't want to pass that argument into the service), you'll still need to provide an empty string to the Run executable or Launch Service task (more in that in a moment) Secondly, arguments can't have spaces - every space-separated argument has to have its own line.
With that in mind, here's a Run script code snippet that might achieve what you want:
final String[] argumentNames = {"arg1", "arg2", "arg3"};
// For each argument this method creates two variables. For example for arg1 it creates
// arg1ArgumentIdentifierOptional and arg1ArgumentAssignmentOptional.
// If the value of the variable set from the previous form (in this case, arg1) is not empty, then it will
// set 'arg1ArgumentIdentifierOptional' to '--arg', and 'arg1ArgumentAssignmentOptional' to the string arg1=val1 (where val1
// was the value the user entered in the form for the variable).
// Otherwise, both arg1ArgumentIdentifierOptional and arg1ArgumentAssignmentOptional will be set to empty.
//
// This allows the installer to pass both parameters in a later Run executable task without worrying about if they're
// set or not.
for (String argumentName : argumentNames) {
String argumentValue = context.getVariable(argumentName)==null?null:context.getVariable(argumentName)+"";
boolean valueNonEmpty = (argumentValue != null && argumentValue.length() > 0);
context.setVariable(
argumentName + "ArgumentIdentifierOptional",
valueNonEmpty ? "--arg": ""
);
context.setVariable(
argumentName + "ArgumentAssignmentOptional",
valueNonEmpty ? argumentName+"="+argumentValue : ""
);
}
return true;
The final step is to launch the service or executable. I'm not too sure how services work, but with the executable, you create the task then edit the 'Arguments' field, giving it a line-separated list of values.
So in your case, it might look like this:
--install
${installer:arg1ArgumentIdentifierOptional}
${installer:arg1ArgumentAssignmentOptional}
${installer:arg2ArgumentIdentifierOptional}
${installer:arg2ArgumentAssignmentOptional}
${installer:arg3ArgumentIdentifierOptional}
${installer:arg3ArgumentAssignmentOptional}
"My Service Name1"
And that's it. If anyone else knows how to do this better feel free to improve on this method (this is for install4j 4.2.8, btw).