Wix File Association - Misunderstanding - c#

I have an application and I want to use my own file extension that opens my application when double clicked.
I'm using Wix to build my installer and understand that I can make use of file association in my .wxs file. A snippet from the file currently looks like this:
<DirectoryRef Id ="INSTALLFOLDER">
<Component Id ="RBUpdate.exe" Guid="*">
<File Id="RBUpdate.exe" KeyPath="yes" Source="$(var.RBUpdate.TargetDir)RBUpdate.exe" />
<ProgId Id ="MyProgID" Description="RBUpdate data files" Advertise="yes">
<Extension Id ="rbu" ContentType="application/rbu">
<Verb Id ="open" Command="open" TargetFile="RBUpdate.exe" Argument=""%1""/>
</Extension>
</ProgId>
</Component>
</DirectoryRef>
<Feature Id ="ProductFeature" Title="RBUpdateSetup" Level="1">
<ComponentRef Id ="RBUpdate.exe"/>
</Feature>
This builds fine but, if I'm honest, I'm new to this and not quite quite sure what it does.
How do I create an instance of my created file type? The files I'm creating are not going to be as a result of running the application and they will be manually made externally to the application, which it will then load. I simply want to be able to make an xml file, name it with the .rbu extension, and have it open with my application.

I was very simply not renaming my xml files .rbu! This is a working example of how to use file association with wix anyway, to not completely waste time :L

Related

c# autocad dllimport by autocad version

i have been using the the program from "Detecting entities under cursor while selection is running" By Philippe Leefsma located here1. it worked in ACAD2014 however now we are using ACAD2016. it will not work because of the DLLImport of acdb19.dll and autocad2016 needs acdb20.dll. Is there a way to make the program load eighter dll version? i tried using netload and assembly.loadfrom and neither worked.
Point Monitor callback
The DLL import is set at compile time so the best bet is to compile two versions for each release of AutoCAD.
Once the project is compiled, you could set up an autoloader by creating an application.bundle folder. this folder can be placed in c:\programdata\Autodesk\applicationPlugins. In the application.bundle folder, create a subfolder called Application and place the compiled .DLL file in there.
The loader is controlled with an XML file which should be named PackageContents.xml. Here's some example code for the xml file:-
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Name="My AutoCAD App"
Description="Does something in AutoCAD"
Icon="./Application/MyIcon.ico"
Author="Paul Nelson">
<CompanyDetails Name="Paul Nelson"
Url="http://www.stackoverflow.com"
Email="myemail#email.com">
</CompanyDetails>
<Components>
<!-- define the min and max versions of AutoCA in the next line -->
<RuntimeRequirements OS="Win64" Platform="AutoCAD" SeriesMin="R19.0" SeriesMax="R22.0" />
<ComponentEntry
ModuleName=".\Application\MyApp.dll"
LoadOnAutoCADStartup="true"
LoadOnCommandInvocation="false"
AppDescription="This is assembly MyApp."
AppName="My AutoCAD App"
AppType=".NET">
<Commands GroupName="My Apps">
<Command Local="MYAPP" Global="MYAPP" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>
One last tip - make sure the .dll filename does not contain spaces.

ReSharper 9 Adding menu item action not working

Trying to update my resharper extension to work for 9.0, before I was just moving the dll into the plugins directory but now I need to figure out how to get nuget to work... I've been able to package the files, dll gets included in the nupkg but I think I have some namespace\id something something issues(not very familiar with .net) and it doesn't seem as if my actions.xml is even being read by resharper when I import the nuget package. The menu item isn't being added. Anwyays if anyone can give me any sort of advice on how to debug a nuget package or what might be going wrong would really really appreciate as I've been stuck on this for a few days now.
Actions.xml
<?xml version="1.0" encoding="utf-8" ?>
<actions>
<action id="yuval" text="L10N"></action>
<insert group-id="ReSharper" position="last">
<action-ref id="yuval" text="About Localization Helper"/>
</insert>
</actions>
AboutAction.cs
namespace JetBrains.Resharper.L10N
{
[Action(Id)]
public class AboutAction : IExecutableAction
{
public const string Id = "yuval";
public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate)
{
return true;
}
public void Execute(IDataContext context, DelegateExecute nextExecute)
{
MessageBox.ShowMessageBox(
"Localization Helper\nYuval\n\nHelps Localize",
"About Localization Helper",
MbButton.MB_OK,
MbIcon.MB_ICONASTERISK);
}
}
}
nuget spec
<?xml version="1.0"?>
<package >
<metadata>
<id>JetBrains.Resharper.L10N</id>
<version>1.0.0.7</version>
<title>L10N</title>
<authors>Yuval</authors>
<owners>UW</owners>
<licenseUrl>https://myurl.com</licenseUrl>
<projectUrl>https://myurl.com</projectUrl>
<iconUrl>https://myurl.com/logo.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Tool to help localize</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2015</copyright>
<tags></tags>
<dependencies>
<dependency id="Wave" version="[1.0]" />
</dependencies>
</metadata>
<files>
<file src="..\bin\Debug\JetBrains.Resharper.L10N.dll"
target="dotFiles\"/>
</files>
</package>
The way actions are registered has changed in ReSharper 9. It's no longer done with actions.xml, but with interfaces on your action class. For example, to add an action to the ReSharper → Tools menu, you would do:
[Action(ActionId, Id = 1)]
public class AboutAction : IExecutableAction, IInsertLast<ToolsMenu>
{
public const string ActionId = "yuval";
// …
}
You also need to specify a unique value for Id. As of 9.1, this needs to be unique within your own extension (9.0 required it to be unique across the whole installation, including ReSharper itself and any other extensions).
Whenever you change the attributes or interfaces of an action, the extension needs to be reinstalled via nupkg (the actions are statically registered with Visual Studio, in the same way as a standard VS extension), but if just the implementation has changed, you can copy the dlls to the install folder, either manually, or via a small change to the .csproj.
You also need to make sure you've defined a ZoneMarker class. This declares that your action belongs to a zone, which is used to enable/disable functionality based on installed features and the current host (e.g. so Visual Studio specific extensions only work in VS and don't get loaded into dotPeek, etc.). You can find out more about Zones in the devguide, with this page providing useful info for defining a zone marker.
This thread should help, too.
Also, it's probably a good idea to name you dll and nupkg something other than JetBrains.ReSharper.(Whatever) to prevent any potential clashes with official dlls, and to prevent confusion as to where the dll comes from. The first part of the name is supposed to be your company's name (or personal name).

