Shortcuts for current user

Got a problem you cannot solve? Try here.
Post Reply
alexbt
Posts: 12
Joined: Mon Jul 11, 2011 9:17 am

Shortcuts for current user

Post by alexbt »

Hi Everyone,

I've made a setup which during installation ask user to install the program for all user or for only current user.
When I choose to install for All Users - everything goes normal. When I choose to install for current user, the program is installed for current user but shortcuts are placed in directory for all users.

Here is my code:

Code: Select all

Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES

if Variable ALLUSERS Equals TRUE
     Get Common Folder Location System->Application Data Directory into MYAPPDATA
     Get Common Folder Location System->Desktop Directory into DESKTOPDIR
     Set Variable MENUSHORTCUTS to $SHORTCUTFILESALL$\$STARTMENU$
else
     Get Folder Location System->Application Data Directory into MYAPPDATA
     Get Folder Location System->Desktop Directory into DESKTOPDIR
     Set Variable MENUSHORTCUTS to $SHORTCUTFILES$\$STARTMENU$
end
Strange is that, when I'm debugging setup or installing with generating a log file - the shortcuts are placed in right directory, when I run the setup from double clicking or pressing run button in Installaware the shortcuts are installed for all users even I've choose to install for current user.

Also I've used message boxes to check the values of variables before and after Apply Install, variables are set correctly.

Has anyone an idea how to fix that?
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Shortcuts for current user

Post by giaviv »

How are you running the setup?

Are you inviking it manually? Which user runs it?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
alexbt
Posts: 12
Joined: Mon Jul 11, 2011 9:17 am

Re: Shortcuts for current user

Post by alexbt »

I'm running the setup from the Release folder, or Run without Debugging from the InstallAware.
The setup runs Administrator user.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Shortcuts for current user

Post by giaviv »

Hi,

Who created that code you attached here? Did you manually create it or was it emitted by InstallAware?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
alexbt
Posts: 12
Joined: Mon Jul 11, 2011 9:17 am

Re: Shortcuts for current user

Post by alexbt »

giaviv wrote:Hi,

Who created that code you attached here? Did you manually create it or was it emitted by InstallAware?
The code was emitted by InstallAware, but I've modified it.
During my experiments to fix this, the variable SHORTCUTFOLDER has been renamed in MENUSHORTCUTS, also I've added lines which sets the MYAPPDATA and DESKTOPDIR variables.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Shortcuts for current user

Post by giaviv »

Please try creating a new setup from the template you used - try running the new setup, as is, and let me know if you are experiencing the same behavior.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
alexbt
Posts: 12
Joined: Mon Jul 11, 2011 9:17 am

Re: Shortcuts for current user

Post by alexbt »

giaviv wrote:Please try creating a new setup from the template you used - try running the new setup, as is, and let me know if you are experiencing the same behavior.
I've created a new setup from the template, and it works how it should work: if I choose to install for current user, the shortcuts are installed for current user only, if I choose to install for all users, the shortcuts are installed for all users.
Seems something is wrong in my project, but values of variables are set correctly.

I've created project with InstallAware 10 Developer, but now I'm using InstallAware 11 Studio Admin to build this project, can be this a problem?
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Shortcuts for current user

Post by giaviv »

I doubt that is the problem - the products are backward compatible.
Try copying the parts of the script that are relevant and working to the other script.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
alexbt
Posts: 12
Joined: Mon Jul 11, 2011 9:17 am

Re: Shortcuts for current user

Post by alexbt »

The problem was that I've invoked two times Apply Install.
First time in a file script which install some project dependencies and second time in the main setup script file.
I've removed first Apply Install and now everything works just fine :).
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Shortcuts for current user

Post by giaviv »

Great!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply