I'm using InnoSetup to create an installer for my WPF application. My application is about ~300Mo.
I've implemented this method to check if the client environment has MS Framework 4.0:
http://www.codeproject.com/Articles/20868/NET-Framework-1-1-2-0-3-5-Installer-for-InnoSetup
This method uses the isxdl.dll.
When I start the installer, it stuck 10 seconds on this task (in InnoSetup debug mode):
Extracting temporary file: C:\Users\Ben\AppData\Local\Temp\is-IKJ7C.tmp\isxdl.dll
This DLL is about 122Ko, that's light.
I've tried to create the same installer (using the same scripts) with a lighter application (about 5Mo), and the installer works well (no more stuck time).
I do not know how it is possible that the application files (the weight of the application) affect the loading of this dll.
All files that are going to be used by Install Script for actions & functions should be placed at the beginning of [Files] section especially when using SolidCompression=True. It's also good option to use Flags: nocompression dontcopy for them.
[Files]
Source: ".\ISWin7.dll"; DestDir: "{tmp}"; Flags: dontcopy nocompression
Source: ".\games\{#BMPDir}\BMP\*"; DestDir: "{tmp}"; Flags: dontcopy nocompression
Source: ".\InnoCallback.dll"; DestDir: "{tmp}"; Flags: dontcopy nocompression
Source: ".\MyAppSourceFiles\*"; DestDir: "{app}"; Flags: ignoreversion
The disadvantage to using solid compression is that because all files
are compressed into a single compressed stream, Setup can no longer
randomly access the files
that makes it to "unpack all files" before it can access the last one. More info here.
Related
I'm trying to get the icon of the unisXXX.exe file to change, and have only been successful by accident.
Here is my .iss (irrelevant fields excluded; have to hand jam this) file:
#define AppName "My App"
#define AppExeName "run.exe"
#define AppSource "C:\Path\To\App\Src"
[Setup]
SetupIconFile={#AppSource}\foobar\app.ico
UninstallDisplayName={#AppName}
UninstallDisplayIcon={#AppSource}\foobar\app.ico
;UninstallIconFile={#AppSource}\foobar\app.ico
;Ignored since 5.0.0 apparently
[Files]
Source: "{#AppSource}\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppSource}\dll\*"; DestDir: "{app}\dll"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#AppSource}\foobar\*"; DestDir: "{app}\foobar"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{autoprograms}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{#AppSource}\foobar\app.ico"
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{#AppSource}\foobar\app.ico"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"; IconFilename: "{#AppSource}\foobar\app.ico"
Now I also have a [Code] section that executes a series as follows:
CurStepChanged -> CurStep = ssInstall -> IsUpdate -> True -> UninstallPriorVersion
Where IsUpdate checks the registry values for the installation and if the new installer is newer, then UninstallPriorVersion uninstalls the old version before installing the new version.
After I compile the .iss the app.ico is applied to the setup executable; and once I run the executable, the icons for the program menu, add/remove programs and desktop icon are all applied correctly. The unisXXX.exe however remains as the computer with a disc icon, and it is only changed to the same icon as the setup executable once a new installer version is run and then the old one is uninstalled, giving me a unis001.exe with the appropriate icon.
Is there any indication why the icon is not being applied to the unis000.exe?
I want to create an user-friendly setup installer for my application.
Actually it's very basic:
[Setup]
AppName=My Application
AppVersion=2.5
DefaultDirName={pf}\MyApplication
DisableProgramGroupPage=yes
UninstallDisplayIcon={app}\MyApp.exe
OutputDir=userdocs:MyApp
SetupIconFile=icon.ico
UninstallIconFile=icon.ico
[Components]
Name: "program"; Description: "Program Files"; Types: full compact custom; Flags: fixed
Name: "driver"; Description: "Driver files"; Types: full
Name: "driver\USB"; Description: "USB-Driver"; Types: full; Flags: checkablealone
Name: "driver\MISC"; Description: "MISC-Driver"; Types: full ;Flags: checkablealone
[Files]
Source: "*.exe"; DestDir: "{app}"; Components: program
Source: "*.dll"; DestDir: "{app}"; Components: program
Source: "*.bmp"; DestDir: "{app}"; Components: program
Source: "*.ini"; DestDir: "{app}"; Components: program
Source: "USBDriver.exe"; DestDir: "{app}"; Components: driver\usb
Source: "MiscDriver.exe"; DestDir: "{app}"; Components: driver\misc
[Run]
Filename: "{app}\USBDriver.exe"; Description: "Install USB-Driver"; Flags: postinstall skipifdoesntexist
Filename: "{app}\MiscDriver.exe"; Description: "Install Misc-Driver"; Flags: postinstall skipifdoesntexist runascurrentuser
[Icons]
Name: "{commonprograms}\MyApp"; Filename: "{app}\MyApp.exe"
Name: "{commondesktop}\MyApp"; Filename: "{app}\MyApp.exe"
The user should decide if he wants to install the both drivers.
For that I created the two [Run] section entries.
After the installation, the driver installation should start.
Actually it's buggy there. I got a problem if I checked no driver installation component, or just one of them. Nevertheless the installer still runs both setup files I got to choose after installation.
How could I start the driver installation only if the user checked its component for installation?
Thanks in advance
You have to filter the [Run] section entries using the Components parameter, the same way you filter the entries in the [Files] section already:
[Run]
Filename: "{app}\USBDriver.exe"; Description: "Install USB-Driver"; \
Components: driver\usb; Flags: postinstall
Filename: "{app}\MiscDriver.exe"; Description: "Install Misc-Driver"; \
Components: driver\misc; Flags: postinstall runascurrentuser
Note that I've removed the skipifdoesntexist flag as I suppose it was your attempt to solve the problem. In general you should not use it, as its only effect is:
If this flag is specified in the [Run] section, Setup won't display an error message if Filename doesn't exist.
If you want to run the installers always, when they are installed, just remove the postinstall flag and replace the Description parameter with the StatusMsg parameter.
You also probably do not want to copy the installers to the {app} at all. Install them to the {tmp} and use the deleteafterinstall flag to have the main installer remove them after the installation.
[Files]
Source: "USBDriver.exe"; DestDir: "{tmp}"; Components: driver\usb; Flags: deleteafterinstall
Source: "MiscDriver.exe"; DestDir: "{tmp}"; Components: driver\misc; Flags: deleteafterinstall
[Run]
Filename: "{tmp}\USBDriver.exe"; StatusMsg: "Installing USB-Driver"; \
Components: driver\usb; Flags: runasoriginaluser
Filename: "{tmp}\MiscDriver.exe"; StatusMsg: "Installing Misc-Driver"; \
Components: driver\misc
(Without the postinstall flag, the default is the runascurrentuser, hence I switched the flags).
I have a Visual Studio program that I made an installer for using Inno Setup. I then had a few errors when trying to open the application such as missing .dll's which I added to the project directory. I then got an error like "procedure entry point could not be located in the dynamic link library PvBuffer.dll" which I fixed by adding PvBuffer.dll to the project directory.
Now when I make the installer and try to run the installed application, nothing happens. I click on the application and the program simply crashes. No errors, nothing. The release .exe file works fine in the project but the installed application doesn't. Any suggestions of what might be causing this? Thanks
Edit 1: Slappy here is my installer script:
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{AFC14F65-6DD7-479B-AA27-C15F14763641}
AppName=FLIR615
AppVersion=1.5
;AppVerName=FLIR615 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\FLIR615
DefaultGroupName=FLIR615
AllowNoIcons=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: "D:\FLIR Project\FLIR Project\GEVPlayerSample\SampleRelease\GEVPlayerSample.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\FLIR Project\FLIR Project\GEVPlayerSample\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\FLIR615"; Filename: "{app}\GEVPlayerSample.exe"
Name: "{group}\{cm:ProgramOnTheWeb,FLIR615}"; Filename: "http://www.example.com/"
Name: "{group}\{cm:UninstallProgram,FLIR615}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\FLIR615"; Filename: "{app}\GEVPlayerSample.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\FLIR615"; Filename: "{app}\GEVPlayerSample.exe"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\GEVPlayerSample.exe"; Description: "{cm:LaunchProgram,FLIR615}"; Flags: nowait postinstall skipifsilent
Edit 2 KirbyFan64SOS Here is what the errors are in dependency walker:
Edit 3 After monitoring the crash in event viewer I noticed some errors which I have posted below
The errors that are the linked to the program that crashed seem to relate to KERNALBASE.dll. Does anyone know what this means?
I had the same issue and the cause for it is not having dll. Right dll (along with 32/64 bit) and exact version is very important.
I want to store my app in the current user's AppData directory to avoid problems with permissions we had when auto-updating our app (when it's stored in Program Files). We don't give the user the option of where to install the app. We've had complaints from non-admin users that the installer stores the app in the admin's AppData directory (after UAC of course), instead of the current user's AppData directory, which then prevents the app from running in the future.
Firstly, I had DefaultDirName={userappdata}\{#MyAppName}. Then I tried DefaultDirName={commonappdata}\{#MyAppName}. Then I tried that along with PrivilegesRequired=lowest and even as PrivilegesRequired=none as the Make InnoSetup installer request privileges elevation only when needed question suggested.
This is my script as of right now in case I'm missing something obvious:
; Script generated by the Inno Setup Script Wizard.
;SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Teamwork Chat"
#define MyAppVersion "0.10.0"
#define MyAppPublisher "Digital Crew, Ltd."
#define MyAppURL "http://www.teamwork.com/"
#define MyAppExeName "TeamworkChat.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{0F063485-F5AF-4ADE-A9F9-661AB3BAA661}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={userappdata}\{#MyAppName}
DisableDirPage=yes
DefaultGroupName={#MyAppName}
OutputDir=E:\chat-client\dist
OutputBaseFilename={#MyAppName}_for_Windows32_Installer-{#MyAppVersion}
SetupIconFile=E:\chat-client\icons\teamwork_chat.ico
WizardImageFile=E:\chat-client\icons\chatWizardImageFile.bmp
Compression=lzma
SolidCompression=yes
PrivilegesRequired=none
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "E:\chat-client\dist\TeamworkChat\win32\TeamworkChat.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\chat-client\dist\TeamworkChat\win32\ffmpegsumo.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\chat-client\dist\TeamworkChat\win32\icudtl.dat"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\chat-client\dist\TeamworkChat\win32\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\chat-client\dist\TeamworkChat\win32\libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\chat-client\dist\TeamworkChat\win32\nw.pak"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Edit
I've changed two options but still no luck;
PrivilegesRequired=lowest
...
[Icons]
...
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Edit 2:
I've added the runasoriginaluser flag and generated a new AppId (GUID) but still no luck;
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent runasoriginaluser
Edit 3:
I've created a simple GitHub repository with the source files and Inno script.
Edit 4:
I had been testing on Windows 8.1. It seems to work when compiled on Windows 7, and ran on Windows 8, but not when compiled on 8 and ran on 8.
Edit 5:
It's solved now but to clear things up regarding Edit 4, it wasn't working only on my machine. It worked on other Windows 8 machines. Must've been some weird caching or something (even though I changed the AppId).
From the wording of your question and if I am understanding you correctly, it sounds like this is because you are "validating with an admin account for the install to run." If this is the case and you are entering a different account (from that which you are logged in with) at the UAC prompt, the current user then actually becomes the Administrator account you just entered at the UAC prompt and not the account you are logged in with. Therefore, as long as you are being asked to elevate the installation using UAC, it will not end up in the logged in user's AppData directory.
What you may need to do is use the runasoriginaluser function, which will use the logged in user credentials instead of the account you entered at the UAC prompt, or find what is causing the UAC elevation prompt.
See also Inno Setup Creating registry key for logged in user (not admin user).
The MSDN documentation on Installation Context may also be useful.
It should work with PrivilegesRequired=lowest. And it's the correct approach. If it does not, we want to see a log file.
The lowest will make the installer run within context of the current unprivileged user. Hence all constants, like {userappdata}, {userdesktop}, etc, will refer to the current user.
Anyway, to answer your question, you can use the code below.
But that's just for special situations, when the installer really needs administrator privileges (e.g. to register some system DLL), but still needs to deploy files for the original user. Like here: Inno Setup - Register components as an administrator.
[Files]
Source: "MyProg.exe"; DestDir: "{code:GetAppData}"
[Code]
var
AppDataPath: string;
function GetAppData(Param: string): string;
begin
Result := AppDataPath;
end;
function InitializeSetup(): Boolean;
var
Uniq: string;
TempFileName: string;
Cmd: string;
Params: string;
ResultCode: Integer;
Buf: AnsiString;
begin
AppDataPath := ExpandConstant('{userappdata}');
Log(Format('Default/Fallback application data path is %s', [AppDataPath]));
Uniq := ExtractFileName(ExpandConstant('{tmp}'));
TempFileName :=
ExpandConstant(Format('{commondocs}\appdata-%s.txt', [Uniq]));
Params := Format('/C echo %%APPDATA%% > %s', [TempFileName]);
Log(Format('Resolving APPDATA using %s', [Params]));
Cmd := ExpandConstant('{cmd}');
if ExecAsOriginalUser(Cmd, Params, '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and
(ResultCode = 0) then
begin
if LoadStringFromFile(TempFileName, Buf) then
begin
AppDataPath := Trim(Buf);
Log(Format('APPDATA resolved to %s', [AppDataPath]));
end
else
begin
Log(Format('Error reading %s', [TempFileName]));
end;
DeleteFile(TempFileName);
end
else
begin
Log(Format('Error %d resolving APPDATA', [ResultCode]));
end;
Result := True;
end;
More similar questions:
Inno Setup Using {localappdata} for logged in user
Inno Setup - puts user files in admin documents
I have done a considerable amount of searching for a solution to what i believe is a very simple answer. I am a very novice INNO Setup Users, so please excuse the question.
I have an Excel file which i want to open after installation. The install process works just fine however i am unable to have the excel file launch automatically on Setup completion. It's my understanding that ShellExec is used to launch non-exe files, however I believe i have this line incorrect.
Any and all help would be greatly appreciated. Here are the snippets of the code which i believe apply to this issue
#define MyAppName "MyApplication"
#define MyAppExeName "MyApplication.xlsm"
[Setup]
AppName={#MyAppName}
DefaultDirName={pf}\{#MyAppName}
OutputDir=C:\Documents and Settings\Test\Desktop
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Files]
Source: "C:\\MyApplication.xlsm"; DestDir: "{app}"; Flags: ignoreversion
[ShellExec]
Shellexec('',{#MyAppExeName},'','',SW_HIDE,ewWaitUntilTerminated,ResultCode)
Thank you for taking the time to aid me on this issue.
[Run]
Filename: {app}\{#MyAppExeName}; Description: Run {#MyAppName}; Flags: postinstall shellexec
Replace your [ShellExec] section (which is not recognised by the compiler so will just be ignored) with the above.