WIX adding shortcut to a website or url location using wix and choose custom icon for that shortcut - wix

I want to add a shortcut to the start menu group with following specifications:
It should point to a website, say www.xyz.com
It should have some custom icon
I need to pass some parameters to it, like www.xyz.com?lang=XXXX.
Where XXXX is language code e.g. 1033, 1036, etc. and it's dependent on the language chosen by the user for my application.
Please help.

if the website is always the same you could try including one shortcut.url inside your package for each language that you support and install only the one for that specific language on the disk.
this way you could also control the shortcut that gets used for the .url file.

I found a work-around for this problem.
I made an executable which parses stored language and then calls ShellExecute to start the default browser with required url and language option. I added a shortcut to this executable in the start menu, icon was included in the executable itself.

Related

Making localization work

I have an app that needs to be localized.
After fiddling with the settings for a while, I managed to get the project to the state where it builds a nl.lproj (amongst others) directory in the Resources directory of the app bundle, which contains a MainMenu.strings file that contains all my translations; they seem correct at first glance.
The XIB file is marked as translatable, and seems to be part of the right target:
However, if I run the app in a dutch environment, the localized strings are not shown in the UI. I added
NSLocale *loc = [NSLocale autoupdatingCurrentLocale];
NSString *lang = [loc languageCode];
NSLog(#"Current language: %#",lang);
to verify that the Dutch language is active, and it is.
This question suggests that doing a clean followed by a rebuild of the app should fix such issues. I've tried that, but it did not resolve the issue.
How can I figure out why my app isn't being translated? What else could go wrong? Are there any diagnostics I could be checking?
The application in question is open source, and can be found at https://github.com/Fedict/eid-mw. Select the "eID Viewer" target, and build that, to see what's happening.
There are two different things with the localization. One is localization the UI. This is done by checking those boxes and then editing the string files in the dialog underneath the xib file.
The second is the localization of the Userfacing strings in code. This is done by the Macro NSLocalizedString(#"*key*", *comment*); where key is the key and comment is a provided comment for localization purpose.
These strings are the to edit in the File Localizable.strings.
Here a link with a Beginner Tutorial. And the Apple Docs
To activate the debug function in Xcode for localized strings: pass in -NSShowNonLocalizedStrings YES as launch argument in Xcode. You find it under Product/Scheme/Edit Scheme -Arguments
Hope this helps
You need called .strings file with name "Localizable.strings".
And add language target ( in inspector ) and fill target language file.
Have you tried a check with pseudolocalozations?
Are you setting properly the language and region on your mac?
Are you also trying launching it specifically in Dutch from XCode:
To launch your app in a specific language and region
Click the target in the Run destination menu and choose Edit Scheme.
On the right, select Options.
Optionally, choose a language from the Application Language pop-up menu.
Optionally, choose a region from the Application Region pop-up menu.
Click the Close button.
Click Run to launch your app in the language and region you specified.
It turns out that localisation is supported with OSX 10.8 and above. My app had selected 10.7 as deployment target (we do need to support a few older versions of OSX). Switching the deployment target to 10.8 makes the translations appear.

Open Text in App

I am looking for a way to right click selected text and open it in my app. Eg. via OS X's third party share menu. But I can not find any references at Apple's.
Have a look at the apple docs SysServices for creating a service for you app.
The Docs take you through an example of how to set one up.
Once done you will need to go into System Preferences and Enable the service. Your users will also need to do that.
Here is a quick project that shows an adaption of the apple code.
Update:
Although I think the services work good enough. Creating a Share or Action Extension is possible.
This example uses the same Project as above. But I have added an App Action extension (Target) to it.
The template for the Action is not too hard to understand and it took me 5 minutes to do this quick example.
(So I am not saying everything is as it should be but it works)
For the Action Extension:
Follow the instructions here
Which basically is:
After you choose the extension point that makes sense for your app
extension, add a new target to your containing app. The easiest way to
add an app extension target is to use an Xcode template that provides
a target preconfigured for your extension point.
To add a new target to your Xcode app project, choose File > New >
Target. In the sidebar on the left side of the new target dialog,
choose Application Extension for iOS or OS X. In the pane on the right
side of the dialog, Xcode displays the templates you can choose
Do read the above docs to understand better of what you need to do.
Once you have added the Extension. You can actually run it straight away.
Xcode provides you an option to choose a test app to test it in i.e TextEdit.app and takes you through the whole process of temporarily enabling the Extension.
In this example, remember I chose an Action Extension which suited the App.
The App's function in life is to do a basic encryption of selected text and then display the result.
The App's Action Extension will do the same but instead of displaying it, it will replace the selected text with the encryption text.
All that was needed for me to do, was copy the encryption method from the main app, over to the Extension.
I did have to adjust a couple of things though. Namely the original code deals with a NSString, where as the Extension deals with a NSAttributedString.
The conversion I did works but styling attributes are lost. For this example that does not really matter.
An Action Extension does not use the Share contextual menu. It uses an Action menu.
To see the menu, select some text and the hover the cursor over the selected text. You then should see a discloser button on the left of the text.
Like this:
Click it and choose the Extension.
If you do not see it, go to the 'more' option. This will take you to the system preferences where you can grant access to the extension.
The documentation is mainly concerned about distributing the extension and App via the App store.
But you can code sign your App and extension and do a normal archive export.
From there, all should work ok with gatekeeper.
But again refer to the Docs for a fuller understanding.
Here is a link for the code signed app and also the new Project.
Encrypto2

Display files in a directory list control

Is there a way for user to select a specific file using BrowseDlg? All i can find is that you can select only a folder!! I believe File selection is one of the "common" functionality in use.
Can anyone provide some suggestion on how this can be achieved.
Thanks!
Update
I am thinking of creating a C# custom aciton for this, as all other CA in project are in C#. But I am not sure about few things....
How can I sequence this CA dialog with my exsiting UI sequence.
How to trigger a CA on a button click from one of my custom dialog.
How to get the file path back from File Browse CA to be further used by WIX.
The other CAs that I have created does not have any UI associated.
Please advice.
Thanks!
Actually, Windows Installer doesn't have anything built-in for the "Browse for file" dialog. Various vendors offer their custom solutions, like Advanced Installer and InstallShield.
Anyway, this all ends up in a custom dialog and custom action for Browse button. You can find an example of this here (search for "File Browse Dialog" on that page). The package you'll find contains the custom action, sample solution and some notes. It is based on InstallShield, but you can take at least custom action from there (creating a custom dialog in WiX is not that hard). As a last resort, you can try to implement this CA yourself.

VB.NET call desktop application from 2 shortcuts - supply different parameters

I have a desktop application which reads files from a specified folder, then deposits the files to a folder in a third party document management system based on criteria that the user provides.
My question is:
is it possible to somehow provide different parameters to the code, depending on which shortcut of the application the user clicked on to start it up?
You can add command line parameters to a shortcut icon. Here's how you can do it in Windows:
On the Start Menu, navigate to Notepad.
Right click on Notepad and choose Send To > Desktop (Create Shortcut)
Right click on the newly-created desktop icon and choose Properties
Add your command line parameters to the Target text box.
For example, if you want notepad to open up the hosts file, this would be the content of Target property:
%SystemRoot%\system32\notepad.exe "C:\WINDOWS\system32\drivers\etc\hosts"
You can put pretty much anything into the Target property of a shortcut that you would put into a command line.
Yes.
The easiest way would be to have the shortcut pass those parameters in via the command line.
You could also use conditional compilation variables, and have 2 different .exes. You should be able to find samples of both approaches (command line and conditional compilation variable) in help.

system.diagnostic.process.start problem

Im trying to create an application launcher using vb.net. I'm trying to launch desktop shortcuts that are hidden because I want my desktop to be free of mess. Those shortcuts are created through nircmd :http://www.nirsoft.net/utils/nircmd.html
I used this code:
System.Diagnostics.Process.Start("E:\Documents and Settings\Rew\Desktop\SpeakClipboard.exe")
And it returned the error that the path specified cannot be found.
I tried launching an application in program files using this method and it worked well.
Is there a problem with shortcuts? I cannot specify the path for the file where the shortcut is linked because its a shortcut in the desktop and doesn't point to anything except the nircmd.exe that is on : F:\NIRCMD
But I also tried using this path for system.diagnostic.process.start:
F:\NIRCMD\nircmd.exe cdrom open g:
But still no luck.
If I understand correctly SpeakClipboard.exe is actually a shortcut? If so it probably has a hidden .lnk extension. So you should specify SpeakClipboard.exe.lnk or SpeakClipboard.lnk if it doesn't actually have .exe in the name.
There is a property on the ProcessStartInfo object that allows you to specify an argument.
eg your command would be "F:\NIRCMD\nircmd.exe" and the arguments would be "cdrom open g:"
Does that work?