0

I am currently working at a pure E4 RCP application and I have made an .exe installer using NSIS. Also I have associated a certain file extension to be opened via double click by my application. File association is done using the following NSIS script: WriteRegStr HKCR ".myext" "" "MyAPP.project" WriteRegStr HKCR "MyAPP.project" "" \ "MyAPP project file" WriteRegStr HKCR "MyAPP.project\DefaultIcon" "" \ "$INSTDIR\MyAPP.ico" WriteRegStr HKCR "MyAPP.project\shell\open\command" "" \ '"$INSTDIR\MyAPP.exe" "%1"' Call RefreshShellIcons

If I double click on a .myext file, the application doesn't start properly (worth to mention that I have handled in my code the interpretation of this event) by this I mean that is looking that something has crashed. The weird part is that if the .myext file is in the same directory with the .exe file of my application or if I drag-and-drop over the shortcut made on Desktop the application works like a charm. I think that I am doing wrong the file type association using NSIS script. Any help will be appreciated. Thanks you.

  • We need more details that 'it crashed'! Is anything written to the `.log` file in the workspace `.metadata` directory or the `configuration` directory in the application install directory? – greg-449 Mar 09 '14 at 08:39
  • Yes, in the Configuration editor, in in the .log file there is a org.osgi.framework.BundleException which say that it cannot activate bundle. But this don't appears anymore If I drag and drop the project over the shortcut. And also it says that it cannot find my lifeCycle class. – Bogdan Niculeasa Mar 10 '14 at 07:20

1 Answers1

0

It sounds to me like your application depends on the current/working directory to be the same as the application directory.

Even if you could fix the filetype registration there are probably other places where you cannot control the working directory like new shortcuts created by your users and other spawn points like "Open With".

Because of issues like these, applications should not depend on the working directory...

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Can you give me, please, an idea of how to make the application to not depend on the working directory? These changes will be made in the NSIS script for generating the installer? And thank you for your answer. – Bogdan Niculeasa Mar 10 '14 at 07:13
  • No, it has nothing to do with NSIS, the change has to be made in your application. If possible you could try calling SetCurrentDirectory with the application directory as early as possible but the best solution is to make sure you are loading all dll's and other dependencies with full paths... – Anders Mar 10 '14 at 13:16