CCNET Build Publisher with mutlipe source dir

I'm using CCNet and want to use build publisher to copy from more than one sourcedir, is there any workaround to do that, keep in mind that I want to make the build folder labelled with the build number .
here is my code :
<buildpublisher>
<sourceDir>D:\CCNETTest1\WebApplication1\WebApplication1</sourceDir>
<publishDir>C:\inetpub\wwwroot\CI</publishDir>
<alwaysPublish>false</alwaysPublish>
</buildpublisher>
you could not specify more than one sourcedir in buildpublisher, so if you want to, you have to use before
create a folder that will contain all your sourcedir you want
create nant copy :
<copy todir="${target.dir}\firstsource">
<fileset basedir="firstsource">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${target.dir}\secondsource">
<fileset basedir="secondsource">
<include name="*.*" />
</fileset>
</copy>
and after all your source are in target.dir folder use your buildpublisher but specify for sourceDir , folder that contains all folder you want...
<buildpublisher>
<sourceDir>$(target.dir)</sourceDir>
<publishDir>C:\inetpub\wwwroot\CI</publishDir>
<alwaysPublish>false</alwaysPublish>
</buildpublisher>

WIX: How to set Property from .NET console application

I have simple C# console application:
static int main(string[] args){
return SomeBoolMethod() ? 1:0;
}
How in WiX 2.0 should I define property and set this value to it? I don't care about future upgrade/uninstall
UPD
I want latter use this property in condition: so the group B will not execute if MYPROPERTY == 0 but all further components in feature F_A will
I.E.
<Feature Id="F_A" Level="1">
<Condition Level="0">NOT INSTALLED</Condition> <!-- Another custom property -->
<ComponentGroupRef Id="B" />
<ComponentRef Id="C_AnotherComponent" />
</Feature>
<ComponentGroup Id="B">
<Condition Level="0">NOT MYPROPERTY</Condition> <!-- property that set in console-->
<ComponentRef Id="C_ComponentName" />
</ComponentGroup>
TIA
Executables that are run as Custom Actions do not have access to the Installation session, so they cannot modify a property. Ideally you would rewrite the code that's currently in an exe to reside in a dll, so it could be called as a dll custom action.
If you cannot rewrite things (perhaps you received the exe from elsewhere), you would need to write a dll custom action that launches the exe, examines its exit code, and sets properties accordingly.
In neither case do you need to predefine the property; you can just set it in the dll custom action. In both cases, if the dll is written in C# you will have to use a technology like DTF to invoke it, as Windows Installer cannot directly invoke managed code.

Can't access custom profile properties from web.config?

I have the following two profile properties in my web.config file between the System.Web tags:
<anonymousIdentification enabled="true"/>
<profile>
<properties>
<add name="CustomerName" allowAnonymous="true"/>
<add name="CustomerID" allowAnonymous="true"/>
</properties>
</profile>
When I try to access the Profile.CustomerName or Profile.CustomerID from an aspx.cs file, it doesn't show up. I thought when you create a custom profile property, it automatically updates the aspnetdb with the new properties. Profile doesn't show up in intellisense as well.
This problem occurs if you are creating a Web Application. Web Apps, unlike Websites, don't generate the ProfileCommon class.
You could either follow this method:
http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx
(Appendix 2)
I haven't personally used the above assembly, so someone else might give some advice on that.
However, you could also try:
Object customerName = HttpContext.Current.Profile.GetPropertyValue("CustomerName")
You won't get intellisense with this method, but as long as you know the property name, it can be accessed like that.
Specify properties in web.config file as follows : -
Now, write the following code : -
Compile and run the code. You will get following output: -

Categories

Resources