We have Installshield 2009 for our product. I am trying to muddle my way through it to make some updates (obviously, I am not the original author).
Within, there is a fairly complex arrangement of components and files, plus, there is a script section for some custom work.
I need to accomplish the following, without creating a blank object in the repository.
One of the components needs to create a directory tree (two folders deep).
Within that tree (deepest folder), I need to create a blank file.
Questions:
Do I need to create two components, one for each directory level, or will the tree be created if I specify [INSTALLDIR]folder1\folder2?
I am thinking that the installscript would be the place to create the empty file, based on the CreateFile example in the help. I notice that, in the components page, that, once I typed the value for the Destination property, that a little "tag" of sorts appeared at the start {FOLDER2}. Can I used that tag as an argument to CreateFile and how would I reference it?
Regardless of the project type, I would probably suggest creating the folder structure in the Files and Folders view, and adding the empty file there. It's just simple and you'd be done with fewer chances of error.
As to the questions you asked, neither Basic MSI nor InstallScript projects require components for every folder level on the system. Note that if the folder isn't already there when it executes, the CreateFile approach is unlikely to create the folders for you.
In a Basic MSI project, {FOLDER2} indicates that FOLDER2 is the name of the directory entry, and after CostFinalize there will be a property of the same name that contains its run-time location. You can retrieve it in an InstallScript custom action with MsiGetProperty. In a pure InstallScript project the approach would be a little different, worst case it would be something like TARGETDIR ^ "folder1" ^ "folder2" (my InstallScript is rusty).
Related
I'm developing a project about NLP. I have a large corpus and some code. I want to separate them in my project but I'm wondering what is the correct names to choose,
data vs code like in data segment and code segment in assembly, or
source and resource as one of my friends insists is the correct term.
I also saw something in pycharm menus as mark as source, mark as resource which I supposed is explained in here but I still can't understand what are these source and resource root things and when should I use them. I used to think of resource as time, energy, computational power etc.
answers from JetBrains Content root types
Content root types
By default, all the files in a content root folder are involved in indexing, searching, parsing, code completion, and so on. To change this status, folders within a content root can be assigned to the following categories:
Regular content roots, created as described in Configuring Project Structure. These roots are marked the Content root icon.
A content root is a folder that contains the files that make up your project.
Source roots (or source folders; shown as the Source root icon ).
These roots contain the actual source files and resources. PyCharm uses the source roots as the starting point for resolving imports.
The files under the source roots are interpreted according to their type. PyCharm can parse, inspect, index, and compile the contents of these roots.
Resource roots (PyCharm Professional only) or resource folders; shown as the Resources root icon the Resources root icon.
These roots are intended for resource files in your application (images, style sheets, and so on). By assigning a folder to this category, you tell PyCharm that files in it and in its subfolders can be referenced relative to this folder instead of specifying full paths to them.
Excluded roots (shown as the Excluded root icon) are ones that PyCharm "almost ignores".
These roots contain files and folders ignored by PyCharm when indexing, searching, parsing, watching and so on.
Excluded roots are not visible to PyCharm. Usually, one would like to exclude temporary build folders, generated output, logs, and other project output. Excluding the unnecessary paths is a good way to significantly improve performance.
Template roots (PyCharm Professional only) marked as the Template Folder icon contain templates for the various web projects.
"Resource" is a more general term than "data". By "data" one usually means the input to a program, something that will influence its output and which can be different in each execution.
But there are other types of files that have a more permanent function, for example the icon images used by a program's graphical interface. This type of file would also be placed in a resource directory because it needs to be accessed during execution to assemble the interface. Another example of resources could be translation files (each translation file containing the translated messages used by the program in a specific language).
By those definitions, your text corpuses can be seen as "data" since you might want to apply your program to different corpuses in the future, or as a "resource" if they are more fixed and used as a sort of reference for the program to solve queries based on other user input.
Naturally we can also see things like icon image files as "data" if we plan to change them often and regard them as the input to our program, but that would be atypical.
Overall the boundary between "data" and "resources" are kind of blurry but that would be the overall idea.
I am currently trying to expand our installation program with an option for the user to specify the name of the program group where shortcuts are created under the start menu. (I am aware that this is a somewhat outdated concept)
I am using InstallShield 2015.
I created a localizable property named [PROGRAMGROUP_NAME]. This has automatically created an {ID_STRING46} which I've set to the desired default value. So far so good.
I managed to create a custom dialog with an edit control, which is linked to the above property.
Now comes the tricky part: Under Shortcuts, under "Programs Menu" I first want to add a folder with the program group name, under which to place several shortcuts.
If I enter [PROGRAMGROUP_NAME] that is literally what the name becomes. If I use {ID_STRING46}, it uses the default value, and not what I've entered in the dialog.
Incidentally, when I tried to rename ID_STRING46 to something more meaningful, other things started going wrong so I've left that as is.
What is going wrong here? How do I get the value of the property to be used for the folder name?
EDIT
I am trying to use a custom action now, but I have trouble defining it. My Dialog that sets the property is after CostFinalize, so I assume I have to use SetDirectory - but I have trouble defining it. I get an error stating "could not access network location "
EDIT
I've managed to progress a step. I have manually added a directory with key DIRECTORY_PROGRAM_GROUP (important that it's all caps to make it public) to the directory table. Then, I use a custom action to set that directory to the desired value [ProgramMenuFolder][PROGRAM_GROUP_NAME] after I've run my dialog, and I've modified the shortcut to be created in that folder.
Seems to work great, however, now the program group is no longer removed when uninstalling...
Shortcuts are installed to folders, and the name of the folders below ProgramMenuFolder become the program group as you describe it. So you will need to either build up the Directory table (either directly---note that the DefaultDir column is localizable, and there may already be a string you can update---or through the Files and Folders view) to do what you want, or use custom actions (set property, if before costing; set directory, if after costing) to adjust the location to which your shortcut is installed.
As for the problems renaming ID_STRING46, odds are you didn't update a reference after you changed the name of the string. The simplest way to track down where these are may be to examine differences in the built installer (perhaps using InstallShield's MSI Diff) and then update the relevant references using the direct editor if you can't find them in the normal views.
I need to define the {tmp} constant (i.e. the automatically generated TEMP location), so that it always remains the same and does not change each time it is run. Ideally setting it to the root of the users TEMP directory, rather than the automatically created subdirectory (e.g. is-70G7E.tmp):
C:\Users\Username\AppData\Local\Temp
Instead of:
C:\Users\Username\AppData\Local\Temp\is-XXXXX.tmp
Is this possible and, if so, how could it be done?
To expand on the reason for this, in response to comments below, when using InnoTools Tray, it creates multiple entries in the System Tray Notification Area Icons:
This is because each time it is run, it is run from a different {tmp} folder. If I can set this manually myself to be constant and handle the issues of checking for files in use etc it will resolve this issue.
If there is another way to resolve this, then I am open to suggestions.
It's not possible. The creation of random subdirectory in TEMP is hardcoded. There's no way to change it.
See the CreateTempDir function in Inno Setup source code.
You didn't state why you need it to be constant, but a problem may rise if you use a constant folder. What if the folder or files in it are in use? That's why {tmp} varies, and Inno Setup handles it for you.
However, you can use the {%TEMP} constant or the GetTempDir function instead, with whichever sub-folder you like as a constant. You may need to handle its creation and deletion though.
Consider a solution has 2 projects: ProjectA and ProjectB (both are MonoTouch apps) and ProjectBase. ProjectBase contains the whole application, but Main.cs file (with the entry point) is located in ProjectA and ProjectB (which reference ProjectBase). This way, running any of A/B projects will boot up the application from ProjectBase.
Now, I want to override something for ProjectA only (it might be XIB file, image or a .NET class). Is there any way I can setup the solution so that the code and resources, produced by ProjectBase, are merged with the ones from ProjectA/ProjectB and the latter wins?
I found (probably a quirky and kinda-undefined-behavior-driven way) of overriding XIBs: I just put a XIB into ProjectA and ProjectB, name it the same as it was named in ProjectBase and them exclude it from ProjectBase. Although MonoDevelop compiles all items, it seems that the startup project's XIBs get priority, so that I see ProjectA-specific XIBs when I launch ProjectA and ProjectB-specific XIBs when I launch ProjectB. However, I am not sure it is the way it should behave, plus, from what I can see from build log, ALL projects get built yielding resources at the end.
P.S. I'm sorry if this has been asked previously, but I was not able to find the similar question on SO.
I was once trying to do this for a bunch of apps. I would have thought build order would be ProjectBase and then ProjectA, and the content copy system would be the same... Guess this means we are wrong.
You could do a few things.
A) Build your own program to copy resources which are marked for content. Would not be very hard, just need to read the .csproj files. XML parsing is easy enough in .NET. Run this program on post build. Would just have to be careful when doing builds such as to zip or to the device as I am not sure how it handles post-build events.
B) [This is what I did instead] If I expect to also make ProjectC, ProjectD ... ProjectN I instead made a program to generate my program... (Programception).
What it does, has ProjectBase, and ProjectTempalte. You enter your new project name into this program, say, "MyNewProject" and it will create the correct folder structure, write the correct csproj files, and update SLN file. ProjectTemplate has various placeholders in .csproj files like {PLACEHOLDER} which Programception would just go through and find/replace with my project name. Image files (and in your case XIB) are then only kept within ProjectA (B..C..N) unless I do not expect to try and override them in which case they would stay in ProjectBase. This is a lot easier with a XIBless application I would assume. I never use XIB's anyway.
Hope that helps!
Is there a possibility to add directory (with sub directories) to SupportFiles section in installshield. I have dynamically created content (list of files changes constantly) that I use to support my installation.
Is there any other method to add dynamically whole directory to installation package. I need files from this directory only during installation process. At the end of the installation I want IS to remove these files automatically ?
The ISSetupFile table ( which drives the Support Files pattern ) only supports extracting files to a single directory. There is no way in the UI to tell it to be dynamic although you could have a build automation step that reflects the contents of a directory and wires it up to the table using the automation interface. This still couldn't do sub directories though.
What you probably want to do is creating a self-extracting zip of the files you need as part of your build and add that EXE to Support Files. Then write custom actions that call the EXE to extract the payload to Support Files and another CA to clean it up. Look for the custom action ISSetupFilesExtract and ISSetupFilesCleanup to figure out the best way to do this.
Although I'm late to the party: #BuvinJ mentioned in a comment that you can add directories to "Advanced Files" under "Disk1." In this case, they do appear in the temporary directory (support directory), eg. SUPPORTDIR\Disk1
SUPPORTDIR is a temporary location where the installer dumps files, and cleans them up afterward. An example is C:\Users\<your user name>\AppData\Local\Temp\2\{F6B9B2D6-2A5A-4146-9297-E80A199CB0CB}.
This could be a quicker/cheaper/faster solution to writing custom actions and/or packaging up files by hand in, say, a self-extracting zip file.