/build/static/layout/Breadcrumb_cap_w.png

Start in shortcut

hi!

is ther any ideas, how can i change in msi start in for the shortcut?

0 Comments   [ + ] Show comments

Answers (15)

Posted by: pjgeutjens 12 years ago
Red Belt
3
have you tried running the command
msiexec.exe /fs {productcode} /qb (or /qn)
through an activesetup for each user?

As a test you could run it manually for a target user and see if the shortcut gets rewritten like you want it to.

EDIT: Since it's gonna have to run every time, maybe the RUN key in HKLM would be a better place for the command's trigger.

PJ
Posted by: MSIPackager 14 years ago
3rd Degree Black Belt
1
It's defined by the WkDir column of the shortcut table...

http://msdn.microsoft.com/en-us/library/aa371847(VS.85).aspx

Cheers,
Rob.
Posted by: lanselots 14 years ago
Fifth Degree Brown Belt
0
you mean that i need to create property [WkDir]=L:\%USERPROFILE%
and it will create write start in?
Posted by: anonymous_9363 14 years ago
Red Belt
0
It's defined by the WkDir column of the shortcut table

:)

BTW, the %USERPROFILE% environment variable will already have a drive letter prefixing it, won't it?
Posted by: MSIPackager 14 years ago
3rd Degree Black Belt
0
lol - now that's what I call subtle
Posted by: lanselots 14 years ago
Fifth Degree Brown Belt
0
anyway it is not working, I even create property and pot in workdir, but launcing installation i get error 2704, i understand that there is something wrong with property or dir wich i change, but i dont know what, please help
Posted by: anonymous_9363 14 years ago
Red Belt
0
If you validate your package, it should highlight the offending entry in the Directory table.

IIRC, you're a Wise Package Studio user? If you look at the Directory table in the 'Tables' view, it should be highlighted in red.
Posted by: lanselots 14 years ago
Fifth Degree Brown Belt
0
ok, i have made that in start in shows username and different drive(I crate property with %USERNAME%), but when i login with another user acount, i cheked, that username didn change, and left my, please help
Posted by: JillBA 14 years ago
Senior Yellow Belt
0
Sounds like a basic Wise Package Studio / Application Packaging course might be a good place to start. There's loads of information on the internet and this forum.
Try googling: wise shortcut working directory
You'll get lots of results.
Posted by: Curry 12 years ago
Senior Yellow Belt
0
Good day everyone.

I feel a bit odd reviving such an old thread, but still I did a search :). First time ever I was unable to find a solution.
I have the same problem and it hasn't been resolved yet.

Quick recap:
I need to set Working Directory in a Shortcut during install to point to %APPDATA%\Logs for any given user.
Problem is (and i found it the hard way through trial and error) "The references are resolved to an actual path when the installer resolves the working directory to create the shortcut."
So when the installation is done under any user accout, "Start In" field is populated with that user's appdata folder for every other user.

I'm using ORCA and I guess this could be somehow achieved with populating CustomAction table, but i've been into Windows Installer Database editing for like couple of hours or so, and my knowledge is less than basic. Any direction (and i mean step-by-step guide :D) would be kindly appreciated.

Thanks in advance!
Posted by: naveen.packager 12 years ago
Green Belt
0
Have you checked in usermode after self healing of application?

In user mode after the first self heal the start in folder path is getting changed to that USERPROFILE.

But when you get back to administrator again, it will show the path of that user where it has been last selfhealed.

If you are using this application for different users of the same pc then this is a problem because it will show the path of the user in which it has been last self healed.

I am not sure if you can get this done by using custom action, but ypu can use active setup to create the shortcut.
Posted by: an33th 12 years ago
Orange Belt
0
ORIGINAL: pjgeutjens

have you tried running the command
msiexec.exe /fs {productcode} /qb (or /qn)
through an activesetup for each user?

As a test you could run it manually for a target user and see if the shortcut gets rewritten like you want it to.

EDIT: Since it's gonna have to run every time, maybe the RUN key in HKLM would be a better place for the command's trigger.

PJ


This works!!! The shortcuts gets repaired to point to the desired working dir.
Posted by: naveen.packager 12 years ago
Green Belt
0
PJ,

Your command works.

But i observed one problem here in admin mode(or if any user have administrator rights). In admin mode even after running that command(or even after manually reparing from msi) the path wont change, it will be the path of the user last accessed and it will use that file.

If you delete the admin appdata file, it wont self heal.This may be because it is having permission to access the key file from user.

Just out of curiosity iam posting this. May be this will be a problem in these type of scenarios.
Posted by: Curry 12 years ago
Senior Yellow Belt
0
Yeah... Thank kinda works, but still doesn't seem right...

Here's what i did:

1. Create new vbs script Shortcut.vbs.

'Replace the following:
'<Your directory> - specify your directory with any number of parent directories
'Thanks to: http://www.appdeploy.com/messageboards/fb.asp?m=28595
'<Shortcut name> - obvious
'<Path to .exe> - path to .exe file you are making a shortcut to.
'Example: %PROGRAMFILES%\Internet Explorer\iexplore.exe
'<Path to icon> - example: %PROGRAMFILES%\Internet Explorer\iexplore.exe, 0

'Creating a folder first.
Dim WSHShell : Set WSHShell = CreateObject("WScript.Shell")
Dim sAPPDATA : sAPPDATA = WSHShell.Environment("Volatile").Item ("APPDATA")
Dim Path : Path = sAPPDATA & "\<Your directory>"

Call Recursion(Path)

Function Recursion(DirectoryPath)
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")

If FSO.FolderExists(DirectoryPath) Then Exit Function
Call Recursion(FSO.GetParentFolderName(DirectoryPath))
FSO.CreateFolder(DirectoryPath)
End Function

'Now for the Shortcut itself
set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\<Shortcut name>.lnk")
oShellLink.TargetPath = "<Path to .exe>"
oShellLink.IconLocation = "<Path to icon>"
oShellLink.WorkingDirectory = "%APPDATA%\<Your directory>"
oShellLink.Save

2. Open up you MSI project in ORCA and go to Binary table. Add Row:

    Name: AddShortcut
    Data: <Full path to vbs script>\Shortcut.vbs

3. Go to CustomAction table. Add Row:

    Action: RunAddShortcut
    Type: 6
    Source: AddShortcut
    Target: <leave blank>

(Type 6 stands for VBScript)
4. Go to InstallExecuteSequence table. Add Row:

    Action: RunAddShortcut
    Condition: NOT Installed
    Sequence: 6500

5. Go to Shortcut table and remove unneeded rows.

Still one problem remains. Working Directory folder and shortcut are not removed on uninstall. This doesn't bother me at all but might be an issue for someone.
Posted by: naveen.packager 12 years ago
Green Belt
0
Still one problem remains. Working Directory folder and shortcut are not removed on uninstall.

Again you can use a vbscript for this on uninstall.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