Page 1 of 1

Shortcuts for current user

Posted: Tue Jul 12, 2011 12:52 am
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?

Re: Shortcuts for current user

Posted: Tue Jul 12, 2011 8:50 am
by giaviv
How are you running the setup?

Are you inviking it manually? Which user runs it?

Re: Shortcuts for current user

Posted: Tue Jul 12, 2011 9:04 am
by alexbt
I'm running the setup from the Release folder, or Run without Debugging from the InstallAware.
The setup runs Administrator user.

Re: Shortcuts for current user

Posted: Tue Jul 12, 2011 8:02 pm
by giaviv
Hi,

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

Re: Shortcuts for current user

Posted: Wed Jul 13, 2011 12:01 am
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.

Re: Shortcuts for current user

Posted: Wed Jul 13, 2011 5:47 pm
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.

Re: Shortcuts for current user

Posted: Thu Jul 14, 2011 12:48 am
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?

Re: Shortcuts for current user

Posted: Thu Jul 14, 2011 11:07 am
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.

Re: Shortcuts for current user

Posted: Mon Jul 18, 2011 1:27 am
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 :).

Re: Shortcuts for current user

Posted: Mon Jul 18, 2011 11:30 am
by giaviv
Great!