ThaRealMatix
4th November 2007 17:52 UTC
Get directory of installed program
Hi everyone,
i am sorry i am new to nsis but i didn't find any answer in wiki's, tuorials or so so i just wanted to ask the following.
I want to create an installer which actually only does one thing: Copy some files into a subdirectory of an installed application.
So what i need is the correct code to let nsis search for this Program directory. Does anyone knows how i can do that by using the windows registry or searching for an executable?
Thx
ThaRealMatix
Yathosho
4th November 2007 19:04 UTC
have a look at InstallDirRegKey (or this)
ThaRealMatix
4th November 2007 21:57 UTC
And how could i create a link to the uninstaller and the website of my installer /7 a website into that installtion directory and the directory where this Program has it's shortcuts?
(im sorry i didtn find it on that site)
Afrow UK
4th November 2007 22:12 UTC
CreateShortCut.
WriteINIStr "file.url" "InternetShortcut" "URL" "http://..."
Stu
ThaRealMatix
5th November 2007 12:52 UTC
Yes... but how can i get the directory in the Start MEnu of a previous installed application?
for Example:
Word ist installed and it is is linked in Start - Programs -> MS Office
how can i get this Shortcut directory and ADD an entry for my internnet site and my uninstaller?
Afrow UK
5th November 2007 14:59 UTC
There is no way to tell exactly because users can move and rename the folders, but if you look for a folder called "Microsoft Office" under $SMPROGRAMS, i.e.
!include LogicLib.nsh
...
${If} ${FileExists} `$SMPROGRAMS\Microsoft Office\*.*`
CreateDirectory `$SMPROGRAMS\Microsoft Office`
CreateShortCut `$SMPROGRAMS\Microsoft Office\My App Uninstall.lnk` `$INSTDIR\Uninstall.exe`
WriteINIStr `$SMPROGRAMS\Microsoft Office\web.url` InternetShortcut URL `http://myapp.com`
${EndIf}
Stu