Sign Up Alternatively, sign up with. Already have an account? Announcements; Help; Report a Problem; Help and Support. I have a.config file that I want to copy from the source directory (where my.msi file is, to my install directory. Copy external file to install directory WiX.
Active3 years, 10 months ago
I have a question I hope you will be willing to answer. I have a fair amount of experience writing BASH scripts, but know next to nothing about Windows scripting. So my question may be very basic. I have a script that asks for user input and uses that input to create two directories. Then the script moves .mp3 files into the newly created directories. So far so good.
The problem is that I then want to copy the newly created directories (along with the files they contain) to my MP3 player. ( D:MUSIC),
What happens when I run the script, however, is that the mp3 files are copied to the destination directory individually - that is they end up not in a copy of the directory they were copied from, but just in the D:MUSIC directory.
![]()
You also can put it into any personal directory, and add this directory to the PATH environment variable so that you can put this DLL file away from the DLLs under windows system32: How to set the path in Windows. Remember file copy paste location. Actually for crack. After Install a software I need to paste crack on installed directory. Have any soft that auto copy crack and paste on installed folder? File.Copy(fileInfo.FullName, installLocation + @' ' + fileInfo.Name); }} The problem I have found is that the call to Application.StartupPath does not return the location that the install is running from. How do I get the path to the source directory of the installation so that I am able to copy the files in the two sub-folders into the install.
In other words I end up with:D:MUSICfile.mp3 instead of D:MUSICnew_directoryfile.mp3
Below is my script: I would be grateful if you could give me a clue as to what I am doing wrong.
Thank you,
GG
GrouchyGaijinGrouchyGaijin
1 Answer
Community♦
wOxxOmwOxxOm
29.5k44 gold badges5454 silver badges6565 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged batch-filedirectorycopy or ask your own question.
Active1 year, 8 months ago
The MSI stores the installation directory for the future uninstall tasks.
Using the
INSTALLPROPERTY_INSTALLLOCATION property (that is 'InstallLocation' ) works only the installer has set the ARPINSTALLLOCATION property during the installation. But this property is optional and almost nobody uses it.
How could I retrieve the installation directory?
Michael DamatovMichael Damatov
9,4521010 gold badges4040 silver badges6969 bronze badges
6 Answers
Use a registry key to keep track of your install directory, that way you can reference it when upgrading and removing the product.
Using WIX I would create a Component that creates the key, right after the Directy tag of the install directory, declaration
CheGueVerraCheGueVerra
6,50533 gold badges3232 silver badges4343 bronze badges
Crack Folder To Installation Directory
I would try to use Installer.OpenProduct(productcode). This opens a session, on which you can then ask for Property('TARGETDIR').
Martin v. LöwisMartin v. Löwis
101k1414 gold badges172172 silver badges220220 bronze badges
Try this:var sPath = this.Context.Parameters['assemblypath'].ToString();
Cory Cookson
I'd use MsiGetComponentPath() - you need the ProductId and a ComponentId, but you get the full path to the installed file - just pick one that goes to the location of your installation directory. If you want to get the value of a directory for any random MSI, I do not believe there is an API that lets you do that.
Steven Bone
As stated elsewhere in the thread, I normally write a registry key in HKLM to be able to easily retrieve the installation directory for subsequent installs.
In cases when I am dealing with a setup that hasn't done this, I use the built-in Windows Installer feature AppSearch: http://msdn.microsoft.com/en-us/library/aa367578(v=vs.85).aspx to locate the directory of the previous install by specifying a file signature to look for.
A file signature can consist of the file name, file size and file version and other file properties. Each signature can be specified with a certain degree of flexibility so you can find different versions of the the same file for instance by specifying a version range to look for. Please check the SDK documentation: http://msdn.microsoft.com/en-us/library/aa371853(v=vs.85).aspx
![]() How To Install Crack File
In most cases I use the main application EXE and set a tight signature by looking for a narrow version range of the file with the correct version and date.
Stein ÅsmulStein Åsmul
25.2k1515 gold badges6161 silver badges128128 bronze badges
Recently I needed to automate Natural Docs install through Ketarin. I could assume it was installed into default path (
%ProgramFiles(x86)%Natural Docs ), but I decided to take a safe approach. Sadly, even if the installer created a key on HKLMSoftwareWow6432NodeMicrosoftWindowsCurrentVersionUninstall , none of it's value lead me to find the install dir.
The Stein answer suggests AppSearch MSI function, and it looks interesting, but sadly Natural Docs MSI installer doesn't provide a Signature table to his approach works.
So I decided to search through registry to find any reference to Natural Docs install dir, and I find one into
HKLMSOFTWAREMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18Components key.
I developed a Reg Class in C# for Ketarin that allows recursion. So I look all values through
HKLMSOFTWAREMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18Components and if the Main application executable (NaturalDocs.exe) is found into one of subkeys values, it's extracted (C:Program Files (x86)Natural DocsNaturalDocs.exe becomes C:Program Files (x86)Natural Docs ) and it's added to the system environment variable %PATH% (So I can call 'NaturalDocs.exe' directly instead of using full path).
How To Install A Crack
The Registry 'class' (functions, actually) can be found on GitHub (RegClassCS).
Go To The Install Directory For Gtav Pc
Even if you don't use Ketarin, you can easily paste the function and build it through Visual Studio or CSC.
A more general approach can be taken using RegClassVBS that allow registry key recursion and doesn't depend on .NET Framework platform or build processes.
Please note that the process of enumerating the Components Key can be CPU intense. The example above has a Length parameter, that you can use to show some progress to the user (maybe something like 'i from (subKeysName.Length - 1) keys remaining' - be creative). A similar approach can be taken in RegClassVBS.
Both classes (RegClassCS and RegClassVBS) have documentation and examples that can guide you, and you can use it in any software and contribute to the development of them making a commit on the git repo, and (of course) opening a issue on it's github pages if you find any problem that you couldn't resolve yourself so we can try to reproduce the issue to figure out what we can do about it. =)
jaysponsoredjaysponsored
Copy The Crack To The Install Directory VariableNot the answer you're looking for? Browse other questions tagged windowsdeploymentinstallerwindows-installer or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |