-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle 32bit to 64bit updates in Windows installer
Inno Setup uses separate AppIDs for 32bit and 64bit versions, so we need to do extra work to transparently perform the update: we need to uninstall the old version first, then install the new one, instead of doing in-place update. This is further complicated by a) async nature of the uninstaller (it spawns a helper process to remove its own executable, so it is not sufficient to wait until the process) and b) unfortunate behavior of Poedit's uninstaller, which removes even HKCU user settings. This was fixed recently (see 2c1e41c), but it still needs to be handled for old installs. Handle both of these complications with a small helper DLL that launches the uninstaller in a safe manner.
- Loading branch information
Showing
6 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ xcuserdata | |
|
||
/packages/ | ||
/win32/distrib-* | ||
/win32/uninst-helper.dll | ||
|
||
/*.snap | ||
/poedit_source.tar.bz2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" | ||
ToolsVersion="4.0" | ||
InitialTargets="SetupOutputDir" | ||
DefaultTargets="Distrib"> | ||
|
||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Common.props" /> | ||
|
||
<Import Project="version.props" /> | ||
|
||
<PropertyGroup> | ||
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\..\packages\MSBuildTasks.1.5.0.235\tools</MSBuildCommunityTasksPath> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets"/> | ||
|
||
<PropertyGroup> | ||
<BinDir>../x64/$(Configuration)</BinDir> | ||
<MsvcToolsX86>"$(VCToolsInstallDir)\bin\HostX64\x86"</MsvcToolsX86> | ||
<MsvcLibpathX86>"$(VCToolsInstallDir)\lib\x86"</MsvcLibpathX86> | ||
<InnoCC>..\packages\Tools.InnoSetup.6.2.2\tools\ISCC.exe</InnoCC> | ||
<InnoFlags>/dCONFIG=$(Configuration)</InnoFlags> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PdbFiles Include="$(BinDir)/*.pdb" Exclude="$(BinDir)/vc1*.pdb" /> | ||
</ItemGroup> | ||
|
||
<Target Name="SetupOutputDir" BeforeTargets="PDBs;Distrib;Installer"> | ||
<GitCommits> | ||
<Output TaskParameter="CommitsCount" PropertyName="GitBuildNumber" /> | ||
</GitCommits> | ||
<CreateProperty Value="distrib-$(Configuration)-$(PoeditVersion).$(GitBuildNumber)"> | ||
<Output TaskParameter="Value" PropertyName="OutputDir"/> | ||
</CreateProperty> | ||
</Target> | ||
|
||
<Target Name="Distrib" DependsOnTargets="$(BuildDependsOn);Build;Installer;PDBs"> | ||
<Message Importance="High" Text="Copying debug symbols..." /> | ||
</Target> | ||
|
||
<Target Name="Installer" DependsOnTargets="Build;UninstHelper"> | ||
<Message Importance="High" Text="Creating InnoSetup installer..." /> | ||
<Exec Command="$(InnoCC) /O$(OutputDir) $(InnoFlags) poedit.iss " /> | ||
</Target> | ||
|
||
<Target Name="Build"> | ||
<MSBuild | ||
Projects="..\Poedit.sln" | ||
Properties="Configuration=$(Configuration)" | ||
/> | ||
</Target> | ||
|
||
<Target Name="UninstHelper" Inputs="uninst-helper.c" Outputs="uninst-helper.dll"> | ||
<!-- the helper needs to be compiled as 32bit: --> | ||
<PropertyGroup> | ||
<HelperCompileCmd> | ||
call "$(VCINSTALLDIR)\Auxiliary\Build\vcvarsall.bat" x64_x86 || exit /b 666 | ||
cl /LD /O1 /MT /W3 uninst-helper.c || exit /b 666 | ||
</HelperCompileCmd> | ||
</PropertyGroup> | ||
<WriteLinesToFile File="uninst-helper.bat" Lines="$(HelperCompileCmd)" Overwrite="true" /> | ||
<Exec Command="uninst-helper.bat" /> | ||
<Delete Files="uninst-helper.bat;uninst-helper.exp;uninst-helper.lib;uninst-helper.obj" /> | ||
</Target> | ||
|
||
<Target Name="PDBs" DependsOnTargets="Build"> | ||
<Message Importance="High" Text="Copying debug symbols..." /> | ||
<MakeDir Directories="$(OutputDir)\pdb" /> | ||
<Copy SourceFiles="@(PdbFiles)" DestinationFolder="$(OutputDir)\pdb" SkipUnchangedFiles="true" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.