I have a function 'VerifySerialNumber' in SerialNumber.dll which depends on msvcr120.dll and msvcp120.dll:
function VerifySerialNumber(serialNumber:String):integer;
external 'VerifySerialNumber#files:SerialNumber.dll,msvcr120.dll,msvcp120.dll cdecl loadwithalteredsearchpath';
In [Files] section:
Source: "{tmp}\msvcp120.dll"; DestDir: {app}\Plugin; Flags: ignoreversion
Source: "{tmp}\msvcr120.dll"; DestDir: {app}\Plugin; Flags: ignoreversion
Source: "{tmp}\SerialNumber.dll"; DestDir: {app}\Plugin; Flags: ignoreversion
The problem is that the install log show "Failed to remove temporary directory: C:\Users\ADMINI~1\AppData\Local\Temp\is-SKE12.tmp" when the install finised. And there are two files, the msvcr120.dll and msvcp120.dll file, remained in the is-SKE12.tmp folder.
Any advice?
Related
I'm using Innosetup for a very simple Windows C++ app. It just has an icon for the main EXE in the start menu group, plus another icon for the uninstaller (unins000.exe, created by Innosetup).
In the [Files] section of the script is:
Source: "C:\...\telecine.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\Telecine.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\uninstall.ico"; DestDir: "{app}"; Flags: ignoreversion
and in the [Icons] section:
Name: "{autoprograms}\Nightshade Arts\Telecine\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\Telecine.ico"
Name: "{autoprograms}\Nightshade Arts\Telecine\Uninstall"; Filename: "{app}\unins000.exe"; IconFilename: "{app}\uninstall.ico"
What works: the two entries are in the program group, the shortcut to Telecine.exe has the Telecine.ico icon next to it, the shortcut to the uninstaller works.
Problem: the uninstaller icon is not the one in uninstall.ico, it is something else, probably contained in unins000.exe itself.
Not sure what has gone wrong. uninstall.ico is there is the app directory, and it contains the right icon. Just doesn't show up.
Not sure where I've gone wrong?
I'm new user in Inno Setup. My problem is that I have some folders and one file. I want to make a setup package to install all of them. Here is my code
[Files]
Source: "D:\POS CAD Standard\CAD\*"; DestDir: "C:\POS CAD Standard"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\POS CAD Standard\acad.lsp"; DestDir: "{userappdata}\Autodesk\AutoCAD 2014\R19.1\enu\support"; Flags: ignoreversion
[Dirs]
Name: "C:\POS CAD Standard"; Attribs:readonly hidden system; Permissions: users-readexec;Flags:
[Icons]
Name: "{group}\{cm:UninstallProgram,POS CAD Standard}"; Filename: "{uninstallexe}"
It works fine, but when I'm trying to setup to another PC my source file is not found, and I want to make some files (not folder) to be read only.
Use Attribs: readonly parameter.
It is supported both in the [Files] and [Dirs] sections.
Source: "D:\POS CAD Standard\CAD\*"; DestDir: "{sd}\POS CAD Standard"; \
Flags: ignoreversion recursesubdirs createallsubdirs; Attribs: readonly
Note that I've used the {sd} constant instead of hardcoding the C: drive (what is a bad practice).
How to use copy hidden external files in Inno Setup? Not to make a file hidden, but to work with hidden files. Because for now: the hidden files are being ignored
Any help? Thanks )
[Files]
Source: "{src}\folder\*"; DestDir: "{app}"; \
Flags: skipifsourcedoesntexist external ignoreversion recursesubdirs createallsubdirs;
When you select files in [Files] section entry using a wildcard, Inno Setup installer explicitly skips hidden files.
You cannot do anything about it.
See RecurseExternalCopyFiles function in Projects\Install.pas, particularly this part:
if SourceIsWildcard then begin
if FindData.dwFileAttributes and FILE_ATTRIBUTE_HIDDEN <> 0 then
Continue; { <-- Skip hidden files, comment by #MartinPrikryl }
FileName := FindData.cFileName;
end
else
FileName := SearchWildcard; { use the case specified in the script }
(This is for external files, as that's what you use. But for compile-time files, it's the same. See BuildFileList in Compile.pas).
All you can do, is to implement the installation in [Code] script yourself, instead of using the [Files] section.
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
Log('Installing files');
DirectoryCopy(ExpandConstant('{src}\folder'), ExpandConstant('{app}'));
end;
end;
For implementation of DirectoryCopy, see my answer to question Inno Setup: copy folder, subfolders and files recursively in Code section.
For compile-time files (without external flag), you can generate list of [Files] entries using a preprocessor function FindFirst.
the answer is You CAN
make windows display hidden files just for you to be able to see them
with your files hidden as you want them inside the folder.
when adding source folder and files step just add the folder (this wildcard *) normally, Inno setup won't add the hidden files. so add them separately.
after you finsih all steps don't run the script and edit the code..
go to [Files] section:
[Files]
Source: "H:\tmp\sweetInstaller\installer.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "H:\tmp\sweetInstaller\hidden_file1.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\hidden_file2.bat"; DestDir: "{app}"; Flags: ignoreversion
AND insert Attribs: hidden; next to files you wish to hide just before Flags:
[Files]
Source: "H:\tmp\sweetInstaller\installer.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "H:\tmp\sweetInstaller\hidden_file1.txt"; DestDir: "{app}"; Attribs: hidden; Flags: ignoreversion
Source: "H:\tmp\sweetInstaller\hidden_file2.bat"; DestDir: "{app}"; Attribs: hidden; Flags: ignoreversion
then you can run the script from the little green play button at the top bar to compile. and you're done ;)
I want to exclude 2 folders by default, unless a component is checked. I don't have all the files individually listed in the [Files] section, as some of them might be added/removed in the future, but there are 2 folders that I need to control.
Here's the code I have:
Source: "source\*"; DestDir: {app}; Excludes: "\plugins\api,\plugins\shared memory"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "source\plugins\api\*"; DestDir: {app}; Flags: recursesubdirs createallsubdirs;
Source: "source\plugins\shared memory\*"; DestDir: {app}; Components: plugins_api; Flags: recursesubdirs createallsubdirs;
What I want:
Those subfolders (api and shared memory) should only be copied if
plugins_api is selected.
If the component plugins_api is not
checked, they should not be copied.
I'd rather avoid including
every file in the .iss file. It is not an option.
What I get with this code:
If the component is not checked, the folders are not copied. Ok.
If the component was checked, the folders are not copied. Not ok.
So it seems the exclude in the first line affects the other 2 lines. How can I avoid this?
2 points:
1) You only have the Components entry on one of the special folders.
2) The special folders, as you have them will be installing their contents direct into the {app} folder.
If you follow the folders in use:
Source: "source\plugins\api\*"; DestDir: {app};
Put contents of source\plugins\api\ in {app}
I expect you want something like:
Source: "source\plugins\api\*"; DestDir: {app}\plugins\api\; Components: plugins_api; Flags: recursesubdirs createallsubdirs;
Source: "source\plugins\shared memory\*"; DestDir: {app}\plugins\shared memory\; Components: plugins_api; Flags: recursesubdirs createallsubdirs;
Using an InnoSetup script (that seems to work fine under XP/Vista), i've a strange behavior under Seven RC:
here is the [Files] section:
[Files]
Source: *.ico; DestDir: {app}\bin; Flags: ignoreversion
Source: dist\*.*; DestDir: {app}\bin; Flags: ignoreversion
Source: catalog\*.*; DestDir: {userappdata}\JetWorksheet\catalog; Flags: recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall
Source: wizards\*.*; DestDir: {userappdata}\JetWorksheet\wizards; Flags: recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall
Source: images\*.*; DestDir: {userdocs}\JetWorksheet\images; Flags: recursesubdirs createallsubdirs
Source: wordlists\*.*; DestDir: {userdocs}\JetWorksheet\wordlists; Flags: recursesubdirs createallsubdirs
The problem is:
In place of using the {userappdata} of the user that started the setup, all the data goes to the "Admin" directories...
I'm surely missing somethings...
You should either use PrivilegesRequired=lowest so your Setup doesnt elevate, or you should place the default user files in a common directory during installation, and then have your application copy them to the user area on startup.