cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peterbi
Level 7

Old question, but different scenarios

I know it's a repeated question, since I can retrieve long list of threads about it, but I would like to get a better (more official 🙂 ), and hopefully easier solution. I have tried a while but with no luck.

The problem is simple, I am using IS (2008) script (no MSI) project, and trying to create a shortcut on desktop and save the icon file to a public/common location (as destination of the component with the icon file). My first pick is ALLUSERSFILE, but I just can't resolve it. I can accept 'Documents and Settings\AllUsers', system32, etc., but the dropdown list of component 'Destination' is very limited ( ...), if I picked any of them, and use the property in AddFolderIcon() as below (using WINSYSDIR as example), it didn't work - the file is not installed there.

AddFolderIcon(FOLDER_DESKTOP, sNameText, sCommand, "", WINSYSDIR^"my_icon.ico", 0, "", RUN_MAXIMIZED);


So I basically (and ideally) want to use an existing public folder property and put my icon file there and create the shortcut pointing to it.

Note I don't have any CAs or such to use since I am using pure IS script type. I also want to keep the event calls minimum (currently just OnShowUI(0 since I only need to make the shortcut installed and work.


Thanks,
Peter
Labels (1)
0 Kudos
(3) Replies
gridman
Level 8

It almost seems like you are asking how to do a standard user installation on Vista. Or a Per-User installation. That whole subject will drive you nuts.

I have tried all the folders, and the best one in my experience is AppDataFolder. In my testing, it works in all scenarios. It will be a different folder on different versions of Windows, but will still work.

If that is not what you are asking, write back.
0 Kudos
peterbi
Level 7

Hi Gridman,

Thanks for your reply.

You almost answered my question 🙂

But my key point is that how can I easily resolve one of the public folders in BOTH component destination and AddFolderIcon() call? I mean, any existing property I can use to fill both of the places. I have tried WINSYSDIR (because it's in the dropdown list of my component's Destination list), but it did work for me. I can't tweak any because I am using IS Script type, no CA to set anything. I want (and probably have to) use something which can be resolved naturally in both places (comp Destination and AddFolderIcon() call).

Can I put AppDataFolder to comp Destination field? If so, in what format (AppDataFolder/%AppDataFolder%/[AppDataFolder]/)? And can I directly use it in AddFolderIcon() and in what format?

My current problem is that AddFolderIcon() added item to desktop, but the icon is not displayed properly (it's image is the default Windows shortcut icon, not mine), because when I look for the icon file (.ico) in the dest folder, the file is not there!

Sorry for my vaguing description :rolleyes:

Thanks,
Peter
0 Kudos
peterbi
Level 7

Ok, I think it's better to give the sample project out for trial.

Here is the testing project that I used. I have stripped all setup.rul functions (now just empty setup.rul). What it does is just try to install two sample files (a .txt and a .ico) to some public location - it's currently configured to 'WINSYSDIR'.

I built and ran the install, and checked that none of the files was installed to ..\Windows\System32\ folder.

Minor correction - I used IS2008 instead of 2009.

Please give a try to see what my problem is.


Thanks,
Peter
0 Kudos